/* ==========================================================================
   Forgot password · Reset password · Verify email
   Load after style.css:  <link rel="stylesheet" href="<?= $this->asset('css/auth.css') ?>">
   ========================================================================== */

html body.page-auth .auth-page-main {
  position: relative; isolation: isolate;
  display: grid; place-items: center; flex: 1;
  padding: clamp(56px, 8vw, 112px) var(--gutter) clamp(72px, 10vw, 136px);
}
html body.page-auth .auth-page-main::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(to right, rgba(14, 26, 46, .05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(14, 26, 46, .05) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(60% 70% at 50% 35%, #000, transparent 75%);
          mask-image: radial-gradient(60% 70% at 50% 35%, #000, transparent 75%);
}

html body.page-auth .auth-card {
  width: 100%; max-width: 460px;
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid #d5e1f0; border-top: 1px solid #d5e1f0;
  border-radius: 28px; background: #fff; text-align: center;
  box-shadow: 0 40px 90px -40px rgba(16, 42, 86, .45);
}

/* Icon badge */
.page-auth .auth-icon {
  display: grid; place-items: center;
  width: 64px; height: 64px; margin: 0 auto 22px;
  border-radius: 20px;
  background: linear-gradient(160deg, #fff, #e8f1ff);
  box-shadow: 0 0 0 1px rgba(31, 111, 235, .18), 0 0 0 7px rgba(31, 111, 235, .06), 0 16px 28px -14px rgba(31, 111, 235, .5);
  color: var(--site-accent);
}
.page-auth .auth-icon svg { width: 28px; height: 28px; }
.page-auth .auth-icon.is-success { color: #1f9d55; background: linear-gradient(160deg, #fff, #e6f8ef); box-shadow: 0 0 0 1px rgba(31,157,85,.22), 0 0 0 7px rgba(31,157,85,.07), 0 16px 28px -14px rgba(31,157,85,.5); }
.page-auth .auth-icon.is-error   { color: #d64545; background: linear-gradient(160deg, #fff, #fdecec); box-shadow: 0 0 0 1px rgba(214,69,69,.22), 0 0 0 7px rgba(214,69,69,.07), 0 16px 28px -14px rgba(214,69,69,.45); }

html body.page-auth .auth-card h1 {
  margin: 0 0 10px; color: #0b1f3a;
  font-size: 26px; font-weight: 760; letter-spacing: -.03em; line-height: 1.2;
}
html body.page-auth .auth-card .lead {
  margin: 0 0 26px; color: #5f6f86; font-size: 15px; line-height: 1.65;
}
.page-auth .auth-chip {
  display: inline-block; max-width: 100%; padding: 2px 10px;
  border: 1px solid var(--site-info-border); border-radius: 999px;
  background: var(--site-info-bg); color: var(--site-accent);
  font-size: 13px; font-weight: 600; overflow-wrap: anywhere; vertical-align: baseline;
}

/* Messages */
html body.page-auth .auth-card .msg {
  margin: 0 0 22px; padding: 12px 14px;
  border: 1px solid; border-radius: 12px;
  font-size: 14px; line-height: 1.6; text-align: left;
}
html body.page-auth .auth-card .msg-err { border-color: rgba(214,69,69,.3); background: rgba(214,69,69,.07); color: #b83232; }
html body.page-auth .auth-card .msg-ok  { border-color: rgba(31,157,85,.3); background: rgba(31,157,85,.08); color: #18794a; }

/* Form */
.page-auth .auth-card form { text-align: left; }
html body.page-auth .auth-card .auth-field { margin: 0 0 16px; min-width: 0; }
html body.page-auth .auth-card .auth-field > label {
  display: block; margin: 0 0 6px; color: #41536d; font-size: 13px; font-weight: 600;
}
html body.page-auth .auth-card .auth-field input[type=email],
html body.page-auth .auth-card .auth-field input[type=password],
html body.page-auth .auth-card .auth-field input[type=text] {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1px solid #ccd9e8; border-radius: 12px;
  background: #f8fbff; color: #0b1f3a; font-size: 15px;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
html body.page-auth .auth-card .auth-field input:hover { border-color: #aebfd8; }
html body.page-auth .auth-card .auth-field input:focus {
  border-color: var(--site-accent); background: #fff; box-shadow: 0 0 0 4px rgba(31,111,235,.14);
}
.page-auth .auth-hint { display: block; margin-top: 6px; color: #718198; font-size: 12px; min-height: 1em; }
.page-auth .auth-hint.is-ok  { color: #1f9d55; font-weight: 600; }
.page-auth .auth-hint.is-bad { color: #d64545; font-weight: 600; }

/* Strength meter */
.page-auth .pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 10px; }
.page-auth .pw-meter i { height: 4px; border-radius: 999px; background: #e1e9f3; transition: background-color .2s; }
.page-auth .pw-meter[data-level="1"] i:nth-child(-n+1) { background: #d64545; }
.page-auth .pw-meter[data-level="2"] i:nth-child(-n+2) { background: #e0a020; }
.page-auth .pw-meter[data-level="3"] i:nth-child(-n+3) { background: #5cb85c; }
.page-auth .pw-meter[data-level="4"] i { background: #1f9d55; }
.page-auth .pw-meter + .auth-hint { margin-top: 6px; }

/* Primary button (also used as a link) */
html body.page-auth .auth-card .auth-submit {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 50px; margin: 22px 0 0; padding: 12px;
  border: 0; border-radius: 12px;
  background: linear-gradient(180deg, #3b86f5, var(--site-accent));
  color: #fff; font-family: inherit; font-size: 15px; font-weight: 650; text-decoration: none; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 12px 26px -10px rgba(31,111,235,.7);
  transition: transform .15s, box-shadow .15s;
}
html body.page-auth .auth-card .auth-submit:hover {
  background: linear-gradient(180deg, #4b92ff, var(--site-accent-hover)); transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 16px 30px -10px rgba(31,111,235,.8);
}
html body.page-auth .auth-card .auth-submit:focus-visible,
html body.page-auth .auth-card a:focus-visible,
html body.page-auth .auth-card .auth-resend-button:focus-visible { outline: 3px solid rgba(31,111,235,.4); outline-offset: 3px; }
html body.page-auth .auth-card .auth-submit.is-loading { opacity: .85; cursor: progress; }
.page-auth .auth-submit.is-loading::before {
  content: ""; width: 14px; height: 14px; margin-right: 10px;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%;
  animation: au-spin .7s linear infinite;
}
@keyframes au-spin { to { transform: rotate(360deg); } }
html body.page-auth .auth-card .auth-link-button { margin-top: 4px; }

/* Back link */
html body.page-auth .auth-card .back {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 24px 0 0; color: #5f6f86; font-size: 14px; font-weight: 600; text-decoration: none;
}
html body.page-auth .auth-card .back:hover { color: var(--site-accent); }

/* OTP boxes */
.page-auth .otp-boxes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 0 0 4px; }
html body.page-auth .auth-card .otp-boxes input {
  width: 100%; min-width: 0; height: 60px; padding: 0;
  border: 1px solid #ccd9e8; border-radius: 14px; background: #f8fbff;
  color: #0b1f3a; font-family: var(--font-mono); font-size: 26px; font-weight: 700; text-align: center;
  caret-color: var(--site-accent);
  transition: border-color .15s, box-shadow .15s, background-color .15s, transform .15s;
}
html body.page-auth .auth-card .otp-boxes input:focus {
  border-color: var(--site-accent); background: #fff; box-shadow: 0 0 0 4px rgba(31,111,235,.14); transform: translateY(-2px);
}
html body.page-auth .auth-card .otp-boxes input:not(:placeholder-shown) { border-color: #9fc2f5; background: #fff; }
/* without JS: one wide field */
html body.page-auth .auth-card .otp-input {
  width: 100%; min-height: 60px; padding: 12px; border: 1px solid #ccd9e8; border-radius: 14px;
  background: #f8fbff; color: #0b1f3a; font-size: 28px; font-weight: 700; letter-spacing: 12px; text-align: center;
}
html body.page-auth .auth-card .otp-input.is-enhanced {
  position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); border: 0; opacity: 0; pointer-events: none;
}

/* Resend */
html body.page-auth .auth-card .resend {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px;
  margin: 24px 0 0; color: #5f6f86; font-size: 14px;
}
.page-auth .auth-card .resend form { display: inline; }
html body.page-auth .auth-card .auth-resend-button {
  display: inline; width: auto; margin: 0; padding: 0;
  border: 0; background: none; box-shadow: none;
  color: var(--site-accent); font: inherit; font-weight: 650; cursor: pointer;
}
html body.page-auth .auth-card .auth-resend-button:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 3px; }
html body.page-auth .auth-card .auth-resend-button:disabled { color: #8a9bb2; cursor: default; }

@media (max-width: 520px) {
  html body.page-auth .auth-page-main { padding: 36px 16px 56px; }
  html body.page-auth .auth-card { border-radius: 22px; }
  .page-auth .otp-boxes { gap: 6px; }
  html body.page-auth .auth-card .otp-boxes input { height: 52px; font-size: 22px; border-radius: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html body.page-auth .auth-card :is(.auth-submit, .otp-boxes input) { transition: none; transform: none; }
  .page-auth .auth-submit.is-loading::before { animation: none; }
}