:root {
  --auth-ink: #13251f;
  --auth-green: #1e624b;
  --auth-green-deep: #123d31;
  --auth-gold: #c59648;
  --auth-paper: #f7f2e8;
  --auth-line: rgba(31, 70, 57, 0.15);
}

* { box-sizing: border-box; }

.auth-shell {
  min-height: 100vh;
  margin: 0;
  color: var(--auth-ink);
  background:
    radial-gradient(circle at 84% 12%, rgba(197, 150, 72, 0.13), transparent 25rem),
    linear-gradient(135deg, #edf1e8 0%, var(--auth-paper) 48%, #efe7d8 100%);
}

.auth-layout {
  width: min(1180px, calc(100% - 48px));
  min-height: min(760px, calc(100vh - 48px));
  margin: 24px auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.72fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 30px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: 0 28px 80px rgba(35, 47, 39, 0.15), 0 2px 8px rgba(35, 47, 39, 0.05);
}

.auth-story {
  position: relative;
  min-height: 710px;
  padding: clamp(34px, 5vw, 68px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #f9f4e9;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(13, 46, 37, 0.98), rgba(25, 83, 62, 0.94)),
    #153d31;
}

.auth-story::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -20% -30% auto auto;
  width: 33rem;
  aspect-ratio: 1;
  border: 1px solid rgba(239, 214, 168, 0.2);
  border-radius: 50%;
  box-shadow: 0 0 0 65px rgba(255,255,255,.025), 0 0 0 130px rgba(255,255,255,.018);
}

.auth-story::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto 7% 10% auto;
  width: 9rem;
  height: 16rem;
  opacity: .25;
  background: repeating-linear-gradient(90deg, transparent 0 11px, rgba(226,193,132,.45) 12px 13px);
  transform: rotate(34deg);
}

.auth-story__topline,
.auth-story__eyebrow,
.auth-heading__step {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 700 11px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.auth-story__topline { color: rgba(255,255,255,.63); }
.auth-story__topline span { width: 28px; height: 1px; background: var(--auth-gold); }
.auth-story__content { max-width: 620px; margin: auto 0; }

.auth-brand-mark {
  position: relative;
  width: 70px;
  height: 70px;
  margin-bottom: 26px;
  display: grid;
  place-items: center;
}
.auth-brand-mark img { display: block; width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 10px 22px rgba(3,22,16,.22)); }
.auth-story__eyebrow { margin: 0 0 14px; color: #dcb774; }
.auth-story h1 { margin: 0; max-width: 12ch; color: #fffdf7; font: 700 clamp(38px, 5.2vw, 65px)/1.08 Georgia, "Noto Serif SC", serif; letter-spacing: -.055em; }
.auth-story__content > p:last-child { max-width: 45ch; margin: 25px 0 0; color: rgba(255,255,255,.67); font-size: 14px; line-height: 1.9; }

.auth-trust-list { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.auth-trust-list > span { min-width: 0; padding: 15px; border: 1px solid rgba(255,255,255,.12); border-radius: 15px; background: rgba(255,255,255,.055); backdrop-filter: blur(12px); }
.auth-trust-list svg { width: 17px; height: 17px; margin-bottom: 13px; color: #e0bb74; }
.auth-trust-list b, .auth-trust-list small { display: block; }
.auth-trust-list b { font-size: 12px; }
.auth-trust-list small { margin-top: 5px; color: rgba(255,255,255,.52); font-size: 10px; line-height: 1.5; }
.auth-story__motto { position: absolute; right: 28px; bottom: 28px; margin: 0; color: rgba(255,255,255,.25); font: italic 11px Georgia, serif; writing-mode: vertical-rl; }

.auth-panel { min-width: 0; display: grid; place-items: center; padding: clamp(34px, 6vw, 72px); }
.auth-panel__inner { width: min(100%, 400px); }
.auth-heading__step { color: var(--auth-green); }
.auth-heading h2 { margin: 13px 0 10px; color: var(--auth-ink); font: 700 clamp(29px, 3vw, 38px)/1.15 Georgia, "Noto Serif SC", serif; letter-spacing: -.035em; }
.auth-heading p { margin: 0; color: #6f776f; font-size: 13px; line-height: 1.75; }
.auth-form { margin-top: 34px; display: grid; gap: 20px; }
.auth-field { display: grid; gap: 8px; }
.auth-field label { color: #31443c; font-size: 12px; font-weight: 700; }
.auth-field small { color: #8a9089; font-size: 10px; line-height: 1.55; }
.auth-input { min-height: 50px; display: flex; align-items: center; gap: 11px; padding: 0 15px; border: 1px solid var(--auth-line); border-radius: 13px; background: rgba(255,255,255,.72); transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.auth-input:focus-within { border-color: rgba(30,98,75,.62); background: #fff; box-shadow: 0 0 0 4px rgba(30,98,75,.09); }
.auth-input svg { width: 17px; height: 17px; flex: 0 0 auto; color: #718078; }
.auth-input input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; color: var(--auth-ink); background: transparent; font: 500 14px system-ui, sans-serif; }
.auth-input input::placeholder { color: #a8ada8; }

.auth-submit { width: 100%; min-height: 52px; margin-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 18px 0 21px; border: 0; border-radius: 13px; color: #fff; background: linear-gradient(135deg, var(--auth-green), var(--auth-green-deep)); box-shadow: 0 10px 24px rgba(20,72,54,.2); font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(20,72,54,.25); }
.auth-submit:focus-visible { outline: 3px solid rgba(30,98,75,.24); outline-offset: 3px; }
.auth-submit svg { width: 18px; height: 18px; }

.auth-alert { margin-top: 23px; display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; border: 1px solid rgba(172,68,55,.18); border-radius: 12px; color: #943d34; background: rgba(189,72,57,.065); font-size: 12px; line-height: 1.55; }
.auth-alert svg { width: 17px; height: 17px; flex: 0 0 auto; }
.auth-local-note { margin-top: 19px; display: flex; align-items: center; gap: 11px; padding: 13px 14px; border-radius: 12px; background: rgba(30,98,75,.055); }
.auth-local-note > svg { width: 18px; color: var(--auth-green); }
.auth-local-note span, .auth-local-note strong, .auth-local-note small { display: block; }
.auth-local-note strong { color: #425047; font-size: 11px; }
.auth-local-note small { margin-top: 3px; color: #858c85; font-size: 10px; }
.auth-session-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 17px 0 0; color: #8a9089; font-size: 10px; }
.auth-session-note svg { width: 13px; height: 13px; }
.auth-empty { margin-top: 34px; padding: 25px; border: 1px dashed rgba(30,98,75,.25); border-radius: 18px; text-align: center; background: rgba(255,255,255,.45); }
.auth-empty > svg { width: 30px; height: 30px; color: var(--auth-green); }
.auth-empty strong { display: block; margin-top: 12px; font: 700 18px Georgia, serif; }
.auth-empty p { margin: 8px 0 20px; color: #777f78; font-size: 12px; }

.auth-optional { margin-left: 5px; color: #919891; font-size: 9px; font-weight: 500; }
.auth-method-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 25px; padding: 5px; border: 1px solid var(--auth-line); border-radius: 14px; background: rgba(30,98,75,.045); }
.auth-method-tabs button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 10px; border: 0; border-radius: 10px; color: #7a837c; background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; transition: color .18s ease, background .18s ease, box-shadow .18s ease; }
.auth-method-tabs button svg { width: 14px; height: 14px; }
.auth-method-tabs button.is-active { color: var(--auth-green-deep); background: rgba(255,255,255,.9); box-shadow: 0 3px 11px rgba(30,70,55,.09); }
.auth-method-tabs button:focus-visible { outline: 3px solid rgba(30,98,75,.2); outline-offset: 2px; }
.auth-method-panel { margin-top: 21px; }
.auth-method-panel[hidden] { display: none; }
.auth-email-destination { display: flex; align-items: center; gap: 11px; padding: 13px 14px; border: 1px solid rgba(30,98,75,.12); border-radius: 13px; background: rgba(30,98,75,.055); }
.auth-email-destination > svg { width: 17px; height: 17px; color: var(--auth-green); }
.auth-email-destination span, .auth-email-destination small, .auth-email-destination strong { display: block; }
.auth-email-destination small { color: #818981; font-size: 9px; }
.auth-email-destination strong { margin-top: 3px; color: #31483d; font-size: 12px; letter-spacing: .02em; }
.auth-code-row { display: grid; grid-template-columns: minmax(0,1fr) 112px; gap: 8px; }
.auth-code-row .auth-input { min-width: 0; }
.auth-code-row input { letter-spacing: .2em; font: 700 17px ui-monospace, SFMono-Regular, Consolas, monospace; }
.auth-code-send { min-height: 50px; padding: 0 12px; border: 1px solid rgba(30,98,75,.2); border-radius: 13px; color: var(--auth-green-deep); background: rgba(255,255,255,.75); font-size: 10px; font-weight: 700; cursor: pointer; }
.auth-code-send:hover:not(:disabled) { border-color: rgba(30,98,75,.45); background: #fff; }
.auth-code-send:disabled { color: #939a94; cursor: wait; opacity: .78; }
.auth-email-unavailable { padding: 22px; border: 1px dashed rgba(30,98,75,.24); border-radius: 16px; text-align: center; background: rgba(255,255,255,.45); }
.auth-email-unavailable svg { width: 25px; height: 25px; color: var(--auth-green); }
.auth-email-unavailable strong { display: block; margin-top: 10px; color: var(--auth-ink); font: 700 16px Georgia, serif; }
.auth-email-unavailable p { margin: 7px auto 0; max-width: 28ch; color: #777f78; font-size: 11px; line-height: 1.65; }
.auth-submit:disabled, .auth-submit.is-busy { cursor: wait; opacity: .76; transform: none; }

@media (max-width: 850px) {
  .auth-layout { width: min(100% - 24px, 560px); min-height: 0; margin: 12px auto; grid-template-columns: 1fr; border-radius: 24px; }
  .auth-story { min-height: 255px; padding: 28px; }
  .auth-story__content { margin: 30px 0 10px; }
  .auth-brand-mark { width: 45px; height: 45px; margin-bottom: 14px; }
  .auth-brand-mark img { width: 43px; height: 43px; }
  .auth-story h1 { max-width: 14ch; font-size: 34px; }
  .auth-story__content > p:last-child { margin-top: 14px; font-size: 12px; line-height: 1.65; }
  .auth-trust-list, .auth-story__motto { display: none; }
  .auth-panel { padding: 34px 26px 40px; }
}

@media (max-width: 480px) {
  .auth-shell { background: var(--auth-paper); }
  .auth-layout { width: 100%; min-height: 100vh; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  .auth-story { min-height: 218px; border-radius: 0 0 28px 28px; padding: calc(24px + env(safe-area-inset-top)) 22px 24px; }
  .auth-story__topline { font-size: 9px; }
  .auth-story__content { margin: 21px 0 0; }
  .auth-brand-mark { width: 38px; height: 38px; margin-bottom: 10px; }
  .auth-brand-mark img { width: 38px; height: 38px; }
  .auth-story h1 { font-size: 31px; }
  .auth-story__content > p:last-child { max-width: 34ch; }
  .auth-panel { place-items: start center; padding: 29px 21px calc(38px + env(safe-area-inset-bottom)); }
  .auth-heading h2 { font-size: 29px; }
  .auth-form { margin-top: 26px; gap: 17px; }
  .auth-input, .auth-submit { min-height: 51px; }
  .auth-code-row { grid-template-columns: minmax(0,1fr) 105px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-input, .auth-submit, .auth-method-tabs button { transition: none; }
}
