/* ═══════════════════════════════════════════════════════════════════════════
   SRIDIRA CMS · Shared design system
   White · Gold · Dark Green — premium real-estate language, carried over
   from the original Allure Avani portal.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Palette */
  --green-950: #081f15;
  --green-900: #0d2b1e;
  --green-800: #123a28;
  --green-700: #1a4d35;
  --green-600: #256b4a;
  --gold-500:  #c9a227;
  --gold-400:  #d4b048;
  --gold-300:  #e6cc7a;
  --gold-grad: linear-gradient(135deg, #b8942f 0%, #e6cc7a 50%, #c9a227 100%);
  --white:     #ffffff;
  --ivory:     #faf8f2;
  --ink:       #17251e;
  --muted:     #5f6f66;
  --line:      rgba(13, 43, 30, 0.12);
  --line-solid:#e3e0d6;
  --danger:    #b03a2e;
  --warn:      #b8860b;
  --ok:        #1e7d4f;
  --info:      #2f6f8f;

  /* Type */
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body:    "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Effects */
  --glass-bg:     rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.55);
  --shadow-soft:  0 8px 32px rgba(13, 43, 30, 0.12);
  --shadow-lift:  0 16px 48px rgba(13, 43, 30, 0.18);
  --radius:       18px;
  --ease:         cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(201, 162, 39, 0.14), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(37, 107, 74, 0.12), transparent 55%),
    radial-gradient(700px 500px at 100% 100%, rgba(13, 43, 30, 0.10), transparent 60%),
    var(--ivory);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* ── Brand marks ───────────────────────────────────────────────────────── */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; letter-spacing: .02em;
  color: var(--gold-300); background: var(--green-900);
  border: 1px solid rgba(201, 162, 39, 0.5);
  box-shadow: 0 4px 14px rgba(13, 43, 30, 0.25);
}
.brand-mark.sm { width: 36px; height: 36px; font-size: .92rem; border-radius: 10px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.18; min-width: 0; }
.brand-name { font-weight: 600; letter-spacing: .2em; font-size: .82rem; color: var(--green-900); white-space: nowrap; }
.brand-sub  { font-size: .63rem; letter-spacing: .17em; text-transform: uppercase; color: var(--gold-500); font-weight: 500; }

.gold-rule {
  width: 84px; height: 2px; margin: 14px auto;
  background: var(--gold-grad); border-radius: 2px; position: relative;
}
.gold-rule::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 7px; height: 7px; transform: translate(-50%, -50%) rotate(45deg);
  background: var(--gold-500);
}

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius);
}

/* ── Fields ────────────────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: .74rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--green-800); margin-bottom: 7px;
}
.field label em { color: var(--gold-500); font-style: normal; }
.field-hint { font-size: .72rem; color: var(--muted); margin-top: 6px; line-height: 1.5; }

.field input, .field select, .field textarea,
.search-input, .filter-select {
  width: 100%; padding: 13px 15px;
  font-family: var(--font-body); font-size: .95rem; color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line); border-radius: 12px;
  outline: none; appearance: none;
  transition: border-color .25s, box-shadow .25s, background .25s;
}
.field textarea { resize: vertical; min-height: 84px; line-height: 1.55; }
.field select, .filter-select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230d2b1e' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center;
  padding-right: 38px;
}
.field input:focus, .field select:focus, .field textarea:focus,
.search-input:focus, .filter-select:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18);
  background: var(--white);
}
.field input.invalid, .field select.invalid, .field textarea.invalid {
  border-color: var(--danger); box-shadow: 0 0 0 3px rgba(176, 58, 46, 0.12);
}
.field input:disabled, .field select:disabled, .field textarea:disabled {
  background: rgba(13, 43, 30, .04); color: var(--muted); cursor: not-allowed;
}
.field-row { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }

/* ── Chips (radio groups) ──────────────────────────────────────────────── */
.chip-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
@media (min-width: 560px) { .chip-grid { grid-template-columns: repeat(3, 1fr); } }
.chip-grid.cols-1 { grid-template-columns: 1fr; }
.chip-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.chip { position: relative; display: block; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 46px; padding: 9px 10px;
  font-size: .78rem; font-weight: 500; color: var(--green-800);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line); border-radius: 11px;
  cursor: pointer; user-select: none;
  transition: all .22s var(--ease);
}
.chip:hover span { border-color: rgba(201, 162, 39, 0.5); }
.chip input:checked + span {
  background: var(--green-900); color: var(--gold-300);
  border-color: var(--green-900);
  box-shadow: 0 6px 16px rgba(13, 43, 30, 0.25);
  transform: translateY(-1px);
}
.chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.3); }

/* ── Checkboxes ────────────────────────────────────────────────────────── */
.check-inline {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: .85rem; color: var(--ink); margin: 4px 0 18px; cursor: pointer;
}
.check-inline.small { font-size: .76rem; color: var(--muted); margin: -6px 0 14px; align-items: center; }
.check-inline input {
  width: 19px; height: 19px; flex-shrink: 0; margin-top: 1px;
  accent-color: var(--green-800); cursor: pointer;
}
.check-inline.consent {
  padding: 13px 15px; border-radius: 12px;
  background: rgba(37, 107, 74, 0.07);
  border: 1px dashed rgba(37, 107, 74, 0.35);
}
.check-inline.invalid { border-color: var(--danger); background: rgba(176, 58, 46, .06); }

/* ── Conditional blocks ────────────────────────────────────────────────── */
.cond-block {
  padding: 18px 16px 6px; margin: 4px 0 18px; border-radius: 14px;
  background: rgba(201, 162, 39, 0.07);
  border: 1px solid rgba(201, 162, 39, 0.3);
  animation: viewIn .4s var(--ease);
}
.cond-title {
  font-size: .7rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold-500); margin-bottom: 14px;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn-primary {
  width: 100%; padding: 16px;
  font-family: var(--font-body); font-size: .86rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold-300); background: var(--green-900);
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-radius: 13px; cursor: pointer;
  box-shadow: 0 10px 26px rgba(13, 43, 30, 0.3);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), opacity .2s;
  position: relative; overflow: hidden;
}
.btn-primary::after {
  content: ""; position: absolute; top: 0; left: -80%; width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(230, 204, 122, 0.25), transparent);
  transform: skewX(-20deg); transition: left .6s var(--ease);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(13, 43, 30, 0.4); }
.btn-primary:hover::after { left: 130%; }

/* Destructive primary. Deliberately reads as a warning rather than as the
   house green — a delete button should not look like the happy path. */
.btn-primary.danger {
  color: #ffe9e5; background: #8c2d22;
  border-color: rgba(255, 233, 229, .35);
  box-shadow: 0 10px 26px rgba(140, 45, 34, .3);
}
.btn-primary.danger:hover { box-shadow: 0 14px 34px rgba(140, 45, 34, .42); }
.btn-primary.danger::after { background: linear-gradient(100deg, transparent, rgba(255, 233, 229, .2), transparent); }
.row-actions .btn-primary, .row-actions .btn-ghost { width: auto; padding: 13px 22px; }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary.working:disabled { cursor: wait; }
.btn-primary.sm { width: auto; padding: 11px 22px; font-size: .74rem; }

.btn-ghost {
  padding: 10px 20px;
  font-family: var(--font-body); font-size: .77rem; font-weight: 600;
  color: var(--green-800); background: transparent;
  border: 1px solid var(--line-solid); border-radius: 999px; cursor: pointer;
  transition: all .25s;
}
.btn-ghost:hover { border-color: var(--gold-500); color: var(--gold-500); }
.btn-ghost:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost.block { display: block; margin: 18px auto 0; }

.btn-outline {
  padding: 11px 20px; font-family: var(--font-body); font-size: .8rem; font-weight: 600;
  color: var(--green-900); background: var(--white);
  border: 1px solid var(--gold-500); border-radius: 11px; cursor: pointer; transition: all .2s;
}
.btn-outline:hover { background: var(--green-900); color: var(--gold-300); }

.mini-btn {
  padding: 6px 11px; font-family: var(--font-body); font-size: .7rem; font-weight: 600;
  border-radius: 8px; border: 1px solid var(--line-solid);
  background: #fff; color: var(--green-800); cursor: pointer; transition: all .15s;
}
.mini-btn:hover { border-color: var(--gold-500); }
.mini-btn.gold { background: var(--gold-grad); border-color: transparent; color: var(--green-950); }
.mini-btn.danger { color: var(--danger); border-color: rgba(176, 58, 46, .4); }
.mini-btn.danger:hover { background: var(--danger); color: #fff; }
.mini-btn:disabled { opacity: .45; cursor: not-allowed; }

.link-btn {
  background: none; border: none; color: var(--muted); font-family: var(--font-body);
  font-size: .78rem; cursor: pointer; text-decoration: underline; padding: 4px;
}
.link-btn:hover { color: var(--green-800); }

.back-btn {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-family: var(--font-body); font-size: .85rem; font-weight: 500;
  padding: 4px 0; margin-bottom: 10px; transition: color .2s;
}
.back-btn:hover { color: var(--green-800); }

/* ── Badges ────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: .66rem; font-weight: 700; letter-spacing: .05em;
  border: 1px solid transparent; white-space: nowrap;
}
.badge.gold     { background: var(--gold-grad); color: var(--green-950); }
.badge.green    { background: rgba(30, 125, 79, .12);  color: var(--ok);     border-color: rgba(30, 125, 79, .3); }
.badge.grey     { background: rgba(95, 111, 102, .12); color: var(--muted);  border-color: rgba(95, 111, 102, .25); }
.badge.red      { background: rgba(176, 58, 46, .1);   color: var(--danger); border-color: rgba(176, 58, 46, .3); }
.badge.amber    { background: rgba(201, 162, 39, .15); color: #8a6d10;       border-color: rgba(201, 162, 39, .4); }
.badge.blue     { background: rgba(47, 111, 143, .12); color: var(--info);   border-color: rgba(47, 111, 143, .3); }
.badge.locked   { background: var(--green-900); color: var(--gold-300); }

/* ── Loader & toast ────────────────────────────────────────────────────── */
.loader-overlay {
  position: fixed; inset: 0; z-index: 400;
  display: grid; place-items: center;
  background: rgba(250, 248, 242, 0.6);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.loader-ring {
  width: 52px; height: 52px; border-radius: 50%;
  border: 3px solid rgba(201, 162, 39, 0.25);
  border-top-color: var(--gold-500);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 500;
  transform: translate(-50%, 20px);
  max-width: min(92vw, 460px);
  padding: 13px 20px; border-radius: 12px;
  font-size: .84rem; font-weight: 500; text-align: center; line-height: 1.5;
  background: var(--green-900); color: var(--white);
  border: 1px solid rgba(201, 162, 39, 0.45);
  box-shadow: var(--shadow-lift);
  opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
#toast.show  { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--danger); border-color: rgba(255, 255, 255, .3); }
#toast.ok    { background: var(--green-700); }

/* ── Notices ───────────────────────────────────────────────────────────── */
.notice {
  text-align: center; font-size: .78rem; line-height: 1.6;
  padding: 10px 16px; background: #fdf6df; color: #7a5d00;
  border-bottom: 1px solid #eadfae;
}
.notice code { background: rgba(0, 0, 0, .06); padding: 1px 5px; border-radius: 4px; font-size: .95em; }
.error-text { color: var(--danger); font-size: .8rem; margin: 2px 0 12px; line-height: 1.5; }
.hint { font-size: .74rem; color: var(--muted); margin: 6px 0 12px; line-height: 1.6; }
.hint code { background: rgba(0, 0, 0, .06); padding: 1px 5px; border-radius: 4px; }

@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ── Accessibility ─────────────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
