/* Sign-in page. Tokens, buttons and the brand mark come from theme.css. */
.auth-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }

/* Left panel */
.auth-side {
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 28px 40px; display: flex; flex-direction: column; gap: 24px;
}
.auth-side .brand { padding: 0; }
.side-body { margin: auto 0; max-width: 460px; display: flex; flex-direction: column; gap: 14px; }
.side-body h1 {
  font-family: var(--display); font-weight: 600; font-size: 34px; line-height: 1.15;
  letter-spacing: -.01em; margin: 0; text-wrap: balance;
}
.side-body p { margin: 0; color: var(--ink-2); max-width: 44ch; }
.sample {
  margin-top: 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 10px;
}
.sample-head { display: flex; justify-content: space-between; align-items: baseline; }
.sample-score { font-size: 22px; font-weight: 700; }
.sample-score small { font-size: 12px; color: var(--muted); font-weight: 500; }
.sample-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 32px; gap: 10px; align-items: center; font-size: 13px; color: var(--ink-2); }
.sample-row b { text-align: right; color: var(--ink); }
.sample .bar { height: 7px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 999px; overflow: hidden; display: block; }
.sample .bar span { display: block; height: 100%; border-radius: 999px; }
.theme-btn {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; border: 0; background: none;
  color: var(--muted); font-size: 13px; padding: 6px 0;
}
.theme-btn svg { width: 16px; height: 16px; }
.theme-btn:hover { color: var(--ink); }

/* Right: the card */
.auth-main { display: grid; place-items: center; padding: 32px 24px; }
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 16px; }
.auth-card h2 { font-family: var(--display); font-weight: 600; font-size: 28px; margin: 0; letter-spacing: -.01em; }
.auth-card .sub { margin: -8px 0 4px; }

.google-btn { width: 100%; padding: 11px 16px; font-size: 14.5px; position: relative; }
.google-btn svg { width: 18px; height: 18px; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
label { font-size: 13px; font-weight: 600; color: var(--ink); }
input {
  width: 100%; font: inherit; font-size: 14.5px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 10px 12px; transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--muted); }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field.invalid input { border-color: var(--bad); }
.field.invalid input:focus { box-shadow: 0 0 0 3px var(--bad-soft); }
.field-error { margin: 0; font-size: 12.5px; color: var(--bad); min-height: 0; }
.field-error:empty { display: none; }
.field-hint { margin: 0; font-size: 12.5px; color: var(--muted); }
.field.invalid .field-hint { display: none; }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 64px; }
.show-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; color: var(--accent); font-size: 12.5px; font-weight: 600; padding: 6px 8px; border-radius: 6px;
}
.show-btn:hover { background: var(--accent-soft); }

.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-size: 13px; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.link-btn:disabled { opacity: .5; cursor: default; text-decoration: none; }

.submit-btn { width: 100%; padding: 11px 16px; font-size: 14.5px; margin-top: 2px; }

/* Loading: label stays, spinner appears */
.spinner {
  width: 15px; height: 15px; border-radius: 50%; display: none;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor;
  animation: spin .7s linear infinite;
}
.btn.loading .spinner { display: inline-block; }
.btn.loading { cursor: default; }
@keyframes spin { to { transform: rotate(360deg); } }

.alert { display: none; font-size: 13.5px; padding: 10px 12px; border-radius: var(--r-sm); }
.alert.show { display: block; }
.alert.error { background: var(--bad-soft); color: var(--bad); }
.alert.success { background: var(--good-soft); color: var(--good); }

.switch { margin: 4px 0 0; text-align: center; font-size: 13.5px; color: var(--muted); display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 860px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth-side { border-right: 0; border-bottom: 1px solid var(--line); padding: 20px 16px; gap: 12px; flex-direction: row; align-items: center; justify-content: space-between; }
  .side-body { display: none; }
  .theme-btn { align-self: center; }
  .theme-btn span { display: none; }
  .auth-main { place-items: start center; padding: 28px 16px 40px; }
}
