/* ==========================================================================
   Sign in / forgot / reset — photo panel left, form card right
   ========================================================================== */

.auth { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100dvh; }

/* ---------- Left: photo panel ---------- */
.auth-aside {
  position: relative; isolation: isolate; overflow: hidden; color: #fff;
  display: flex; flex-direction: column; padding: 40px clamp(28px, 5vw, 90px) 36px;
  background: #15110e;
}
.aside-bg { position: absolute; inset: 0; z-index: -1; }
.aside-bg img { width: 100%; height: 100%; object-fit: cover; animation: aside-in 1.4s var(--ease) both; }
.aside-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(16, 12, 9, .78) 0%, rgba(16, 12, 9, .86) 45%, rgba(16, 12, 9, .95) 100%),
    radial-gradient(90% 70% at 30% 85%, rgba(242, 169, 0, .3), transparent 70%);
}
[data-theme="light"] .auth-aside { color: var(--ink); background: var(--bg); }
[data-theme="light"] .aside-bg::after {
  background:
    linear-gradient(180deg, rgba(245, 244, 240, .26) 0%, rgba(245, 244, 240, .36) 48%, rgba(245, 244, 240, .46) 100%),
    radial-gradient(90% 70% at 30% 85%, rgba(242, 169, 0, .08), transparent 70%);
}
[data-theme="light"] .aside-sub { color: var(--ink-2); }
[data-theme="light"] .aside-foot { color: var(--muted); }
[data-theme="light"] .aside-pills li { color: var(--ink-2); background: rgba(255, 255, 255, .48); border-color: var(--line-strong); }
[data-theme="light"] .aside-logo .logo-box { background: transparent; box-shadow: none; }
@keyframes aside-in { from { transform: scale(1.08); opacity: .3; } }

.aside-logo { align-self: flex-start; }
.logo-box { display: block; border-radius: 16px; overflow: hidden; background: transparent; }
.logo-box img { width: 140px; height: auto; display: block; }

.aside-copy { margin-top: auto; margin-bottom: auto; padding: 40px 0; max-width: 620px; }
.aside-eyebrow {
  display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 18px; border-radius: var(--r-pill);
  border: 1.5px solid var(--accent); color: var(--accent);
  font-size: var(--fs-sm); font-weight: 750; letter-spacing: .16em; text-transform: uppercase;
}
.aside-eyebrow .icon { width: 17px; height: 17px; }
.aside-title { margin: 28px 0 22px; font-size: clamp(2.8rem, 5.2vw, 4.6rem); font-weight: 780; letter-spacing: -.04em; line-height: 1; }
.aside-title span { display: block; }
.aside-title .accent { color: var(--accent); }
.aside-sub { font-size: clamp(1.05rem, 1.4vw, 1.3rem); line-height: 1.5; color: rgba(255, 255, 255, .8); max-width: 40ch; }
.aside-pills { list-style: none; margin: 34px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.aside-pills li {
  display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 18px; border-radius: 14px;
  font-weight: 600; font-size: var(--fs-sm); color: rgba(255, 255, 255, .92);
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(2px);
}
.aside-pills .icon { color: var(--accent); width: 19px; height: 19px; }
.aside-foot { font-size: var(--fs-sm); color: rgba(255, 255, 255, .6); }

/* ---------- Right: form ---------- */
.auth-panel { position: relative; display: flex; flex-direction: column; padding: 24px clamp(20px, 5vw, 64px); background: var(--surface); }
[data-theme="dark"] .auth-panel { background: var(--bg); }
.auth-top { display: flex; justify-content: flex-end; }
.auth-main { width: min(520px, 100%); margin: auto; padding: 32px 0; }
.auth-eyebrow { color: var(--accent-ink); font-size: var(--fs-sm); font-weight: 750; letter-spacing: .18em; text-transform: uppercase; }
.auth-main h1 { margin-top: 12px; font-size: clamp(2.2rem, 3.6vw, 3rem); font-weight: 780; letter-spacing: -.035em; line-height: 1.05; }
.auth-sub { margin-top: 12px; font-size: var(--fs-lg); color: var(--muted); line-height: 1.45; }

.auth-card {
  margin-top: 36px; padding: clamp(22px, 3vw, 40px); display: grid; gap: 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 28px;
  box-shadow: 0 1px 2px rgba(40, 28, 16, .04), 0 24px 48px -32px rgba(40, 28, 16, .25);
}
[data-theme="dark"] .auth-card { background: var(--surface); box-shadow: 0 24px 48px -28px rgba(0, 0, 0, .8); }
.auth-card .field + .field { margin-top: 0; }
.auth-card .label { font-size: var(--fs-md); font-weight: 600; color: var(--ink); }
.auth-card .input { min-height: 56px; border-radius: 14px; font-size: var(--fs-md); }
.auth-card .input-group > .icon { color: var(--accent-ink); width: 20px; height: 20px; left: 16px; }
.auth-card .input-group > .icon ~ .input { padding-left: 50px; }
.auth-card .input-action { right: 8px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.link { color: var(--accent-ink); font-weight: 600; font-size: var(--fs-sm); text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Checkbox */
.check { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: var(--fs-md); color: var(--ink-2); user-select: none; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box {
  width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line-strong); background: var(--surface);
  display: grid; place-items: center; flex: none; transition: background-color var(--dur), border-color var(--dur);
}
.check .box .icon { width: 14px; height: 14px; stroke-width: 3; color: var(--on-accent); opacity: 0; transform: scale(.6); transition: opacity var(--dur), transform var(--dur); }
.check input:checked + .box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .box .icon { opacity: 1; transform: none; }
.check input:focus-visible + .box { box-shadow: var(--focus); }

/* Big solid button */
.btn-hero {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 62px;
  border: 0; border-radius: 18px; cursor: pointer; font-weight: 750; font-size: 1.08rem;
  background: var(--primary); color: var(--on-primary);
  box-shadow: 0 16px 32px -18px rgba(0, 0, 0, .6);
  transition: transform 150ms var(--ease), box-shadow 250ms var(--ease), background-color 250ms var(--ease);
}
.btn-hero .icon { color: var(--accent); }
[data-theme="dark"] .btn-hero { background: var(--accent); color: var(--on-accent); }
[data-theme="dark"] .btn-hero .icon { color: var(--on-accent); }
.btn-hero:hover { transform: translateY(-2px); box-shadow: 0 22px 38px -18px rgba(0, 0, 0, .7); }
.btn-hero:active { transform: translateY(0) scale(.99); }
.btn-hero .icon { width: 20px; height: 20px; }
.btn-hero .spinner { display: none; }
.btn-hero.is-loading { pointer-events: none; opacity: .85; }
.btn-hero.is-loading .spinner { display: inline-block; }
.btn-hero.is-loading .icon { display: none; }

.auth-back { display: inline-flex; align-items: center; gap: 10px; margin-top: 30px; color: var(--muted); text-decoration: none; font-size: var(--fs-lg); }
.auth-back:hover { color: var(--ink); }
.auth-back .icon { transition: transform var(--dur); }
.auth-back:hover .icon { transform: translateX(3px); }

.auth-note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-size: var(--fs-sm); }
.auth-note .icon { color: var(--success); }

.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 4px; }
.strength span { height: 4px; border-radius: 2px; background: var(--line); transition: background-color var(--dur); }
.strength span.on.s1 { background: var(--danger); }
.strength span.on.s2 { background: var(--warning); }
.strength span.on.s3, .strength span.on.s4 { background: var(--success); }

/* ---------- Entrance animation ---------- */
.aside-copy > *, .aside-logo { animation: auth-rise 800ms var(--ease) both; }
.aside-copy > :nth-child(1) { animation-delay: 120ms; }
.aside-copy > :nth-child(2) { animation-delay: 220ms; }
.aside-copy > :nth-child(3) { animation-delay: 320ms; }
.aside-copy > :nth-child(4) { animation-delay: 420ms; }
.auth-main > * { animation: auth-rise 700ms var(--ease) both; }
.auth-main > :nth-child(2) { animation-delay: 80ms; }
.auth-main > :nth-child(3) { animation-delay: 150ms; }
.auth-main > :nth-child(4) { animation-delay: 230ms; }
.auth-main > :nth-child(5) { animation-delay: 320ms; }
@keyframes auth-rise { from { opacity: 0; transform: translateY(22px); } }
.auth-card .input { transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease), transform 200ms var(--ease); }
.auth-card .input:focus { box-shadow: 0 0 0 4px var(--accent-soft); }
.auth-credit { margin-top: 22px; font-size: var(--fs-xs); color: var(--muted); }
.auth-credit a { color: var(--ink); font-weight: 700; text-decoration: none; border-bottom: 1.5px solid var(--accent); }

/* ---------- Error pages (share this layout) ---------- */
.error-page { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; padding: 24px; }
.error-page img { border-radius: 14px; }
.error-code { font-size: 5rem; line-height: 1; color: var(--accent-ink); }
.error-page h1 { font-size: var(--fs-2xl); }
.error-page .btn { margin-top: 12px; }
.error-trace { max-width: min(900px, 92vw); max-height: 40vh; overflow: auto; text-align: left; font-size: 12px; background: var(--surface); border: 1px solid var(--line); padding: 12px; border-radius: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .auth { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
  .aside-pills li { height: 40px; padding: 0 14px; }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-content: start; }
  .auth-aside { align-items: center; padding: 18px 20px 8px; min-height: 0; background: transparent; color: var(--ink); }
  .aside-bg, .aside-copy, .aside-foot { display: none; }
  .aside-logo { align-self: center; }
  .auth-login .auth-eyebrow { display: none; }
  .logo-box { background: transparent; box-shadow: none; }
  .logo-box img { width: 112px; }
  .auth-panel { position: static; padding: 0 24px 24px; }
  .auth-top { position: absolute; top: 30px; right: 18px; z-index: 2; }
  .auth-main { margin: 0 auto; padding: 8px 0 24px; }
  .auth-main h1 { font-size: 2.1rem; }
  .auth-card { margin-top: 24px; border-radius: 22px; }
  .auth-top .theme-switch > summary { background: var(--surface); border-color: var(--line); }
}
@media (max-width: 520px) {
  .auth-aside { padding-top: 14px; }
  .auth-panel { padding-right: 16px; padding-left: 16px; }
  .auth-main h1 { font-size: 1.9rem; }
  .auth-card { padding: 20px; gap: 18px; border-radius: 20px; }
}
