/* Login / sign up — split layout (DESIGN_PLAYBOOK: desktop reference, responsive stack). */
:root {
  --auth-bg: #ffffff;
  --auth-text: #111827;
  --auth-muted: #64748b;
  --auth-line: #e2e8f0;
  --auth-input-bg: #ffffff;
  --link: #38bdf8;
  --link-hover: #0ea5e9;
  --brand-blue: #4a90e2;
  --brand-purple: #7b61ff;
  --hero-text-sub: rgba(255, 255, 255, 0.88);
  --danger: #dc2626;
  --focus: #4a90e2;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body.auth-page {
  margin: 0;
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--auth-text);
  background: var(--auth-bg);
}

body.auth-page input[type='checkbox'] {
  accent-color: var(--brand-blue);
  width: 1.05em;
  height: 1.05em;
  vertical-align: middle;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(320px, 2fr) minmax(360px, 3fr);
  grid-template-rows: 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  align-items: stretch;
}

@media (min-width: 901px) {
  .auth-shell {
    /* Explicit viewport height so the left column flex layer gets real space to center into. */
    height: 100vh;
    height: 100dvh;
  }
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    min-height: 0;
    height: auto;
  }
}

.auth-panel {
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 4vw, 48px);
  padding-bottom: clamp(32px, 6vw, 56px);
  min-height: 0;
}

.auth-panel--form {
  background: var(--auth-bg);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
  min-height: 0;
  align-self: stretch;
}

@media (min-width: 901px) {
  .auth-panel--form {
    /* Fallback when % height doesn’t resolve from grid — gives .auth-fill room to center. */
    min-height: 100vh;
    min-height: 100dvh;
  }
}

/* Grows between the top of the column and the footer; centers the form block inside. */
.auth-fill {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  min-height: 0;
  width: 100%;
}

.auth-panel-main {
  flex: 0 0 auto;
  width: 100%;
}

@media (max-width: 900px) {
  .auth-panel--form {
    height: auto;
  }

  .auth-fill {
    flex: 0 1 auto;
    justify-content: flex-start;
  }
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: clamp(22px, 4vh, 36px);
}

.auth-brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  outline-offset: 4px;
}

.auth-brand-link:focus-visible {
  outline: 2px solid var(--focus);
  border-radius: 8px;
}

.auth-brand-img {
  display: block;
  height: 44px;
  width: auto;
  max-width: min(220px, 100%);
}

.auth-lede {
  margin: 0 0 28px;
  font-size: 14px;
  color: var(--auth-muted);
  font-weight: 400;
  max-width: 360px;
}

.auth-form-wrap {
  flex: 1;
  max-width: 400px;
  width: 100%;
}

.auth-fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--auth-text);
  margin-bottom: 6px;
}

.auth-field input {
  width: 100%;
  padding: 11px 12px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid var(--auth-line);
  border-radius: 8px;
  background: var(--auth-input-bg);
  color: var(--auth-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-field input::placeholder {
  color: #94a3b8;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

/* Keep filled/autofill styling consistent (browser default blue fill varies by field). */
.auth-field input:-webkit-autofill,
.auth-field input:-webkit-autofill:hover,
.auth-field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
  box-shadow: 0 0 0 1000px #ffffff inset;
  -webkit-text-fill-color: var(--auth-text);
  transition: background-color 9999s ease-out;
}

.auth-forgot {
  margin: 4px 0 0;
  text-align: right;
  font-size: 13px;
}

.auth-forgot a {
  color: var(--link);
  font-weight: 600;
  text-decoration: none;
}

.auth-forgot a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.auth-forgot.is-hidden {
  display: none;
}

.auth-submit {
  margin-top: 8px;
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-purple));
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: filter 0.15s ease, transform 0.05s ease;
}

.auth-submit:hover:not(:disabled) {
  filter: brightness(1.05);
}

.auth-submit:active:not(:disabled) {
  transform: translateY(1px);
}

.auth-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-switch {
  margin-top: 22px;
  font-size: 14px;
  color: var(--auth-muted);
}

.auth-switch button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--link);
  cursor: pointer;
  text-decoration: none;
}

.auth-switch button:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.auth-footer {
  flex-shrink: 0;
  margin-top: 0;
  padding-top: 40px;
}

.auth-footer-links {
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}

.auth-footer-links a {
  color: inherit;
  text-decoration: none;
}

.auth-footer-links a:hover {
  text-decoration: underline;
  color: var(--auth-muted);
}

.auth-footer-links span {
  opacity: 0.5;
}

.auth-copy {
  margin: 10px 0 0;
  font-size: 11px;
  color: #cbd5e1;
}

.auth-banner {
  display: none;
  margin-bottom: 16px;
  padding: 10px 12px;
  font-size: 13px;
  border-radius: 8px;
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.auth-banner.is-visible {
  display: block;
}

.auth-banner--info {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.auth-panel--hero {
  position: relative;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: clamp(32px, 6vw, 64px);
  background: radial-gradient(
    ellipse 120% 100% at 50% 40%,
    #5eb8ff 0%,
    #4a90e2 28%,
    #5a4fcf 65%,
    #3d2d7a 100%
  );
  color: #fff;
}

@media (max-width: 900px) {
  .auth-panel--hero {
    min-height: 280px;
    order: -1;
    padding: 40px 24px;
  }
}

.hero-inner {
  max-width: 440px;
}

.hero-kicker {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--hero-text-sub);
  text-transform: none;
}

.hero-quote {
  margin: 0 0 16px;
  font-size: clamp(22px, 3.2vw, 30px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.hero-sub {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--hero-text-sub);
}

.auth-back-link {
  display: inline-block;
  color: var(--link);
  font-weight: 600;
  text-decoration: none;
}

.auth-back-link:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.reset-waiting {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--auth-muted);
}

.reset-waiting--error {
  color: var(--danger);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
