:root {
  color-scheme: dark;
  --bg: #090a0b;
  --surface: #111315;
  --surface-raised: #171a1d;
  --surface-soft: #1d2125;
  --border: rgba(232, 228, 223, 0.12);
  --border-strong: rgba(232, 228, 223, 0.24);
  --accent: #e6a47a;
  --accent-strong: #f2ba92;
  --text: #f1eee9;
  --muted: #b9b4ad;
  --dim: #85817b;
  --success: #6bd5a1;
  --error: #f28a83;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(circle at 50% -20%, rgba(230, 164, 122, 0.12), transparent 43%), var(--bg);
}

button, a { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.account-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 24px 36px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 54px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-decoration: none;
}

.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }

.language-toggle {
  min-width: 48px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.language-toggle:hover, .language-toggle:focus-visible { border-color: var(--accent); color: var(--text); background: rgba(230, 164, 122, 0.1); }

.account-card {
  padding: 42px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(17, 19, 21, 0.94);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.34);
}

.page-heading { max-width: 560px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(30px, 6vw, 48px); font-weight: 650; letter-spacing: -0.045em; line-height: 1.08; }
.intro { max-width: 500px; margin: 16px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; }

.notice { margin: 26px 0 0; padding: 13px 15px; border: 1px solid var(--border); border-radius: 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.notice-error { border-color: rgba(242, 138, 131, 0.35); color: var(--error); background: rgba(242, 138, 131, 0.07); }
.notice-success { border-color: rgba(107, 213, 161, 0.28); color: var(--success); background: rgba(107, 213, 161, 0.06); }

.auth-panel, .account-panel { margin-top: 30px; padding: 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-raised); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
h2 { margin: 0; color: var(--text); font-size: 20px; font-weight: 600; letter-spacing: -0.025em; }
.auth-badge { padding: 6px 9px; border-radius: 999px; background: rgba(230, 164, 122, 0.1); color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.panel-icon { color: var(--accent); font-size: 20px; line-height: 1; }

.turnstile-container { min-height: 66px; margin: 24px 0 14px; }
.google-button, .secondary-button { display: flex; width: 100%; min-height: 50px; align-items: center; justify-content: center; gap: 11px; border: 0; border-radius: 11px; background: var(--accent); color: #1b1511; cursor: pointer; font-size: 13px; font-weight: 750; transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease, opacity 140ms ease; }
.google-button:hover:not(:disabled), .secondary-button:hover:not(:disabled) { transform: translateY(-1px); background: var(--accent-strong); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.22); }
.google-button:disabled { cursor: not-allowed; opacity: 0.48; }
.google-mark { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 6px; background: #fff; color: #1a5fd0; font-size: 15px; font-weight: 800; }

.fine-print, .site-note { color: var(--dim); font-size: 12px; line-height: 1.55; }
.fine-print { margin: 15px 0 0; }
.site-note { margin: 17px 0 0; text-align: center; }

.account-identity { display: flex; align-items: center; gap: 13px; margin: 30px 0 2px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.identity-avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: rgba(230, 164, 122, 0.15); color: var(--accent); font-weight: 700; }
.signed-in-label { margin: 0 0 3px; color: var(--dim); font-size: 11px; }
.account-email { margin: 0; overflow-wrap: anywhere; color: var(--text); font-size: 14px; }
.account-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; }
.account-panel { margin-top: 16px; padding: 20px; }
.subscription-status, .subscription-details, .subscription-note, .devices-limit, .devices-note, .devices-status { color: var(--muted); font-size: 13px; line-height: 1.55; }
.subscription-status { margin: 20px 0 0; }
.subscription-status[data-state="active"] { color: var(--success); }
.subscription-status[data-state="error"], .devices-status[data-state="error"] { color: var(--error); }
.subscription-details { margin: 7px 0 0; color: var(--text); }
.subscription-note { margin: 20px 0 13px; }
.demo-plan-options { display: grid; gap: 9px; }
.demo-plan-button { display: grid; gap: 4px; min-height: 82px; padding: 13px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-soft); color: var(--text); cursor: pointer; text-align: left; transition: border-color 140ms ease, background 140ms ease; }
.demo-plan-button:hover:not(:disabled) { border-color: var(--accent); background: rgba(230, 164, 122, 0.08); }
.demo-plan-button:disabled { cursor: wait; opacity: 0.58; }
.demo-plan-button strong { font-size: 13px; font-weight: 700; }
.demo-plan-button span, .demo-plan-button small { color: var(--muted); font-size: 11px; }
.demo-plan-button small { color: var(--success); font-weight: 700; }
.subscription-disclaimer { margin: 13px 0 0; }
.devices-limit, .devices-note, .devices-status { margin: 12px 0 0; }
.devices-note { color: var(--dim); font-size: 12px; }
.devices-list { display: grid; gap: 9px; margin: 15px 0 0; padding: 0; list-style: none; }
.device-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.device-details { min-width: 0; }
.device-name { margin: 0; overflow-wrap: anywhere; color: var(--text); font-size: 12px; font-weight: 650; }
.device-last-seen { margin: 4px 0 0; color: var(--dim); font-size: 11px; }
.device-revoke { flex: 0 0 auto; padding: 7px 9px; border: 1px solid rgba(242, 138, 131, 0.35); border-radius: 8px; background: transparent; color: var(--error); cursor: pointer; font-size: 11px; }
.device-revoke:disabled { cursor: wait; opacity: 0.55; }

.account-actions { display: flex; align-items: center; gap: 18px; margin-top: 25px; }
.secondary-button { flex: 1; }
.text-button, .back-link { width: fit-content; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.back-link { display: block; margin: 28px auto 0; color: var(--accent); text-decoration: none; }

[hidden] { display: none !important; }

@media (max-width: 650px) {
  .account-shell { padding: 22px 16px 28px; }
  .site-header { margin-bottom: 35px; }
  .account-card { padding: 28px 20px; border-radius: 18px; }
  .account-sections { grid-template-columns: 1fr; gap: 0; }
  .account-panel { padding: 19px; }
}

@media (max-width: 420px) {
  .account-actions { align-items: stretch; flex-direction: column; gap: 14px; }
  .text-button { align-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
