/* ==========================================================================
   Auth pages: login, verify email, registration
   ========================================================================== */
.auth-page { background: #111111; }
.auth-page--register { background: #080808; }

.auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 40px 20px;
}
.auth--register { align-items: flex-start; padding: 60px 20px; }

.auth-panel {
  position: relative;
  width: 100%;
  border-radius: 3px;
  background: var(--c-paper);
  color: var(--c-ink);
  animation: rise-in .5s var(--ease) both;
}

.auth-rule { height: 1px; margin: 0 0 -1px; border: 0; background: rgba(26, 26, 26, .12); }

/* ---------- Shared pieces ---------- */
.auth-head { display: flex; align-items: center; justify-content: space-between; }
.auth-head__logo { font: 800 18px/23px var(--f-sans); }
.auth-head__meta { color: #888E94; font: 600 11px/14px var(--f-sans); }
.auth-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #888E94;
  transition: color .2s var(--ease), transform .3s var(--ease);
}
.auth-close:hover { color: var(--c-ink); transform: rotate(90deg); }

.auth-eyebrow { color: var(--c-accent); font: 700 11px/14px var(--f-sans); }
.auth-kicker { font: 700 13px/17px var(--f-sans); }
.auth-title__heading { display: flex; flex-direction: column; font: 800 40px/44px var(--f-sans); }
.auth-title__sub { color: #4E5459; font: 400 14px/18px var(--f-sans); }

.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field__label { display: flex; gap: 4px; padding: 0; font: 700 11px/14px var(--f-sans); }
.field__num { color: var(--c-accent); }
.field__control {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 14.5px;
  border: 1.5px solid #D4D0CB;
  border-radius: 2px;
  background: #fff;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field__control:focus-within { border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(232, 113, 42, .12); }
.field__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--c-ink);
  font: 400 14px/18px var(--f-sans);
}
.field__input::placeholder { color: #6E6D6A; opacity: 1; }
.field__prefix { flex: none; font: 700 14px/18px var(--f-sans); }
.field__toggle { flex: none; color: var(--c-accent); font: 700 11px/14px var(--f-sans); }
.field__toggle:hover { text-decoration: underline; text-underline-offset: 2px; }
.field__select { appearance: none; -webkit-appearance: none; padding-right: 24px; cursor: pointer; }
.field__select:invalid { color: #6E6D6A; }
.field__chevron { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--c-ink); pointer-events: none; }
.field__error { color: #C2410C; font: 600 11px/14px var(--f-sans); }
.field__error:empty { display: none; }
.field.has-error .field__control,
.field.has-error .reg-dob__part { border-color: #C2410C; }

.auth-alert {
  padding: 10px 12px;
  border: 1px solid rgba(194, 65, 12, .35);
  border-radius: 2px;
  background: rgba(194, 65, 12, .06);
  color: #9A3412;
  font: 500 13px/18px var(--f-sans);
}
.auth-alert.is-success { border-color: rgba(16, 185, 129, .4); background: rgba(16, 185, 129, .08); color: #047857; }

.auth-submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  border-radius: 2px;
  background: var(--c-accent);
  color: #fff;
  font: 700 13px/17px var(--f-sans);
  transition: background-color .2s var(--ease), transform .15s var(--ease);
}
.auth-submit:hover { background: var(--c-accent-hover); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit.is-loading { pointer-events: none; }
.auth-submit.is-loading [data-label] { opacity: 0; }
.auth-submit.is-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin .7s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Login
   ========================================================================== */
.auth-panel--login { max-width: 540px; padding: 40px 48px; box-shadow: 0 12px 32px rgba(0, 0, 0, .2); }
.auth-panel--login .auth-close { position: absolute; top: 24px; right: 24px; }
.auth-panel--login .auth-head { padding-bottom: 20px; box-shadow: 0 1px 0 rgba(26, 26, 26, .15); }
.auth-panel--login .auth-title { display: flex; flex-direction: column; gap: 12px; padding: 28px 0; }
.auth-panel--login .auth-title__heading { gap: 4px; }
.auth-fields { display: flex; flex-direction: column; gap: 20px; padding-bottom: 16px; }
.auth-panel--login .field__control { height: 50px; }
.auth-panel--login .field__input::placeholder { color: #888E94; }
.auth-forgot { align-self: flex-end; padding-top: 4px; color: var(--c-accent); font: 700 11px/14px var(--f-sans); }
.auth-forgot:hover,
.auth-alt__link:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-cta {
  padding-top: 28px;
  background: linear-gradient(rgba(26, 26, 26, .15), rgba(26, 26, 26, .15)) 0 8px / 100% 1px no-repeat;
}
.auth-foot { text-align: center; }
.auth-alt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 48px;
  background: linear-gradient(rgba(26, 26, 26, .15), rgba(26, 26, 26, .15)) 0 24px / 100% 1px no-repeat;
}
.auth-alt__label,
.auth-secure { color: #888E94; font: 700 11px/14px var(--f-sans); }
.auth-alt__link { color: var(--c-accent); font: 700 14px/18px var(--f-sans); }
.auth-secure {
  padding-top: 48px;
  font-weight: 600;
  background: linear-gradient(rgba(26, 26, 26, .15), rgba(26, 26, 26, .15)) 0 32px / 100% 1px no-repeat;
}

/* ==========================================================================
   Verify email
   ========================================================================== */
.auth-panel--verify {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 580px;
  padding: 40px 48px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .2);
}
.auth-panel--verify .auth-head { height: 32px; }
.auth-panel--verify .auth-close { color: #4E5459; }
.auth-panel--verify .auth-title { display: flex; flex-direction: column; gap: 12px; }
.verify-destination { display: flex; flex-direction: column; gap: 10px; }
.verify-label { color: #4E5459; font: 700 11px/14px var(--f-sans); }
.verify-email {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 14.5px;
  overflow: hidden;
  border: 1.5px solid #DCD9D3;
  border-radius: 2px;
  background: #fff;
  font: 700 16px/21px var(--f-sans);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.verify-copy { color: #4E5459; font: 400 14px/21px var(--f-sans); }
.verify-form { display: contents; }
.otp { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.otp legend { margin-bottom: 8px; }
.otp__row { display: flex; gap: 16px; }
.otp__input {
  flex: 1 1 0;
  min-width: 0;
  height: 56px;
  padding: 0;
  border: 1.5px solid #DCD9D3;
  border-radius: 2px;
  outline: 0;
  background: #fff;
  color: var(--c-ink);
  font: 700 20px/26px var(--f-sans);
  letter-spacing: .3em;
  text-align: center;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.otp__input::placeholder { color: #888E94; letter-spacing: 0; opacity: 1; }
.otp__input:focus { border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(232, 113, 42, .12); }
.otp.has-error .otp__input { border-color: #C2410C; animation: otp-shake .4s var(--ease); }
@keyframes otp-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.verify-actions { display: flex; flex-direction: column; gap: 28px; }
.verify-resend { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.verify-resend__label { color: #888E94; font: 700 11px/14px var(--f-sans); }
.verify-resend__btn { color: var(--c-accent); font: 700 13px/17px var(--f-sans); }
.verify-resend__btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.verify-resend__btn:disabled { color: #888E94; cursor: default; text-decoration: none; }
.verify-resend__status { color: #4E5459; font: 400 12px/16px var(--f-sans); }
.verify-resend__status:empty { display: none; }
.verify-foot { display: flex; flex-direction: column; gap: 6px; }
.verify-foot__label { color: #888E94; font: 700 11px/14px var(--f-sans); }
.verify-foot__text { color: #4E5459; font: 400 13px/18px var(--f-sans); }

/* ==========================================================================
   Registration
   ========================================================================== */
.auth-panel--register {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 720px;
  padding: 44px 48px 40px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .4);
}
.auth-panel--register .auth-head { height: 32px; }
.auth-panel--register .auth-close { color: #6E6D6A; }
.reg-masthead { display: flex; flex-direction: column; gap: 12px; }
.reg-masthead .auth-kicker { font: 800 11px/14px var(--f-sans); }
.reg-masthead .auth-title__heading { font-size: 38px; line-height: 42px; }
.reg-masthead__desc { display: flex; flex-direction: column; gap: 4px; color: #6E6D6A; font: 400 14px/20px var(--f-sans); }

.reg-progress { display: flex; gap: 16px; padding: 8px 0; overflow-x: auto; scrollbar-width: none; }
.reg-progress::-webkit-scrollbar { display: none; }
.reg-progress li { display: flex; flex: none; }
.reg-progress__step { color: #888E94; font: 600 10px/13px var(--f-sans); white-space: nowrap; transition: color .25s var(--ease); }
.reg-progress__step:hover { color: var(--c-ink); }
.reg-progress__step.is-active { color: var(--c-accent); font-weight: 700; }
.reg-progress__step.is-done { color: var(--c-ink); }

.reg-form { display: contents; }
.reg-section { display: flex; flex-direction: column; gap: 20px; min-width: 0; margin: 0; padding: 0; border: 0; }
.reg-section__head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding: 0; font: 800 13px/17px var(--f-sans); }
.reg-section__num { color: var(--c-accent); font: 800 24px/31px var(--f-sans); }
.reg-row { display: flex; gap: 16px; }
.reg-row > .field { flex: 1 1 0; }
.reg-row > .field--title { flex: 0 0 200px; }
.reg-row > .field--state,
.reg-row > .field--postcode { flex: 0 0 150px; }
.reg-dob { display: flex; gap: 12px; }
.reg-dob__part {
  flex: none;
  width: 100px;
  height: 48px;
  padding: 0 14.5px;
  border: 1.5px solid #D4D0CB;
  border-radius: 2px;
  background: #fff;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.reg-dob__part--yyyy { width: 140px; }
.reg-dob__part:focus { border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(232, 113, 42, .12); }
.field--dob legend { margin-bottom: 8px; }

.reg-limit {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 16px 16px 13px;
  border-left: 3px solid var(--c-accent);
  border-radius: 2px;
  background: #ECE8E0;
}
.reg-limit__head { display: flex; gap: 8px; color: #6E6D6A; font: 700 11px/14px var(--f-sans); }
.reg-limit__head label { color: var(--c-accent); }
.reg-limit__text { color: #6E6D6A; font: 400 13px/18px var(--f-sans); }
.reg-limit__control .field__input::placeholder { color: #888E94; }
.reg-limit__note { color: #6E6D6A; font: 400 11px/14px var(--f-sans); }

.reg-checks { display: flex; flex-direction: column; gap: 16px; }
.check { position: relative; display: flex; gap: 12px; cursor: pointer; }
.check__input { position: absolute; width: 18px; height: 18px; margin: 0; opacity: 0; cursor: pointer; }
.check__box {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--c-ink);
  border-radius: 2px;
  background: #EFECE6;
  transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.check__box::after {
  content: '';
  position: absolute;
  left: 4.5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform .2s var(--ease);
}
.check__input:checked + .check__box { border-color: var(--c-accent); background: var(--c-accent); }
.check__input:checked + .check__box::after { transform: rotate(45deg) scale(1); }
.check__input:focus-visible + .check__box { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.check__text { font: 400 14px/20px var(--f-sans); }
.check__text a { color: var(--c-accent); text-decoration: underline; text-underline-offset: 2px; }
.reg-checks .field__error { margin-top: -8px; padding-left: 30px; }

.reg-submit { height: 54px; font-size: 14px; line-height: 18px; }
.reg-login { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 12px; }
.reg-login__label { color: #6E6D6A; font: 700 11px/14px var(--f-sans); }
.reg-login__link { color: var(--c-accent); font: 700 13px/17px var(--f-sans); }
.reg-login__link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ==========================================================================
   Mobile
   ========================================================================== */
@media (max-width: 767.98px) {
  /* Login */
  .auth:has(.auth-panel--login) { align-items: stretch; padding: 32px 16px 20px; }
  .auth-panel--login {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: calc(100dvh - 52px);
    padding: 28px 24px 24px;
    box-shadow: none;
  }
  .auth-panel--login .auth-close { position: static; width: 24px; height: 24px; }
  .auth-panel--login .auth-head { height: 40px; padding-bottom: 16px; }
  .auth-panel--login .auth-head__meta { display: none; }
  .auth-panel--login .auth-title { gap: 10px; padding: 0; }
  .auth-panel--login .auth-title__heading { display: block; font-size: 30px; line-height: 34px; }
  .auth-panel--login .auth-title__sub { font-size: 13px; line-height: 17px; }
  .auth-panel--login .auth-form { display: contents; }
  .auth-fields {
    gap: 16px;
    padding: 16px 0 0;
    background: linear-gradient(rgba(26, 26, 26, .15), rgba(26, 26, 26, .15)) top / 100% 1px no-repeat;
  }
  .auth-panel--login .field { gap: 6px; }
  .auth-panel--login .field__control { height: 52px; }
  .auth-panel--login .field__input { font-size: 13px; line-height: 17px; }
  .auth-forgot { margin-top: 10px; padding-top: 2px; }
  .auth-cta { padding-top: 16px; background-position: 0 0; }
  .auth-panel--login .auth-submit { height: 56px; }
  .auth-foot {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 16px;
    background: linear-gradient(rgba(26, 26, 26, .15), rgba(26, 26, 26, .15)) top / 100% 1px no-repeat;
  }
  .auth-alt { gap: 4px; padding-top: 0; background: none; }
  .auth-secure { padding-top: 8px; background: none; font-size: 10px; line-height: 13px; }

  /* Verify */
  .auth-panel--verify { gap: 20px; padding: 24px 28px; box-shadow: 0 12px 32px rgba(0, 0, 0, .25); }
  .auth-panel--verify .auth-head__logo { font-size: 16px; line-height: 21px; }
  .auth-panel--verify .auth-title { gap: 8px; }
  .auth-panel--verify .auth-eyebrow { font-size: 10px; line-height: 13px; }
  .auth-panel--verify .auth-kicker { font-size: 12px; line-height: 16px; }
  .auth-panel--verify .auth-title__heading { font-size: 30px; line-height: 34px; }
  .verify-destination { gap: 8px; }
  .verify-email { padding: 0 12.5px; font-size: 15px; line-height: 20px; }
  .verify-copy { font-size: 13px; line-height: 19px; }
  .otp__row { gap: 12px; }
  .otp__input { height: 52px; font-size: 18px; line-height: 23px; }
  .verify-actions { gap: 16px; }
  .verify-actions .auth-submit { height: 56px; }
  .verify-resend { gap: 4px; }
  .verify-resend__btn { font-size: 12px; line-height: 16px; }
  .verify-foot { gap: 4px; }
  .verify-foot__label { font-size: 10px; line-height: 13px; }
  .verify-foot__text { font-size: 12px; line-height: 17px; }

  /* Registration */
  .auth--register { align-items: center; padding: 59px 16px; }
  .auth-panel--register { gap: 22px; padding: 36px 24px 32px; border-radius: 0; box-shadow: none; }
  .auth-panel--register .auth-rule { background: var(--c-ink); }
  .auth-panel--register .auth-head { height: 36px; }
  .auth-panel--register .auth-close { width: 36px; height: 36px; color: var(--c-ink); }
  .reg-masthead { gap: 10px; }
  .reg-masthead .auth-title__heading { font-size: 34px; line-height: 44px; }
  .reg-progress { gap: 14px; padding: 6px 0; margin-right: -24px; }
  .reg-section { gap: 18px; }
  .reg-section__head { gap: 10px; margin-bottom: 18px; }
  .auth-panel--register .field { gap: 7px; }
  .field--dob legend { margin-bottom: 7px; }
  .reg-row { flex-direction: column; gap: 18px; }
  .reg-row > .field,
  .reg-row > .field--title,
  .reg-row > .field--state,
  .reg-row > .field--postcode { flex: none; }
  .field__chevron { right: 14px; color: #6E6D6A; }
  .reg-dob { gap: 8px; }
  .reg-dob__part,
  .reg-dob__part--yyyy { width: 90px; padding: 0 12.5px; text-align: center; }
  .reg-limit { gap: 10px; padding: 14px; }
  .reg-limit__control .field__input::placeholder { color: #6E6D6A; }
  .reg-limit__note { line-height: 16px; }
  .reg-checks { gap: 14px; }
  .check { gap: 10px; }
  .check__text { font-size: 13px; line-height: 19px; }
  .reg-checks .field__error { padding-left: 28px; }
  .reg-login { gap: 6px; padding-top: 4px; }
}
