/* ==========================================================================
   TESIAVAULT — auth.css
   Split-panel shell, auth card, password controls, strength meter,
   success state. Shared by every template extending auth/base.html.
   ========================================================================== */

body.auth { background: var(--c-white); }

.auth-shell { display: grid; min-height: 100vh; min-height: 100dvh; }
@media (min-width: 1024px) { .auth-shell { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }

/* ---------- Visual panel (desktop only) ---------- */
.auth-aside { display: none; }
@media (min-width: 1024px) {
  .auth-aside {
    display: flex; position: sticky; top: 0; height: 100vh;
    background:
      radial-gradient(70% 60% at 70% 75%, rgba(232, 33, 39, 0.25), transparent 70%),
      url("../images/backgrounds/grid.svg") center / 64px 64px,
      var(--c-black);
    color: var(--c-white); overflow: hidden;
  }
}
.auth-aside__inner { display: flex; flex-direction: column; justify-content: center; width: 100%; padding: var(--sp-8) var(--sp-7); }
.auth-aside__eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--c-red); }
.auth-aside__title {
  margin-top: var(--sp-4); max-width: 18ch;
  font-family: var(--font-display); font-variation-settings: "wdth" 100; font-weight: 800;
  font-size: clamp(2rem, 1.2rem + 2vw, 3.25rem); line-height: 1.05; letter-spacing: -0.02em;
}
.auth-aside__car { width: 125%; max-width: none; margin: var(--sp-7) 0 0 -5%; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.6)); }
.auth-aside__note { margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--c-on-dark-muted); }

/* ---------- Main column ---------- */
.auth-main { display: flex; flex-direction: column; min-width: 0; padding: var(--sp-5) var(--gutter); }
.auth-main__header { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4); }
.auth-main__back {
  display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 44px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--c-muted); text-decoration: none;
}
.auth-main__back:hover { color: var(--c-black); }
.auth-main__content { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; padding-block: var(--sp-7); }
.auth-main__content > .messages, .auth-main__content > .alert { width: 100%; max-width: 440px; margin-bottom: var(--sp-5); }
.auth-main__content .messages { padding: 0; }

/* ---------- Card ---------- */
.auth-card { width: 100%; max-width: 440px; }
.auth-card--wide { max-width: 520px; }
.auth-card--center { text-align: center; }
.auth-card__head { margin-bottom: var(--sp-6); }
.auth-card__title { font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem); line-height: 1.1; font-variation-settings: "wdth" 100; font-weight: 800; letter-spacing: -0.02em; }
.auth-card__lead { margin-top: var(--sp-3); color: var(--c-muted); }
.auth-card__icon {
  display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: var(--sp-5);
  border-radius: var(--r-lg); background: var(--c-gray-50); color: var(--c-black);
}
.auth-card__icon .icon { width: 26px; height: 26px; }
.auth-card__icon--warn { background: var(--c-warn-tint); color: var(--c-warn); }
.auth-card__switch { margin-top: var(--sp-6); text-align: center; font-size: var(--fs-sm); color: var(--c-muted); }
.auth-card__switch a { font-weight: 700; color: var(--c-black); }
.auth-card__switch a:hover { color: var(--c-red); }
.auth-card > .alert { margin-bottom: var(--sp-5); }

.auth-form .checkbox { margin-top: var(--sp-5); }
.auth-form .field .checkbox { margin-top: 0; }
.auth-form > .field:last-of-type .checkbox { margin-top: var(--sp-2); }
.auth-form .form-notice { margin-top: var(--sp-5); }
.auth-form > .btn { margin-top: var(--sp-6); }

/* ---------- Password field ---------- */
.password-field { position: relative; }
.password-field .input { padding-right: 3.25rem; }
.password-toggle {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-md); color: var(--c-muted);
}
.password-toggle:hover { color: var(--c-black); }
.password-toggle .icon--hide { display: none; }
.password-toggle[aria-pressed="true"] .icon--show { display: none; }
.password-toggle[aria-pressed="true"] .icon--hide { display: block; }

/* ---------- Strength meter + rules ---------- */
.strength { display: flex; align-items: center; gap: var(--sp-3); }
.strength__bar { flex: 1; height: 4px; border-radius: 4px; background: var(--c-border); overflow: hidden; }
.strength__fill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--c-red); transition: width var(--t-med) var(--ease), background-color var(--t-med) var(--ease); }
.strength__label { min-width: 4.5rem; text-align: right; font-size: var(--fs-xs); font-weight: 700; }
.strength[data-level="1"] .strength__fill { width: 25%; background: var(--c-red); }
.strength[data-level="2"] .strength__fill { width: 50%; background: #D97706; }
.strength[data-level="3"] .strength__fill { width: 75%; background: #65A30D; }
.strength[data-level="4"] .strength__fill { width: 100%; background: var(--c-success); }
.strength[data-level="1"] .strength__label { color: var(--c-red-dark); }
.strength[data-level="2"] .strength__label { color: var(--c-warn); }
.strength[data-level="3"] .strength__label, .strength[data-level="4"] .strength__label { color: var(--c-success); }

.rules { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; font-size: var(--fs-xs); color: var(--c-muted); }
.rules li { display: inline-flex; align-items: center; gap: 0.4rem; }
.rules li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; transition: background-color var(--t-fast) var(--ease); }
.rules li.is-met { color: var(--c-success); }
.rules li.is-met::before { background: currentColor; }

/* ---------- Success state ---------- */
.success-mark { width: 84px; height: 84px; margin: 0 auto var(--sp-6); }
.success-mark svg { width: 100%; height: 100%; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.success-mark circle { stroke: var(--c-success); stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw 700ms var(--ease) forwards; }
.success-mark path { stroke: var(--c-success); stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 400ms var(--ease) 550ms forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Footer ---------- */
.auth-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-2) var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--c-border); font-size: var(--fs-xs); color: var(--c-muted); }
.auth-footer__links { display: flex; gap: var(--sp-4); }
.auth-footer__links a { color: var(--c-graphite); font-weight: 600; text-decoration: none; }
.auth-footer__links a:hover { color: var(--c-red); }
.auth-footer__disclaimer { max-width: 40rem; }

@media (max-width: 480px) {
  .auth-main__content { padding-block: var(--sp-6); justify-content: flex-start; }
  .auth-footer { flex-direction: column; }
}
