/* ============================================================================
   Reelty account area — auth, forms, dashboards, CRM, plans, assistant
   ========================================================================== */

.field--area { height: auto; align-items: stretch; padding: 12px 14px; }
.field--area textarea { width: 100%; background: none; border: none; outline: none; color: var(--text); font-family: inherit; font-size: .95rem; resize: vertical; }
.container--narrow { max-width: 760px; }

.alert { padding: 13px 16px; border-radius: 12px; margin-bottom: 18px; font-size: .92rem; font-weight: 500; border: 1px solid transparent; }
.alert--error { background: rgba(255,92,108,.12); border-color: rgba(255,92,108,.35); color: #ff8a98; }
.alert--ok { background: rgba(67,230,160,.12); border-color: rgba(67,230,160,.35); color: #6fe9b6; }
.alert--info { background: rgba(109,94,252,.12); border-color: rgba(109,94,252,.35); color: #b3a8ff; }

.linkbtn { color: var(--muted); font-size: .86rem; text-decoration: underline; }
.linkbtn:hover { color: var(--text); }

/* ── Auth ─────────────────────────────────────────────────────────────────── */
.auth { position: relative; min-height: 86vh; display: grid; place-items: center; padding: 60px 20px; overflow: hidden; }
.auth__glow { position: absolute; width: 600px; height: 600px; border-radius: 50%; background: rgba(109,94,252,.3); filter: blur(120px); top: -160px; }
.auth__card { position: relative; width: 100%; max-width: 420px; padding: 34px; border-radius: var(--radius-lg); background: var(--glass); backdrop-filter: blur(20px); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.auth__brand { margin-bottom: 22px; }
.auth__title { font-size: 1.7rem; font-weight: 800; margin-bottom: 8px; }
.auth__sub { color: var(--muted); font-size: .95rem; margin-bottom: 22px; }
.auth__form { display: grid; gap: 6px; }
.auth__label { font-size: .82rem; font-weight: 600; color: var(--muted); margin-top: 12px; }
.auth__form .field, .bigform .field, .vform .field, .modal .field { height: 50px; }
.auth__form .field input { width: 100%; }
.auth__submit { width: 100%; justify-content: center; margin-top: 20px; height: 50px; }
.auth__hint { color: var(--muted-2); font-size: .82rem; margin-top: 8px; }
.auth__hint strong { color: var(--brand-2); }
.auth__resend { text-align: center; margin-top: 14px; }
.auth__foot { text-align: center; color: var(--muted-2); font-size: .8rem; margin-top: 20px; }
.auth__foot a { color: var(--brand-2); }
.otp-input { letter-spacing: .5em; text-align: center; font-size: 1.3rem !important; font-weight: 700; }

.seg { display: flex; gap: 8px; margin-top: 6px; }
.seg__opt { flex: 1; }
.seg__opt input { position: absolute; opacity: 0; }
.seg__opt span { display: block; text-align: center; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); color: var(--muted); font-weight: 600; cursor: pointer; transition: .2s; }
.seg__opt input:checked + span { background: var(--grad-soft); border-color: var(--brand-2); color: var(--brand-2); }

/* ── Generic form page ────────────────────────────────────────────────────── */
.formpage { padding: 50px 0 80px; }
.formpage__inner { max-width: 560px; }
.formpage__title { font-size: 1.9rem; font-weight: 800; margin-bottom: 24px; }
.bigform { display: grid; gap: 6px; }
.bigform__actions { display: flex; gap: 12px; margin-top: 22px; }

/* ── Dashboard shell ──────────────────────────────────────────────────────── */
.dash { padding: 46px 0 80px; }
.dash__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.dash__title { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; }
.dash__sub { color: var(--muted); margin-top: 6px; max-width: 40em; }
.dash__credits { text-align: right; display: grid; gap: 2px; }
.dash__credits-n { font-family: var(--display); font-size: 1.8rem; font-weight: 800; color: var(--brand-2); }
.dash__credits-l { color: var(--muted-2); font-size: .8rem; }
.dash__credits .btn { margin-top: 6px; }

/* tabs */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 26px; overflow-x: auto; }
.tab { padding: 12px 16px; color: var(--muted); font-weight: 600; font-size: .92rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--brand-2); }
.tabpanel { display: none; }
.tabpanel.is-active { display: block; animation: fadeUp .4s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* statcards */
.statcards { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; margin-bottom: 26px; }
.statcard { padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.statcard__n { display: block; font-family: var(--display); font-size: 1.6rem; font-weight: 800; }
.statcard__l { color: var(--muted-2); font-size: .78rem; }
.statcard--hot { border-color: rgba(255,92,108,.35); }
.statcard--hot .statcard__n { color: #ff7a88; }
.statcard--warm { border-color: rgba(255,176,77,.3); }
.statcard--warm .statcard__n { color: #ffc266; }
.statcard--cold { border-color: rgba(99,179,255,.3); }
.statcard--cold .statcard__n { color: #8cc4ff; }
.statcard--wide { grid-column: span 2; }

/* ── CRM ──────────────────────────────────────────────────────────────────── */
.crm__grid { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; }
.crm__filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.leadlist { display: grid; gap: 8px; }
.leadlist__empty { color: var(--muted); padding: 24px; text-align: center; }
.lead { display: grid; grid-template-columns: 44px 1.6fr 1.2fr auto auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); transition: .2s var(--ease); }
.lead:hover { border-color: var(--brand-2); transform: translateX(3px); }
.lead__avatar { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 700; }
.lead__avatar img { width: 100%; height: 100%; object-fit: cover; }
.lead__id { display: grid; gap: 2px; min-width: 0; }
.lead__id strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead__id small { color: var(--muted-2); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead__prop { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead__chips { display: flex; gap: 6px; }
.lead__score { display: grid; gap: 3px; justify-items: end; }
.lead__scorebar { width: 70px; height: 6px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.lead__scorebar span { display: block; height: 100%; background: var(--grad); }
.lead__score small { color: var(--muted-2); font-size: .72rem; }

.chip--hot { background: rgba(255,92,108,.16); border-color: rgba(255,92,108,.4); color: #ff8a98; }
.chip--warm { background: rgba(255,176,77,.16); border-color: rgba(255,176,77,.4); color: #ffc266; }
.chip--cold { background: rgba(99,179,255,.16); border-color: rgba(99,179,255,.4); color: #8cc4ff; }
.chip--stage { background: var(--surface-2); border-color: var(--line-2); color: var(--muted); }

.crm__side { display: grid; gap: 16px; }
.panel { padding: 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.panel__title { font-size: 1rem; margin-bottom: 16px; }
.panel--link { display: block; color: var(--muted); font-weight: 600; transition: .2s; }
.panel--link:hover { color: var(--text); border-color: var(--brand-2); }
.panel__split { display: flex; gap: 18px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.panel__n { display: block; font-family: var(--display); font-size: 1.2rem; font-weight: 800; }
.panel__l { color: var(--muted-2); font-size: .76rem; }

.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 92px 1fr 30px; gap: 10px; align-items: center; font-size: .82rem; }
.bar__l { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar__track { height: 8px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.bar__track span { display: block; height: 100%; background: var(--grad); border-radius: 5px; transition: width .6s var(--ease); }
.bar__n { text-align: right; color: var(--muted); font-weight: 600; }

.autoform { display: grid; gap: 12px; }
.switch { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--muted); cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--brand); }

/* lead detail */
.leadhead { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center; padding: 22px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 22px; }
.leadhead__avatar { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 800; font-size: 1.2rem; }
.leadhead__avatar img { width: 100%; height: 100%; object-fit: cover; }
.leadhead__id h1 { font-size: 1.5rem; display: flex; align-items: center; gap: 10px; }
.leadhead__id p { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.leadhead__meta { color: var(--muted-2); font-size: .82rem; }
.leadhead__contact { text-align: right; display: grid; gap: 6px; justify-items: end; }
.leadhead__masked { color: var(--muted-2); font-size: .8rem; }
.contactbox { padding: 10px 16px; border-radius: 12px; background: var(--grad-soft); border: 1px solid var(--brand-2); text-align: center; }
.contactbox small { display: block; color: var(--muted); font-size: .72rem; }
.contactbox strong { font-size: 1.05rem; letter-spacing: .02em; }
.leaddetail { display: grid; gap: 16px; }
.stageflow { display: flex; flex-wrap: wrap; gap: 8px; }
.stagepill { padding: 9px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--muted); font-weight: 600; font-size: .85rem; transition: .2s; }
.stagepill:hover { color: var(--text); }
.stagepill.is-active { background: var(--grad); border-color: transparent; color: #fff; }
.formmsg { color: #6fe9b6; font-size: .82rem; margin-left: 10px; }
.statusrow { display: flex; gap: 8px; }
.timeline { display: grid; gap: 4px; }
.tl { display: grid; grid-template-columns: 18px 1fr; gap: 12px; padding: 8px 0; }
.tl__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand-2); margin-top: 5px; box-shadow: 0 0 0 4px rgba(177,92,255,.15); position: relative; }
.tl:not(:last-child) .tl__dot::after { content: ""; position: absolute; left: 50%; top: 14px; width: 2px; height: calc(100% + 8px); background: var(--line); transform: translateX(-50%); }
.tl__body strong { display: block; font-size: .9rem; }
.tl__body small { color: var(--muted-2); font-size: .78rem; }

/* ── Visits ───────────────────────────────────────────────────────────────── */
.vlist { display: grid; gap: 12px; }
.vcard { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.vcard__top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.vcard__mode { color: var(--muted-2); font-size: .8rem; }
.vcard__title { font-family: var(--display); font-weight: 700; font-size: 1.05rem; }
.vcard__title:hover { color: var(--brand-2); }
.vcard__loc { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.vcard__meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted-2); font-size: .8rem; margin-top: 8px; }
.vcard__note { color: var(--muted); font-size: .85rem; margin-top: 8px; font-style: italic; }
.vcard__actions { display: flex; gap: 8px; flex-shrink: 0; }
.vbadge { padding: 5px 12px; border-radius: 999px; font-size: .76rem; font-weight: 700; }
.vbadge--ok { background: rgba(67,230,160,.14); color: #6fe9b6; }
.vbadge--warn { background: rgba(255,176,77,.14); color: #ffc266; }
.vbadge--error { background: rgba(255,92,108,.14); color: #ff8a98; }
.vbadge--muted { background: var(--surface-2); color: var(--muted); }
.vbadge--info { background: rgba(109,94,252,.14); color: #b3a8ff; }

/* ── Profile ──────────────────────────────────────────────────────────────── */
.profile { padding-bottom: 70px; }
.profile__cover { height: 180px; background: linear-gradient(120deg, rgba(109,94,252,.4), rgba(255,92,168,.3)); position: relative; }
.profile__cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 200px at 30% 0%, rgba(255,255,255,.12), transparent); }
.profile__head { display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: end; margin-top: -56px; margin-bottom: 30px; }
.profile__avatar { width: 116px; height: 116px; border-radius: 30px; overflow: hidden; display: grid; place-items: center; background: var(--grad); color: #fff; font-family: var(--display); font-size: 2.6rem; font-weight: 800; border: 4px solid var(--bg); box-shadow: var(--shadow); }
.profile__avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile__name { font-size: 1.7rem; display: flex; align-items: center; gap: 10px; }
.verified { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .75rem; }
.profile__handle { color: var(--muted); margin-top: 4px; }
.profile__handle .dot { margin: 0 4px; }
.profile__bio { color: var(--muted); margin-top: 10px; max-width: 40em; }
.profile__stats { display: flex; gap: 22px; margin-top: 14px; color: var(--muted); font-size: .9rem; }
.profile__stats strong { color: var(--text); }
.profile__actions { display: flex; gap: 10px; }
.vpanel { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.vpanel__status h3 { margin-bottom: 12px; }
.vpanel__note { color: var(--muted); font-size: .85rem; margin-top: 10px; }
.vform { display: grid; gap: 6px; padding: 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.vform__intro { color: var(--muted); font-size: .88rem; margin-bottom: 8px; }
.vform .btn { margin-top: 14px; }

/* ── Plans ────────────────────────────────────────────────────────────────── */
.plansec { margin-bottom: 36px; }
.plansec__head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.plansec__head h2 { font-size: 1.3rem; }
.plansec__units { color: var(--muted); font-size: .85rem; margin-bottom: 16px; display: flex; gap: 16px; }
.plangrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.plan { padding: 24px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); transition: .3s var(--ease); }
.plan:hover { transform: translateY(-5px); border-color: var(--brand-2); box-shadow: var(--shadow); }
.plan__name { font-size: 1.1rem; margin-bottom: 10px; }
.plan__price { font-family: var(--display); font-size: 2rem; font-weight: 800; margin-bottom: 14px; }
.plan__cur { font-size: 1.1rem; color: var(--muted); margin-right: 2px; }
.plan__feats { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.plan__feats li { color: var(--muted); font-size: .88rem; padding-left: 22px; position: relative; }
.plan__feats li::before { content: "\2713"; position: absolute; left: 0; color: var(--brand-2); font-weight: 700; }
.plan__btn { width: 100%; justify-content: center; }
.history { display: grid; gap: 8px; }
.history__row { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.history__row small { display: block; color: var(--muted-2); font-size: .78rem; }
.history__amt { font-family: var(--display); font-weight: 700; }

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alertlist { display: grid; gap: 10px; }
.alertcard { display: grid; grid-template-columns: 12px 1fr auto; gap: 14px; align-items: start; padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.alertcard__dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; }
.alertcard--error .alertcard__dot { background: #ff7a88; box-shadow: 0 0 0 4px rgba(255,92,108,.16); }
.alertcard--warn .alertcard__dot { background: #ffc266; box-shadow: 0 0 0 4px rgba(255,176,77,.16); }
.alertcard--info .alertcard__dot { background: var(--brand-2); box-shadow: 0 0 0 4px rgba(177,92,255,.16); }
.alertcard__body strong { display: block; }
.alertcard__body p { color: var(--muted); font-size: .9rem; margin: 4px 0; }
.alertcard__body small { color: var(--muted-2); font-size: .78rem; }
.alertcard__x { font-size: 1.4rem; color: var(--muted-2); line-height: 1; }
.alertcard__x:hover { color: var(--text); }

/* ── Assistant ────────────────────────────────────────────────────────────── */
.assistant { position: relative; padding: 60px 0 90px; overflow: hidden; }
.assistant__glow { position: absolute; top: -120px; left: 50%; transform: translateX(-50%); width: 700px; height: 500px; border-radius: 50%; background: rgba(109,94,252,.28); filter: blur(120px); }
.assistant__inner { position: relative; }
.assistant__head { text-align: center; max-width: 700px; margin: 0 auto 30px; }
.assistant__title { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 800; margin: 16px 0; }
.assistant__sub { color: var(--muted); font-size: 1.05rem; }
.assistant__bar { display: flex; gap: 10px; max-width: 680px; margin: 0 auto 16px; }
.assistant__field { flex: 1; display: flex; align-items: center; gap: 10px; padding: 0 18px; height: 56px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); color: var(--muted); transition: .2s; }
.assistant__field:focus-within { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(177,92,255,.16); }
.assistant__field input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 1rem; }
.assistant__bar .btn { height: 56px; }
.assistant__suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 680px; margin: 0 auto 30px; }
.assistant__reply { max-width: 760px; margin: 0 auto 26px; padding: 20px 24px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line-2); }
.assistant__reply p { font-size: 1.02rem; }
.assistant__reply small { display: block; color: var(--muted); margin-top: 8px; font-size: .85rem; }
.assistant__reply--error { border-color: rgba(255,92,108,.4); color: #ff8a98; }
.assistant__loading { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); padding: 30px; }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(18,18,40,.42); backdrop-filter: blur(6px); }
.modal__card { position: relative; width: 100%; max-width: 440px; padding: 30px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); max-height: 90vh; overflow-y: auto; }
.modal__x { position: absolute; top: 16px; right: 18px; font-size: 1.6rem; color: var(--muted); line-height: 1; }
.modal__x:hover { color: var(--text); }
.modal__title { font-size: 1.4rem; font-weight: 800; }
.modal__sub { color: var(--muted); font-size: .9rem; margin: 6px 0 18px; }
.modal__card .field { margin-bottom: 4px; }
.modal__submit { width: 100%; justify-content: center; margin-top: 18px; }
.modal__msg { padding: 10px 14px; border-radius: 10px; font-size: .88rem; margin-top: 14px; }
.modal__msg--ok { background: rgba(67,230,160,.14); color: #6fe9b6; }
.modal__msg--error { background: rgba(255,92,108,.14); color: #ff8a98; }

/* ── User menu ────────────────────────────────────────────────────────────── */
.nav__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--muted); transition: .2s; }
.nav__icon:hover { color: var(--text); background: var(--soft); }
.usermenu { position: relative; }
.usermenu__btn { display: flex; align-items: center; gap: 9px; padding: 5px 12px 5px 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text); font-weight: 600; transition: .2s; box-shadow: 0 2px 10px -6px rgba(40,28,90,.3); }
.usermenu__btn:hover { background: var(--soft); }
.usermenu__avatar { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--grad); font-size: .78rem; font-weight: 700; }
.usermenu__avatar img { width: 100%; height: 100%; object-fit: cover; }
.usermenu__name { font-size: .9rem; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu__drop { position: absolute; right: 0; top: calc(100% + 10px); width: 200px; padding: 8px; border-radius: 14px; background: var(--surface); backdrop-filter: blur(16px); border: 1px solid var(--line-2); box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(-8px); transition: .2s var(--ease); }
.usermenu.is-open .usermenu__drop { opacity: 1; visibility: visible; transform: none; }
.usermenu__drop a { display: block; padding: 10px 12px; border-radius: 9px; color: var(--muted); font-size: .9rem; font-weight: 600; }
.usermenu__drop a:hover { background: var(--soft); color: var(--text); }
.usermenu__sep { height: 1px; background: var(--line); margin: 6px 4px; }
.nav__mobile-sep { height: 1px; background: var(--line); margin: 8px 0; }

@media (max-width: 980px) {
    .statcards { grid-template-columns: repeat(3, 1fr); }
    .statcard--wide { grid-column: span 3; }
    .crm__grid { grid-template-columns: 1fr; }
    .vpanel { grid-template-columns: 1fr; }
    .profile__head { grid-template-columns: 1fr; }
    .profile__actions { justify-content: flex-start; }
    .lead { grid-template-columns: 40px 1fr auto; }
    .lead__prop { display: none; }
}
@media (max-width: 560px) {
    .statcards { grid-template-columns: 1fr 1fr; }
    .statcard--wide { grid-column: span 2; }
    .leadhead { grid-template-columns: 1fr; text-align: center; justify-items: center; }
    .leadhead__contact { text-align: center; justify-items: center; }
    .vcard { grid-template-columns: 1fr; }
    .auth__card { padding: 26px 20px; }
}
