/* 3C Arena — the sign-in and sign-up pages (Account/Auth spec v1, 03/04 mockups). A centred card on a
   minimal shell: brand, Back to home and the theme control, nothing else to wander off into mid-sign-in.
   Borrows the site's tokens from style.css; kept in its own file so these pages can change without touching
   the stylesheet every other page shares. */

/* The main action is gold in both themes on auth pages (spec §3: "player/auth pages use gold for the main
   CTA"), unlike style.css's --accent, which turns blue in light. Text on gold is always dark navy. */
.auth-page {
  --auth-gold: #F3C34D;
  --auth-gold-hi: #FFD470;
  --auth-on-gold: #182033;
  --auth-field: var(--bg);
}
:root[data-theme="light"] .auth-page { --auth-field: #F5F7FA; }

.auth-head { border-bottom: 1px solid var(--line); }
.auth-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.auth-head .head-actions { display: flex; align-items: center; gap: 12px; }
.auth-back { color: var(--ink-soft); text-decoration: none; font-size: .95rem; display: inline-flex; align-items: center; gap: 6px; }
.auth-back:hover { color: var(--ink); }

main.auth {
  min-height: calc(100vh - 72px - 96px);
  display: grid;
  place-items: start center;
  padding: 48px 16px 56px;
  /* A soft pool of table-light behind the card, so it does not float in an empty field. */
  background: radial-gradient(ellipse 60% 45% at 50% 0%, color-mix(in srgb, #1668dc 14%, transparent), transparent 70%);
}
main.auth > div { width: 100%; max-width: 460px; }
.auth-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.auth-body { padding: 32px; display: grid; gap: 20px; }
.auth-title { display: grid; gap: 6px; text-align: center; }
.auth-card h1 { font: 800 2rem/1.15 var(--display); margin: 0; text-align: center; letter-spacing: -.01em; }
.auth-sub { color: var(--ink-soft); text-align: center; margin: 0; }

/* Decorative, and short: a strip of the table with its three balls, inset in the card as the mockup draws it.
   The spec allows dropping it on a phone or a short window, where the keyboard would otherwise push the form off. */
.auth-banner {
  display: block; width: calc(100% - 20px); margin: 10px 10px 0; height: 150px;
  object-fit: cover; object-position: 80% 68%; border-radius: 10px;
}
/* The 3C Arena logo: over the left of the banner, clear of its balls on the right; where there is no banner
   (sign-up, or a phone or short window on sign-in) above the card's title instead, so every visitor sees it. */
.auth-hero { position: relative; }
.auth-logo--on-art {
  position: absolute; left: 26px; top: 50%; transform: translateY(-50%); height: 96px; width: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .55));
}
.auth-logo--card { display: none; height: 72px; width: auto; margin: 0 auto 4px; }
.auth-logo--always { display: block; }
:root[data-theme="light"] .auth-logo--card { filter: drop-shadow(0 1px 2px rgba(12, 26, 45, .45)); }
@media (max-height: 760px), (max-width: 520px) {
  .auth-hero { display: none; }
  .auth-logo--card { display: block; }
}

#auth-form, #forgot-form { display: grid; gap: 16px; }
.field { display: grid; gap: 8px; }
.field > label { font: 600 .92rem/1.2 var(--display); }
.field input[type="text"], .field input[type="email"], .field input[type="password"] {
  width: 100%;
  min-height: 48px;
  background: var(--auth-field);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font: inherit;
  font-size: 1rem; /* 16px: anything smaller makes iOS Safari zoom on focus */
  padding: 12px 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input::placeholder { color: var(--ink-soft); opacity: .7; }
.field input:hover { border-color: color-mix(in srgb, var(--link) 45%, var(--line)); }
.field input:focus-visible { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 25%, transparent); }
.field .hint { color: var(--ink-soft); font-size: .84rem; margin: 0; }
.field .field-error { color: var(--red); font-size: .84rem; margin: 0; }
/* Empty until something is wrong: it must not hold the fields apart while it has nothing to say. */
.field .field-error:empty { display: none; }
.field.invalid input { border-color: var(--red); }

/* The password box and its show/hide button share one bordered shell, so the button sits inside. */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 50px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; display: grid; place-items: center;
  background: none; border: 0; border-radius: 8px; cursor: pointer; color: var(--ink-soft);
}
.pw-toggle:hover { color: var(--ink); }
.pw-toggle:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; }
.pw-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* "Forgot password?" belongs to the password box above it, not to the gap before the button. */
.auth-row { display: flex; align-items: center; justify-content: flex-end; margin-top: -8px; }
.auth-link { color: var(--link); background: none; border: 0; padding: 0; font: inherit; font-size: .9rem; cursor: pointer; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }

.auth-page .auth-submit {
  width: 100%; min-height: 50px; font-size: 1.02rem; justify-content: center;
  background: var(--auth-gold); border-color: var(--auth-gold); color: var(--auth-on-gold);
}
.auth-page .auth-submit:hover { background: var(--auth-gold-hi); border-color: var(--auth-gold-hi); }
.auth-submit[aria-busy="true"] { opacity: .75; }

.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); font-size: .85rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Google and Apple: quiet, neutral buttons with their marks, so they read as alternatives to the one gold action. */
.auth-providers { display: grid; gap: 10px; }
.auth-provider {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--auth-field);
  color: var(--ink); font: 600 .98rem/1 var(--body); cursor: pointer;
}
.auth-provider:hover { border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); }
.auth-provider:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.auth-provider:disabled { opacity: .6; cursor: default; }
.auth-provider svg { width: 20px; height: 20px; flex: none; }

/* One live region for the whole form: submit outcomes, throttling, network trouble. Silent until it speaks. */
.auth-status { margin: 0; font-size: .9rem; }
.auth-status:empty { display: none; }
.auth-status.error { color: var(--red); }
.auth-status.ok { color: #6fcf97; }

.auth-foot-note { border-top: 1px solid var(--line); padding-top: 18px; text-align: center; color: var(--ink-soft); font-size: .95rem; margin: 0; }
.auth-foot-note a { font-weight: 600; }
.auth-below { text-align: center; margin: 20px 0 0; color: var(--ink-soft); font-size: .92rem; }

.terms { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; }
.terms input[type="checkbox"] { width: 20px; height: 20px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--auth-gold); }
.terms label { line-height: 1.45; }

@media (max-width: 520px) {
  main.auth { padding: 20px 16px 40px; }
  .auth-body { padding: 24px; gap: 18px; }
  .auth-card h1 { font-size: 1.75rem; }
  .auth-head .wrap { min-height: 60px; }
  .auth-back span { display: none; } /* the arrow alone, so the header stays on one line */
}

@media (prefers-reduced-motion: reduce) {
  .auth-submit, .pw-toggle, .field input { transition: none; }
}
