/* =====================================================================
   add-property.css — أنماط صفحة «أضف عقارك» (add-property.php) وحدها.
   اتنقلت من <style> داخلي (23 ك) كان بيعيد تعريف نظام التصميم كله من الأول.
   ⚠️ قاعدة: التوكنز (--ink / --brand / --bg / --line / --fs-* / --r-* / الظلال)
   بتيجي من assets/css/styles.css المشترك — ممنوع إعادة تعريفها هنا.
   ===================================================================== */

:root[data-theme="dark"] .form-group input::placeholder,
:root[data-theme="dark"] .form-group textarea::placeholder { color: var(--ink-faint); }

/* خلفية الصفحة بس — الخط والتوكنز والريسِت من styles.css المشترك */
html { scroll-behavior: smooth; }
body { background: var(--bg-soft); }

/* ===== هيدر بطولي (Hero) ===== */
.ap-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff; padding: 40px 24px 46px; border-bottom: none;
}
.ap-hero h1, .form-section h2 { font-family: 'El Messiri', El Messiri Fallback, 'Cairo', Cairo Fallback, sans-serif; }
.ap-hero::after {
  content: ""; position: absolute; inset-inline-end: -80px; top: -80px;
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.14), transparent 70%);
}
.ap-hero-content { max-width: 1000px; margin: 0 auto; position: relative; z-index: 1; }
.ap-hero h1 { font-size: 30px; font-weight: 800; margin-bottom: 8px; letter-spacing: -.3px; }
.ap-hero p { font-size: var(--fs-140); color: rgba(255,255,255,.9); line-height: 1.6; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 16px; }
.hero-trust span { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-125); font-weight: 700; color: rgba(255,255,255,.95); }
.hero-trust svg { width: 16px; height: 16px; flex: 0 0 auto; }

.ap-container { max-width: 1000px; margin: -24px auto 0; padding: 0 24px 48px; position: relative; z-index: 2; }
.progress-card { background: var(--bg); border-radius: var(--r-md); box-shadow: var(--sh-card); padding: 18px 20px; margin-bottom: 22px; }

.progress-bar { height: 6px; background: var(--line); border-radius: var(--r-pill); margin-bottom: 24px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--brand); transition: width .3s; }

.steps-grid { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.step-circle { width: 38px; height: 38px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line); color: var(--ink-faint); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: var(--fs-125); transition: all .25s; flex: 0 0 auto; }
.step-circle.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: var(--sh-brand-sm); transform: scale(1.06); }
.step-circle.completed { background: var(--teal); border-color: var(--teal); color: #fff; }

.form-section { background: var(--bg); border-radius: var(--r-lg); padding: 36px; display: none; box-shadow: var(--sh-card); }
.form-section.active { display: block; animation: slideIn .35s cubic-bezier(.2,.8,.2,1); }
@keyframes slideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.form-section h2 { font-size: 25px; font-weight: 800; margin-bottom: 8px; letter-spacing: -.3px; }
.form-section-desc { font-size: var(--fs-130); color: var(--ink-soft); margin-bottom: 26px; padding: 13px 16px; background: var(--brand-tint); border-radius: var(--r-sm); border-inline-start: 3px solid var(--brand); line-height: 1.6; }
.form-section h3 { font-size: var(--fs-145); font-weight: 800; margin: 22px 0 12px; }

.options-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 12px; margin-bottom: 20px; }
.option-card { position: relative; padding: 20px 10px; border: 1.5px solid var(--line); border-radius: var(--r-lg); background: var(--bg); cursor: pointer; text-align: center; transition: transform .18s ease, border-color .2s, background .2s, box-shadow .2s; }
.option-card:hover { border-color: var(--brand); background: var(--brand-tint); transform: translateY(-3px); }
.option-card.selected { border-color: var(--brand); background: linear-gradient(160deg, var(--brand), var(--brand-deep)); box-shadow: var(--sh-brand); transform: translateY(-2px); }
.option-card.selected .option-icon, .option-card.selected .option-label { color: #fff; }
.option-card.selected::after { content: ""; position: absolute; top: 8px; inset-inline-start: 10px; width: 20px; height: 20px; background: #fff; border-radius: 50%; box-shadow: var(--sh-raised); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23E15B3D' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; }
/* إخفاء مرئي مع إبقاء الحقل قابلاً للتركيز (كيبورد + قارئ شاشة) — مش display:none */
.option-card input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
/* حلقة تركيز واضحة لما المستخدم يوصل للكارت بالكيبورد */
.option-card:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 2px; }
.option-icon { width: 40px; height: 40px; margin: 0 auto 9px; color: var(--brand); transition: color .2s; }
.option-label { font-weight: 800; font-size: var(--fs-125); line-height: 1.35; color: var(--ink); transition: color .2s; }

.form-group { margin-bottom: 18px; }
.form-group label,
/* .fg-label = عنوان مجموعة حقول (مش label لحقل واحد) — مجموعات زي جرد المالك
   وحقول multi بتتربط بيه عبر role="group" + aria-labelledby بدل label يتيم */
.form-group .fg-label { display: block; font-weight: 700; margin-bottom: 7px; font-size: var(--fs-125); color: var(--ink); }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm); font-size: var(--fs-140); font-family: inherit; background: var(--bg); transition: border-color .2s, box-shadow .2s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus-ring); }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--ink-faint); }
/* رسالة خطأ الحقل — دائمة (تظهر بمجرد امتلائها) ومربوطة بالحقل عبر aria-describedby */
.field-msg { display: none; margin-top: 6px; font-size: var(--fs-120); font-weight: 700; color: var(--brand-deep); line-height: 1.45; }
.field-msg:not(:empty) { display: block; }
.form-group textarea { resize: vertical; min-height: 92px; line-height: 1.6; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

.search-wrapper { position: relative; }
.search-results { position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); border: 2px solid var(--brand); border-top: none; max-height: 200px; overflow-y: auto; z-index: 100; display: none; border-radius: 0 0 var(--r-sm) var(--r-sm); }
.search-results.show { display: block; }
.result-group { padding: 0; }
.result-group-title { padding: 10px 12px; font-weight: 700; font-size: var(--fs-110); color: var(--brand); background: var(--bg-soft); }
.result-item { padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--line); font-size: var(--fs-120); transition: background .2s; }
.result-item:hover { background: var(--bg-soft); }
.result-item-name { font-weight: 600; }
.result-item-desc { font-size: var(--fs-110); color: var(--ink-soft); margin-top: 2px; }

/* منتقي المناطق الموحّد (canonical) — بديل الكتابة الحرة (يمنع تشظّي الأسماء) */
.place-picker { border: 1.5px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--bg); }
.place-search { width: 100%; padding: 12px 14px; border: none; border-bottom: 1px solid var(--line); font-size: var(--fs-140); font-family: inherit; background: var(--bg); color: var(--ink); }
.place-search:focus { outline: none; }
.place-search::placeholder { color: var(--ink-faint); }
.place-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.place-tab { flex: 0 0 auto; padding: 7px 12px; border: 1.5px solid var(--line); background: var(--bg); border-radius: var(--r-pill); font-family: inherit; font-size: var(--fs-120); font-weight: 700; color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.place-tab.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.place-tab:disabled { opacity: .45; cursor: default; }
.place-tab .pt-n { font-size: 10px; opacity: .7; }
.place-list { max-height: 240px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; padding: 10px; }
.place-item { text-align: start; padding: 10px 12px; border: 1.5px solid var(--line); background: var(--bg); border-radius: var(--r-sm); font-family: inherit; font-size: var(--fs-125); font-weight: 600; color: var(--ink); cursor: pointer; transition: border-color .2s, background .2s; }
.place-item:hover { border-color: var(--brand); background: var(--brand-tint); }
.place-empty { grid-column: 1 / -1; padding: 18px; text-align: center; color: var(--ink-faint); font-size: var(--fs-125); }
.place-chosen { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--brand); background: var(--brand-tint); border-radius: var(--r-sm); }
.place-chosen .pc-txt { font-size: var(--fs-135); color: var(--ink); }
.place-chosen .pc-change { flex: 0 0 auto; padding: 6px 12px; border: 1.5px solid var(--brand); background: var(--bg); color: var(--brand); border-radius: var(--r-pill); font-family: inherit; font-size: var(--fs-120); font-weight: 800; cursor: pointer; }
.place-free-toggle { margin-top: 10px; background: none; border: none; color: var(--brand); font-family: inherit; font-size: var(--fs-125); font-weight: 700; cursor: pointer; text-decoration: underline; padding: 4px 0; }
.place-free-hint { font-size: var(--fs-110); color: var(--ink-faint); margin-top: 6px; }

.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; }
.checkbox-item { position: relative; padding: 10px; border: 2px solid var(--line); border-radius: var(--r-sm); cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: var(--fs-120); transition: all .3s; }
.checkbox-item:hover { border-color: var(--brand); background: var(--brand-tint); }
/* إخفاء مرئي مع إبقاء الشيك بوكس قابلاً للتركيز (كيبورد + قارئ شاشة) — مش display:none */
.checkbox-item input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.checkbox-item:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 2px; }
.checkbox-item input:checked + svg { stroke: #fff; stroke-width: 2; }
.checkbox-item input:checked ~ span { color: #fff; }
.checkbox-item input:checked { accent-color: var(--brand); }

/* When checkbox is checked - solid orange background */
.checkbox-item input:checked {
  accent-color: var(--brand);
}

.checkbox-item input:checked ~ * {
  color: #fff;
}

/* Full orange background and border when checked */
.checkbox-item:has(input:checked) {
  background: var(--brand) !important;
  border: 3px solid var(--brand-deep) !important;
  color: #fff;
}

.checkbox-item:has(input:checked) svg {
  stroke: #fff !important;
  stroke-width: 2.5 !important;
}

.checkbox-item svg { stroke: var(--ink-soft); width: 16px; height: 16px; transition: all .3s; }

.info-box { background: var(--brand-tint); padding: 12px 16px; border-radius: var(--r-sm); border-inline-start: 3px solid var(--brand); margin: 20px 0; font-size: var(--fs-120); line-height: 1.5; }

/* ===== دواير الخطوات: قابلة للضغط + اسم الخطوة ===== */
.step-circle { cursor: pointer; position: relative; }
.step-circle.clickable:hover { transform: scale(1.12); box-shadow: var(--sh-brand-sm); }
.step-circle:not(.clickable) { cursor: default; }
.progress-label { display:flex; justify-content:space-between; align-items:center; font-size:var(--fs-125); font-weight:700; color:var(--ink-soft); margin-bottom:8px; }
.progress-label b { color: var(--brand); }

/* ===== منطقة رفع الصور (سحب وإفلات + معاينات) ===== */
.upload-zone {
  position: relative;
  border: 2px dashed var(--line);
  border-radius: var(--r-md);
  padding: 34px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .25s ease;
  background: var(--bg-soft);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--brand);
  background: var(--brand-tint);
}
/* حلقة تركيز لما المستخدم يوصل لمنطقة الرفع بالكيبورد — Enter/Space بيفتحوا المنتقي */
.upload-zone:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 2px; }
.upload-zone svg { width: 42px; height: 42px; color: var(--brand); margin: 0 auto 10px; display:block; }
.upload-zone .uz-title { font-weight: 800; font-size: var(--fs-140); color: var(--ink); margin-bottom: 4px; }
.upload-zone .uz-hint { font-size: var(--fs-120); color: var(--ink-faint); }
/* إخفاء مرئي مع إبقاء input الملف قابلاً للتركيز — Enter/Space على الحقل بيفتحوا منتقي الملفات */
.upload-zone input[type="file"] { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }

.previews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.preview-item {
  position: relative;
  aspect-ratio: 1/1;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 2px solid var(--line);
  animation: previewIn .25s ease;
}
@keyframes previewIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.preview-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-item .remove-img {
  position: absolute;
  top: 5px;
  inset-inline-end: 5px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: var(--fs-130);
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.preview-item .remove-img:hover { background: var(--brand); }
.preview-item .main-tag {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  background: rgba(225,91,61,0.92);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  padding: 3px 0;
}
.upload-counter { margin-top: 10px; font-size: var(--fs-125); font-weight: 700; color: var(--ink-soft); }
.upload-counter b { color: var(--brand); }

/* ===== توست الرسائل: نفس نظام الموقع الموحّد (.sk-toast في map-toast.css) ===== */
/* حاوية التوست الموحّدة — تُنشأ ديناميكيًا (#skToastWrap) زي باقي صفحات سكن */

/* ===== حقل فيه خطأ: إطار أحمر + اهتزاز ===== */
.field-error {
  border-color: var(--brand) !important;
  animation: fieldShake .35s ease;
  box-shadow: var(--focus-ring) !important;
}
@keyframes fieldShake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
}

.btn-group { display: flex; gap: 12px; margin-top: 30px; }
.btn-group .btn-brand { flex: 1; }
.btn { padding: 14px 22px; border: none; border-radius: var(--r-pill); cursor: pointer; font-weight: 800; font-size: var(--fs-140); transition: transform .18s ease, box-shadow .2s, background .2s; font-family: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-brand { background: var(--brand); color: #fff; box-shadow: var(--sh-brand); }
.btn-brand:hover { background: var(--brand-deep); }
.btn-brand:hover { transform: translateY(-2px); box-shadow: var(--sh-brand); }
.btn-brand:active { transform: translateY(0); }
.btn-ghost { background: var(--bg); color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { background: var(--bg-soft); border-color: #d8d5ce; }

.add-new-area { background: var(--bg-soft); padding: 14px; border-radius: var(--r-sm); margin-top: 12px; border: 1px solid var(--line); }
.add-new-area input { margin-top: 6px; }

/* ===== ريسبونسف كامل لكل الأجهزة ===== */
@media (max-width: 900px) {
  .form-section { padding: 30px; }
}
@media (max-width: 680px) {
  .ap-hero { padding: 32px 18px 40px; }
  .ap-hero h1 { font-size: 24px; }
  .ap-hero p { font-size: var(--fs-130); }
  .ap-container { padding: 0 16px 40px; }
  .form-grid { grid-template-columns: 1fr; }
  .options-grid { grid-template-columns: repeat(3, 1fr); }
  .form-section { padding: 22px 18px; border-radius: var(--r-md); }
  .form-section h2 { font-size: 21px; }
  .checkbox-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 440px) {
  .ap-hero h1 { font-size: 21px; }
  .options-grid { grid-template-columns: repeat(2, 1fr); }
  .btn-group { flex-direction: column-reverse; }
  .btn { width: 100%; padding: 15px; }
  .step-circle { width: 33px; height: 33px; font-size: var(--fs-115); }
  .hero-trust { gap: 8px 14px; }
  .previews-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
}

.required::after { content: " *"; color: var(--brand); }

/* خريطة تحديد الموقع (زي أوبر) — الإطار من بطاقة الخريطة الموحّدة (.sk-map-card في map-toast.css) */
.map-pick { margin-top: 14px; }
.map-pick .mc-t { flex: 1; }
.map-addr { display: block; font-size: var(--fs-115); font-weight: 600; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-loc-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-tint); color: var(--brand); border: 1px solid var(--brand); border-radius: var(--r-pill); padding: 8px 14px; font-family: inherit; font-size: var(--fs-125); font-weight: 800; cursor: pointer; white-space: nowrap; transition: background .18s; flex-shrink: 0; margin-inline-start: auto; }
.map-loc-btn:hover { background: var(--brand); color: #fff; }
#pickMap { height: 340px; }
.map-hint { font-size: var(--fs-115); color: var(--ink-faint); padding: 9px 14px; border-top: 1px solid var(--line); background: var(--bg-soft); }
.pick-toggle { position: absolute; top: 10px; inset-inline-start: 10px; z-index: 800; display: flex; gap: 2px; background: var(--bg); border-radius: var(--r-pill); box-shadow: var(--sh-raised); padding: 3px; }
.pick-toggle button { border: none; background: none; font-family: inherit; font-size: var(--fs-120); font-weight: 800; padding: 6px 13px; border-radius: var(--r-pill); cursor: pointer; color: var(--ink-soft); transition: background .18s, color .18s; }
.pick-toggle button.on { background: var(--brand); color: #fff; }

/* حقول النوع الديناميكية */
#typeFields:not(:empty) { margin: 4px 0 6px; }
.type-fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.type-fields-grid .tf-full { grid-column: 1 / -1; }
.tf-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: var(--fs-135); }
.tf-check input { width: auto; margin: 0; }
.tf-multi { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 6px; }
@media (max-width: 640px) { .type-fields-grid { grid-template-columns: 1fr; } }

/* صفوف جرد المالك */
.inv-row { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.inv-row input, .inv-row select { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); font-family: inherit; font-size: var(--fs-130); }
.inv-del { width: 34px; height: 34px; border: 1px solid var(--line); background: var(--bg); border-radius: var(--r-sm); cursor: pointer; color: #B4231F; font-weight: 800; }
@media (max-width: 640px) { .inv-row { grid-template-columns: 1fr 1fr auto; } .inv-row input { grid-column: 1 / -1; } }
.pick-pin { background: none; border: none; }
.pick-pin-in { width: 40px; height: 40px; border-radius: 50% 50% 50% 4px; background: var(--brand); transform: rotate(-45deg); display: flex; align-items: center; justify-content: center; box-shadow: var(--sh-brand); border: 2.5px solid #fff; }
.pick-pin-in svg { width: 18px; height: 18px; transform: rotate(45deg); }
.leaflet-container { font-family: 'Cairo', Cairo Fallback,'Segoe UI',sans-serif !important; }
