:root {
  color-scheme: dark;
  --bg: #0f0e0c;
  --surface: #1a1917;
  --surface-soft: #211f1b;
  --text: #f4efe5;
  --muted: #aaa294;
  --gold: #c9a96e;
  --gold-light: #e7d2a5;
  --border: #383229;
  --danger: #d98e7f;
  --success: #9cbd93;
  --radius: 18px;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -20%, rgba(201, 169, 110, .1), transparent 42rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  line-height: 1.65;
}

button, input { font: inherit; }
a { color: var(--gold-light); text-underline-offset: 3px; }

.glow { position: fixed; width: 26rem; height: 26rem; border-radius: 50%; filter: blur(110px); opacity: .08; pointer-events: none; }
.glow-one { top: 5rem; left: -15rem; background: var(--gold); }
.glow-two { right: -18rem; bottom: 5rem; background: #8d6e48; }

.shell { position: relative; width: min(100% - 36px, 760px); margin: 0 auto; padding: 34px 0 44px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--gold-light); font-size: .77rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.brand-mark { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--gold); border-radius: 50%; }

.intro { margin: clamp(54px, 9vw, 86px) 0 38px; text-align: center; }
.eyebrow, .step-label { margin: 0 0 9px; color: var(--gold); font-size: .72rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }
h1, h2, h3 { margin: 0; font-family: "Playfair Display", Georgia, serif; font-weight: 500; line-height: 1.14; }
h1 { max-width: 650px; margin-inline: auto; font-size: clamp(2.55rem, 8vw, 4.65rem); letter-spacing: -.04em; }
h2 { font-size: clamp(1.75rem, 5vw, 2.35rem); }
h3 { font-size: 1.45rem; }
.lede { max-width: 585px; margin: 22px auto 0; color: var(--muted); font-size: 1.03rem; }

.panel, .subscription-card, dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(31, 29, 25, .98), rgba(23, 22, 19, .98));
  box-shadow: 0 28px 80px rgba(0, 0, 0, .25);
}
.auth-panel { max-width: 570px; margin: 0 auto; padding: clamp(25px, 6vw, 42px); }
.muted { color: var(--muted); }
.auth-panel .muted { margin: 13px 0 27px; }
form { display: grid; gap: 12px; }
label { color: #ded5c7; font-size: .84rem; font-weight: 600; }
input {
  width: 100%;
  min-height: 55px;
  border: 1px solid #494238;
  border-radius: 10px;
  outline: 0;
  background: #12110f;
  color: var(--text);
  padding: 13px 15px;
  transition: border-color .18s, box-shadow .18s;
}
input::placeholder { color: #6f695f; }
input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 169, 110, .14); }
.code-input { font-size: 1.55rem; font-weight: 600; letter-spacing: .28em; text-align: center; }

.button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  padding: 13px 23px;
  font-weight: 600;
  transition: transform .18s, background .18s, opacity .18s;
}
.button:hover { transform: translateY(-1px); }
.button:focus-visible, .text-button:focus-visible, .dialog-close:focus-visible { outline: 3px solid rgba(201, 169, 110, .35); outline-offset: 3px; }
.button:disabled { cursor: wait; opacity: .58; transform: none; }
.primary { margin-top: 7px; background: var(--gold); color: #18140e; }
.primary:hover { background: var(--gold-light); }
.secondary { border-color: var(--border); background: transparent; color: var(--text); }
.danger { background: #aa5f52; color: white; }
.danger:hover { background: #bd6e60; }
.text-button { border: 0; background: transparent; color: var(--gold-light); cursor: pointer; padding: 12px 0; text-decoration: underline; text-underline-offset: 3px; }

.account-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.subscription-grid { display: grid; gap: 16px; }
.subscription-card { overflow: hidden; padding: clamp(23px, 5vw, 34px); }
.card-top { display: flex; justify-content: space-between; gap: 18px; }
.product-kicker { margin: 0 0 6px; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .13em; }
.badge { align-self: flex-start; border: 1px solid var(--border); border-radius: 999px; padding: 6px 11px; color: var(--gold-light); font-size: .74rem; white-space: nowrap; }
.subscription-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 25px 0; padding: 20px 0; border-block: 1px solid var(--border); }
.meta-label { display: block; color: var(--muted); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.meta-value { display: block; margin-top: 3px; color: #ece4d8; }
.renewal-note { margin: 0 0 20px; color: var(--muted); }
.card-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.card-actions .button { min-height: 46px; }
.empty { padding: 30px; }

.status { min-height: 26px; margin: 20px auto 0; color: var(--success); text-align: center; }
.status.error { color: var(--danger); }
footer { margin-top: 54px; color: var(--muted); text-align: center; font-size: .84rem; }
.fine-print { font-size: .72rem; }

dialog { width: min(calc(100% - 32px), 520px); border-color: var(--border); color: var(--text); padding: 0; }
dialog::backdrop { background: rgba(7, 6, 5, .78); backdrop-filter: blur(5px); }
.dialog-card { position: relative; padding: clamp(25px, 6vw, 38px); }
.dialog-card .muted { margin: 14px 0 26px; }
.dialog-close { position: absolute; top: 12px; right: 15px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.8rem; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

[hidden] { display: none !important; }

@media (max-width: 540px) {
  .shell { width: min(100% - 24px, 760px); padding-top: 22px; }
  .intro { margin-top: 45px; }
  .auth-panel { border-radius: 15px; }
  .account-heading { align-items: center; }
  .card-top { align-items: flex-start; }
  .subscription-meta { grid-template-columns: 1fr; }
  .card-actions, .card-actions .button { width: 100%; }
  .dialog-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
