@font-face {
  font-family: "Red Rose";
  src: url("../FONTS/Red_Rose/RedRose-VariableFont_wght.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #090705;
  --panel: #17100a;
  --panel-deep: #100b07;
  --gold: #f5a524;
  --gold-bright: #ffc85b;
  --cream: #fff4dc;
  --muted: #b9a78a;
  --line: rgba(245, 165, 36, .28);
  --success: #77e2a8;
  --danger: #ff8d75;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #090705; }

body.auth-recovery-page {
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: var(--cream);
  font-family: "Red Rose", "Segoe UI", sans-serif;
  background: linear-gradient(128deg, #050403 0%, #160e07 50%, #2a1606 100%);
}

a { color: inherit; }

.auth-header,
.auth-footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-header { min-height: 88px; }

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--cream);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-decoration: none;
}

.auth-brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(245, 165, 36, .38));
}

.auth-header-link,
.auth-footer a,
.auth-switch a {
  color: var(--gold-bright);
  font-weight: 650;
  text-underline-offset: 4px;
}

.auth-header-link {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.auth-header-link:hover { border-color: var(--gold); background: rgba(245, 165, 36, .09); transform: translateY(-1px); }

.auth-stage {
  width: 100%;
  display: grid;
  place-items: center;
  padding: 42px 20px 64px;
}

.auth-card {
  position: relative;
  isolation: isolate;
  width: min(100%, 540px);
  padding: clamp(28px, 6vw, 48px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(155deg, rgba(29, 20, 12, .98), rgba(13, 9, 6, .99));
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45), 0 0 42px rgba(245, 165, 36, .08), inset 0 1px rgba(255, 229, 177, .07);
}

.auth-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -100px auto auto -100px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(245, 165, 36, .11);
  filter: blur(55px);
}

.auth-card--wide { width: min(100%, 620px); }

.auth-card-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 200, 91, .58);
  border-radius: 17px;
  color: var(--gold-bright);
  font: 700 1.5rem/1 "Red Rose", sans-serif;
  background: #261606;
  box-shadow: 0 0 26px rgba(245, 165, 36, .2), inset 0 0 14px rgba(245, 165, 36, .08);
}

.auth-card-icon svg { width: 30px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.auth-card-icon--signal { animation: signal 2.8s ease-in-out infinite; }
.auth-card-icon--warning { color: var(--danger); border-color: rgba(255, 141, 117, .45); background: #2a100b; }

@keyframes signal { 50% { box-shadow: 0 0 38px rgba(245, 165, 36, .38), inset 0 0 16px rgba(245, 165, 36, .12); } }

.auth-eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.auth-card h1 {
  margin: 0;
  color: var(--cream);
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.04;
  letter-spacing: -.045em;
}

.auth-intro { margin: 18px 0 28px; color: var(--muted); font-size: .98rem; line-height: 1.72; }
.auth-intro strong { color: var(--cream); overflow-wrap: anywhere; }

.auth-form { display: grid; gap: 12px; }
.auth-form--compact { margin-top: 24px; }
.auth-form label, .password-component > label { color: #e9d8b8; font-size: .82rem; font-weight: 650; letter-spacing: .025em; }

.auth-input-shell,
.password-input-shell { position: relative; }

.auth-input-shell > svg {
  position: absolute;
  top: 50%; left: 16px;
  width: 20px;
  transform: translateY(-50%);
  fill: none;
  stroke: #c68b35;
  stroke-width: 1.5;
  pointer-events: none;
}

.auth-input-shell input,
.password-input-shell input {
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(215, 158, 72, .35);
  border-radius: 13px;
  outline: none;
  color: var(--cream);
  caret-color: var(--gold-bright);
  font: 500 .95rem/1.2 "Red Rose", sans-serif;
  background: #0d0906;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.auth-input-shell input { padding: 0 16px 0 47px; }
.password-input-shell input { padding: 0 52px 0 16px; }
.auth-input-shell input::placeholder,
.password-input-shell input::placeholder { color: #806f58; }
.auth-input-shell input:focus,
.password-input-shell input:focus { border-color: var(--gold); background: #120c07; box-shadow: 0 0 0 3px rgba(245, 165, 36, .12), 0 0 22px rgba(245, 165, 36, .1); }

.auth-primary-button,
.auth-secondary-button {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
  border-radius: 13px;
  cursor: pointer;
  font: 700 .9rem/1 "Red Rose", sans-serif;
  letter-spacing: .025em;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.auth-primary-button {
  border: 1px solid #ffca66;
  color: #160d03;
  background: linear-gradient(105deg, #e8860a, #ffc14e);
  box-shadow: 0 10px 26px rgba(232, 134, 10, .22), inset 0 1px rgba(255, 255, 255, .35);
}

.auth-primary-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.auth-primary-button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.07); box-shadow: 0 14px 34px rgba(232, 134, 10, .34), 0 0 24px rgba(255, 193, 78, .12); }
.auth-primary-button:disabled { cursor: not-allowed; filter: saturate(.45); opacity: .52; }
.auth-button-link { text-decoration: none; }

.auth-secondary-button { width: 100%; border: 1px solid rgba(245, 165, 36, .48); color: var(--gold-bright); background: #171008; }
.auth-secondary-button:hover { transform: translateY(-1px); box-shadow: 0 0 24px rgba(245, 165, 36, .14); }

.auth-security-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 22px;
  padding: 13px 15px;
  border: 1px solid rgba(119, 226, 168, .18);
  border-radius: 12px;
  color: #b9d8c6;
  background: rgba(28, 89, 57, .13);
}

.auth-security-note > span { color: var(--success); font-weight: 700; }
.auth-security-note p { margin: 0; font-size: .77rem; line-height: 1.5; }
.auth-switch { margin: 24px 0 0; color: var(--muted); font-size: .85rem; text-align: center; }

.auth-message { margin: 18px 0; padding: 13px 14px; border: 1px solid; border-radius: 12px; font-size: .84rem; line-height: 1.5; }
.auth-message--success { border-color: rgba(119, 226, 168, .38); color: #c8f1da; background: rgba(28, 89, 57, .2); }
.auth-message--error { border-color: rgba(255, 141, 117, .4); color: #ffd0c5; background: rgba(109, 38, 25, .2); }

.auth-steps { display: grid; gap: 10px; margin: 26px 0 0; padding: 0; list-style: none; }
.auth-steps li { display: flex; gap: 13px; align-items: flex-start; padding: 13px; border: 1px solid rgba(245, 165, 36, .13); border-radius: 13px; background: rgba(245, 165, 36, .035); }
.auth-steps li > span { flex: 0 0 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--gold-bright); font-size: .74rem; font-weight: 700; background: #1d1208; }
.auth-steps p { margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.auth-steps strong { display: block; color: var(--cream); font-size: .82rem; }

.password-component { display: grid; gap: 11px; }
.password-component > label:not(:first-child) { margin-top: 5px; }
.password-visibility-toggle { position: absolute; top: 50%; right: 10px; width: 38px; height: 38px; display: grid; place-items: center; transform: translateY(-50%); border: 0; border-radius: 10px; cursor: pointer; color: #b99a68; background: transparent; }
.password-visibility-toggle:hover { color: var(--gold-bright); background: rgba(245, 165, 36, .08); }
.password-visibility-toggle svg { grid-area: 1/1; width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.password-visibility-toggle .eye-closed, .password-visibility-toggle.is-visible .eye-open { display: none; }
.password-visibility-toggle.is-visible .eye-closed { display: block; }

.password-intelligence { padding: 14px; border: 1px solid rgba(245, 165, 36, .14); border-radius: 13px; background: #100b07; }
.password-strength-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; color: var(--muted); font-size: .7rem; }
.password-strength-heading strong { color: var(--gold-bright); font-size: .72rem; }
.password-strength-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.password-strength-meter span { height: 4px; border-radius: 99px; background: #3b2c1d; transition: background .2s, box-shadow .2s; }
.password-strength-meter[data-strength="1"] span.is-active { background: var(--danger); }
.password-strength-meter[data-strength="2"] span.is-active { background: #f5a524; }
.password-strength-meter[data-strength="3"] span.is-active { background: #ffd064; }
.password-strength-meter[data-strength="4"] span.is-active { background: var(--success); box-shadow: 0 0 9px rgba(119, 226, 168, .35); }
.password-requirements { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.password-requirements li { display: flex; gap: 6px; align-items: center; color: #8d7b62; font-size: .63rem; line-height: 1.35; }
.password-requirements li i { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #5a4630; }
.password-requirements li[data-state="pass"] { color: #a9dabe; }
.password-requirements li[data-state="pass"] i { background: var(--success); box-shadow: 0 0 7px rgba(119, 226, 168, .45); }
.password-requirements li[data-state="fail"] { color: #ffad9c; }
.password-requirements li[data-state="fail"] i { background: var(--danger); }
.password-match-status, .caps-lock-status { margin: -3px 0 0; color: #8d7b62; font-size: .68rem; }
.password-match-status[data-state="match"] { color: var(--success); }
.password-match-status[data-state="mismatch"], .caps-lock-status { color: var(--danger); }

.auth-footer { min-height: 76px; border-top: 1px solid rgba(245, 165, 36, .1); color: #806f58; font-size: .74rem; }
.auth-footer nav { display: flex; gap: 18px; }
.auth-footer a { color: #ad9876; text-decoration: none; }
.auth-footer a:hover { color: var(--gold-bright); }

@media (max-width: 600px) {
  .auth-header, .auth-footer { width: min(100% - 28px, 1180px); }
  .auth-header { min-height: 72px; }
  .auth-brand span { font-size: .94rem; }
  .auth-brand img { width: 36px; height: 36px; }
  .auth-header-link { font-size: .72rem; }
  .auth-stage { padding: 22px 14px 44px; }
  .auth-card { padding: 28px 20px; border-radius: 21px; }
  .password-requirements { grid-template-columns: 1fr; }
  .auth-footer { flex-direction: column; justify-content: center; gap: 8px; padding: 16px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
