:root {
  color-scheme: dark;
  --bg: #080c18;
  --surface: #101728;
  --surface-raised: #151e32;
  --border: rgba(173, 190, 255, .16);
  --border-strong: rgba(173, 190, 255, .3);
  --text: #f4f6ff;
  --muted: #98a5c0;
  --accent: #8d9cff;
  --accent-strong: #b9c1ff;
  --success: #65d6a5;
  --danger: #ff7189;
  --focus: 0 0 0 3px rgba(141, 156, 255, .24);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 76% 9%, rgba(91, 107, 230, .2), transparent 35rem),
    radial-gradient(circle at 5% 84%, rgba(56, 185, 151, .07), transparent 31rem),
    var(--bg);
}
button, input { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.page-shell { width: min(1180px, calc(100% - 48px)); min-height: 100vh; margin: 0 auto; display: flex; flex-direction: column; }
.site-header { position: relative; z-index: 10; min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-size: 18px; font-weight: 720; letter-spacing: -.025em; }
.brand-mark, .account-avatar { display: grid; place-items: center; flex: 0 0 auto; color: var(--accent-strong); border: 1px solid rgba(178,187,255,.32); background: linear-gradient(145deg, rgba(141,156,255,.2), rgba(141,156,255,.06)); }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; }
.auth-actions, .hero-actions { display: flex; align-items: center; gap: 10px; }
.button { min-height: 42px; padding: 0 17px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; font-weight: 680; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, .account-trigger:focus-visible, .account-menu button:focus-visible, .text-action:focus-visible, .form-switch button:focus-visible, .modal-close:focus-visible { outline: none; box-shadow: var(--focus); }
.button:disabled { cursor: wait; opacity: .58; transform: none; }
.button--primary { color: #0a1020; background: linear-gradient(135deg, #aeb8ff, #7f91ff); box-shadow: 0 12px 32px rgba(86,103,226,.2); }
.button--ghost { border-color: var(--border); background: rgba(15,22,38,.7); }
.button--ghost:hover { border-color: var(--border-strong); background: rgba(24,33,56,.8); }
.button--large { min-height: 50px; padding-inline: 21px; }
.button--wide { width: 100%; }

.account-control { position: relative; }
.account-trigger { min-height: 46px; display: flex; align-items: center; gap: 10px; padding: 5px 11px 5px 6px; border: 1px solid var(--border); border-radius: 14px; background: rgba(15,22,38,.8); cursor: pointer; font-weight: 680; }
.account-trigger svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.account-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.account-avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 13px; font-weight: 800; text-transform: uppercase; }
.account-avatar--large { width: 50px; height: 50px; border-radius: 15px; font-size: 18px; }
.account-menu { position: absolute; top: calc(100% + 10px); right: 0; width: min(280px, calc(100vw - 32px)); padding: 8px; border: 1px solid var(--border); border-radius: 16px; background: rgba(15,22,38,.98); box-shadow: 0 24px 70px rgba(0,0,0,.42); }
.account-menu__identity { padding: 12px 12px 13px; border-bottom: 1px solid var(--border); overflow: hidden; }
.account-menu__identity strong, .account-menu__identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu__identity small { margin-top: 4px; color: var(--muted); }
.account-menu button { width: 100%; min-height: 42px; margin-top: 4px; padding: 0 12px; border: 0; border-radius: 10px; text-align: left; background: transparent; cursor: pointer; }
.account-menu button:hover { background: rgba(141,156,255,.1); }
.account-menu .account-menu__logout { color: #ff98aa; }

main { flex: 1; display: flex; }
.hero { width: 100%; display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(410px, .86fr); gap: clamp(48px, 7vw, 96px); align-items: center; padding: clamp(70px, 9vh, 108px) 0; }
.eyebrow, .card-label, .modal-eyebrow { margin: 0; color: var(--accent-strong); font-size: 12px; font-weight: 780; letter-spacing: .15em; text-transform: uppercase; }
h1 { max-width: 760px; margin: 19px 0 0; font-size: clamp(48px, 5.7vw, 76px); line-height: 1.01; letter-spacing: -.058em; text-wrap: balance; }
h1 span { color: #aeb8ff; }
.lead { max-width: 650px; margin: 27px 0 0; color: var(--muted); font-size: clamp(17px, 1.8vw, 20px); line-height: 1.65; }
.hero-actions { margin-top: 36px; flex-wrap: wrap; }
.welcome-card { max-width: 560px; margin-top: 36px; display: flex; gap: 13px; align-items: center; padding: 16px 18px; border: 1px solid rgba(101,214,165,.2); border-radius: 15px; background: rgba(101,214,165,.07); }
.welcome-card__icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: var(--success); background: rgba(101,214,165,.12); }
.welcome-card p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.account-benefits { max-width: 650px; margin: 42px 0 0; padding: 21px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; border-top: 1px solid var(--border); list-style: none; }
.account-benefits li { display: grid; gap: 7px; color: #cbd2e4; font-size: 13px; line-height: 1.35; }
.account-benefits span { color: #687698; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; letter-spacing: .08em; }

.identity-hub { position: relative; overflow: hidden; border: 1px solid rgba(173,190,255,.23); border-radius: 28px; background: linear-gradient(155deg, rgba(24,33,58,.94), rgba(10,16,29,.94)); box-shadow: 0 36px 100px rgba(0,0,0,.35); isolation: isolate; }
.identity-hub__glow { position: absolute; z-index: -1; top: -140px; right: -100px; width: 310px; height: 310px; border-radius: 50%; background: rgba(125,141,255,.2); filter: blur(64px); }
.identity-hub__header { min-height: 82px; display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 13px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.identity-hub__logo { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(178,187,255,.34); border-radius: 13px; color: var(--accent-strong); background: linear-gradient(145deg, rgba(141,156,255,.22), rgba(141,156,255,.08)); font-weight: 850; }
.identity-hub__header small, .identity-hub__header strong { display: block; }
.identity-hub__header small { margin-bottom: 3px; color: #71809e; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.identity-hub__header strong { font-size: 14px; }
.identity-hub__body { padding: 30px 26px 26px; }
.card-label { margin-bottom: 9px; color: #7785a4; letter-spacing: .11em; }
.identity-hub h2, .modal h2 { margin: 0; font-size: 24px; letter-spacing: -.03em; }
.identity-hub__body > p:not(.card-label) { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.product-card { margin-top: 26px; display: grid; grid-template-columns: 43px minmax(0, 1fr); align-items: center; gap: 13px; padding: 16px; border: 1px solid rgba(173,190,255,.18); border-radius: 16px; background: rgba(8,13,24,.58); }
.product-card__icon { width: 43px; height: 43px; display: grid; place-items: center; border: 1px solid rgba(141,156,255,.38); border-radius: 13px; color: #cad0ff; background: rgba(141,156,255,.13); font-size: 11px; font-weight: 850; }
.product-card strong, .product-card small { display: block; }
.product-card small { margin-top: 4px; color: #7f8ba7; font-size: 11px; }
.identity-hub__details { margin-top: 15px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--border); border-radius: 15px; background: var(--border); }
.identity-hub__details div { min-width: 0; padding: 15px; background: rgba(9,15,27,.85); }
.identity-hub__details small, .identity-hub__details strong { display: block; }
.identity-hub__details small { margin-bottom: 6px; color: #71809e; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.identity-hub__details strong { overflow-wrap: anywhere; font-size: 12px; }
.identity-hub__footer { min-height: 61px; display: flex; align-items: center; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--border); color: #7e8ba8; font-size: 11px; }
.identity-hub__footer svg { width: 19px; flex: 0 0 auto; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.site-footer { min-height: 72px; display: flex; align-items: center; border-top: 1px solid var(--border); color: #66738f; font-size: 12px; }

.modal { width: min(520px, calc(100% - 30px)); max-height: calc(100vh - 30px); padding: 0; overflow: auto; color: var(--text); border: 1px solid var(--border-strong); border-radius: 22px; background: var(--surface); box-shadow: 0 32px 100px rgba(0,0,0,.6); }
.modal::backdrop { background: rgba(3,6,13,.76); backdrop-filter: blur(5px); }
.modal[open] { animation: modal-in .16s ease-out; }
.modal-card { position: relative; padding: 30px; }
.modal-close { position: absolute; top: 17px; right: 17px; width: 36px; height: 36px; border: 0; border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.05); cursor: pointer; font-size: 23px; line-height: 1; }
.modal-eyebrow { margin-bottom: 9px; }
.auth-form > .modal-eyebrow, .account-settings > .modal-eyebrow { padding-right: 48px; }
.modal-description { margin: 10px 42px 24px 0; color: var(--muted); line-height: 1.55; }
.modal--result { width: min(470px, calc(100% - 30px)); }
.result-card { display: grid; justify-items: center; text-align: center; }
.result-card .modal-eyebrow { margin-top: 18px; }
.result-card__icon { width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 18px; font-size: 25px; font-weight: 800; }
.result-card__icon--mail { color: var(--accent-strong); background: rgba(141,156,255,.11); }
.result-card__icon--success { color: var(--success); border-color: rgba(101,214,165,.32); background: rgba(101,214,165,.1); }
.result-card h2 { margin-top: 0; }
.result-card__lead { margin: 15px 0 0; color: #dce2f2; line-height: 1.55; }
.result-card__lead strong { color: var(--text); overflow-wrap: anywhere; }
.result-card__note { margin: 10px 0 24px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.result-card__note strong { color: var(--success); }
.auth-form label, .settings-section label { display: grid; gap: 8px; margin-top: 16px; color: #bec7db; font-size: 13px; }
.auth-form label small, .settings-section label small { color: #71809e; font-size: 12px; line-height: 1.45; }
.auth-form input, .settings-section input { width: 100%; height: 48px; padding: 0 14px; color: var(--text); border: 1px solid var(--border); border-radius: 12px; outline: none; background: #0b1220; }
.auth-form input:focus, .settings-section input:focus { border-color: var(--accent); box-shadow: var(--focus); }
.auth-form input[aria-invalid="true"], .settings-section input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(255,113,137,.14); }
.auth-form input:disabled, .settings-section input:disabled { color: #8792a9; background: rgba(11,18,32,.55); }
.auth-form label .field-error, .settings-section label .field-error { color: var(--danger); font-weight: 600; }
.form-status { min-height: 20px; margin: 14px 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.form-status[data-kind="error"] { color: var(--danger); }
.form-status[data-kind="success"] { color: var(--success); }
.text-action { display: block; margin: 14px auto 0; padding: 4px; color: var(--accent-strong); border: 0; background: transparent; cursor: pointer; }
.form-switch { margin: 21px 0 0; color: var(--muted); text-align: center; font-size: 13px; }
.form-switch button { padding: 0; color: var(--accent-strong); border: 0; background: transparent; cursor: pointer; }
.account-settings { display: grid; gap: 22px; }
.account-summary { display: flex; align-items: center; gap: 13px; padding: 15px; border: 1px solid var(--border); border-radius: 15px; background: rgba(11,18,32,.55); }
.account-summary strong, .account-summary small { display: block; }
.account-summary small { margin-top: 4px; color: var(--muted); }
.settings-section { padding-top: 22px; border-top: 1px solid var(--border); }
.settings-section h3 { margin: 0; font-size: 16px; }
.settings-section > div > p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.settings-section .button { margin-top: 2px; }
.toast-region { position: fixed; z-index: 100; right: 18px; bottom: 18px; width: min(360px, calc(100% - 36px)); display: grid; gap: 9px; }
.toast { padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: 13px; color: var(--text); background: var(--surface-raised); box-shadow: 0 18px 54px rgba(0,0,0,.42); font-size: 13px; line-height: 1.45; animation: toast-in .18s ease-out; }
.toast[data-kind="success"] { border-color: rgba(101,214,165,.35); }
.toast[data-kind="error"] { border-color: rgba(255,113,137,.35); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 860px) {
  .page-shell { width: min(100% - 32px, 700px); }
  .site-header { min-height: 78px; }
  .hero { grid-template-columns: 1fr; gap: 54px; padding: 66px 0; }
  .identity-hub { width: 100%; max-width: 600px; }
}
@media (max-width: 560px) {
  .page-shell { width: min(100% - 24px, 540px); }
  .brand > span:last-child { display: none; }
  .auth-actions { gap: 7px; }
  .auth-actions .button { min-height: 40px; padding-inline: 12px; font-size: 13px; }
  .account-trigger > span:nth-child(2) { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
  h1 { font-size: clamp(40px, 13vw, 56px); }
  .lead { margin-top: 23px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .button { width: 100%; }
  .account-benefits { grid-template-columns: 1fr; gap: 12px; }
  .account-benefits li { grid-template-columns: 30px minmax(0, 1fr); align-items: baseline; gap: 8px; }
  .identity-hub { border-radius: 21px; }
  .identity-hub__header { grid-template-columns: 40px minmax(0, 1fr); padding: 16px; }
  .identity-hub__body { padding: 24px 16px 20px; }
  .product-card { grid-template-columns: 42px minmax(0, 1fr); }
  .identity-hub__details { grid-template-columns: 1fr; }
  .identity-hub__footer { padding-inline: 16px; }
  .modal-card { padding: 25px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
