:root {
  --bg: #0D0D0B;
  --surface: #161613;
  --surface-2: #1D1D19;
  --line: #34332C;
  --line-strong: #5A574A;
  --ivory: #F5F2EA;
  --muted: #B3AEA1;
  --gold: #D4B574;
  --gold-bright: #E2C98F;
  --success: #8FC79A;
  --error: #EFA08F;
  --serif: "Bodoni Moda", Didot, "Bodoni MT", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 4px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ivory);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font: 500 19px/1.2 var(--serif); letter-spacing: .02em; }
.brand-sub {
  margin-top: 3px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.test-tag {
  flex: none;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
main {
  flex: 1;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(32px, 9vh, 96px) 16px 64px;
}
.panel { width: 100%; max-width: 440px; }
.center { text-align: center; padding-top: 48px; }
h1 {
  margin: 0;
  font: 400 clamp(36px, 8vw, 50px)/1.08 var(--serif);
  letter-spacing: -.01em;
  outline: none;
  text-wrap: balance;
}
h1 em { color: var(--gold); font-style: italic; }
.sub { margin: 14px 0 0; color: var(--muted); font-size: 17px; }
.eyebrow {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.account-line { margin: 18px 0 0; color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }
.account-line strong { color: var(--ivory); font-weight: 500; }
form { margin-top: 32px; }
.field { margin-bottom: 22px; }
label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; }
input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ivory);
  font: 400 16px var(--sans);
  transition: border-color .15s;
}
input:hover { border-color: #77735F; }
input:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
input:-webkit-autofill {
  -webkit-text-fill-color: var(--ivory);
  -webkit-box-shadow: 0 0 0 100px var(--surface) inset;
  caret-color: var(--ivory);
}
input[aria-invalid="true"] { border-color: var(--error); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 72px; }
.pw-toggle {
  position: absolute;
  top: 4px;
  right: 4px;
  bottom: 4px;
  width: 62px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--gold);
  font: 500 14px var(--sans);
  cursor: pointer;
}
.pw-toggle:hover { color: var(--gold-bright); }
.hint { margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.btn {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: 600 16px var(--sans);
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { margin-top: 28px; background: var(--gold); color: #17140C; }
.btn-primary:hover { background: var(--gold-bright); }
.btn-quiet { margin-top: 6px; background: transparent; color: var(--ivory); font-weight: 500; }
.btn-quiet:hover { color: var(--gold-bright); }
.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--ivory); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold-bright); }
.btn:disabled { opacity: .6; cursor: wait; }
button:focus-visible { outline: 2px solid var(--ivory); outline-offset: 2px; }
.msg {
  margin: 24px 0 0;
  padding: 13px 15px;
  border: 1px solid;
  border-radius: var(--radius);
  font-size: 15px;
}
.msg-error { color: var(--error); border-color: #6F4238; background: #211512; }
.msg-success { color: var(--success); border-color: #3F5C45; background: #131C15; }
.msg-info { color: var(--ivory); border-color: var(--line-strong); background: var(--surface); }
.success-mark { margin: 0 0 14px; color: var(--success); font-size: 15px; font-weight: 600; }
.fix-list { margin: 26px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.fix-list li { padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.fix-list strong { color: var(--ivory); font-weight: 500; }
.spinner {
  display: inline-block;
  width: 26px;
  height: 26px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Dashboard */
.dash { width: 100%; max-width: 1040px; }
.dash-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 48px;
  align-items: start;
  padding-bottom: 44px;
  border-bottom: 1px solid var(--line);
}
.dash h1 { font-size: clamp(38px, 6vw, 60px); }
.account-box {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.account-label { color: var(--muted); font-size: 13px; }
.account-email { margin: 3px 0 16px; font-weight: 500; overflow-wrap: anywhere; }
.tools-label { margin: 44px 0 16px; }
.tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tools li {
  min-height: 118px;
  display: flex;
  align-items: flex-end;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font: 400 23px/1.2 var(--serif);
}
.test-note { max-width: 640px; margin: 26px 0 0; color: var(--muted); font-size: 14px; }

@media (max-width: 760px) {
  .brand-bar { padding-top: 16px; padding-bottom: 16px; }
  main { padding-top: 40px; }
  .dash-head { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-bottom: 32px; }
  .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tools li { min-height: 96px; padding: 14px; font-size: 19px; }
  .tools-label { margin-top: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .spinner { animation-duration: 3s; }
}
