/* ==========================================================================
   Briefs Auth & Registration Flow — Editorial Studio UI
   ========================================================================== */

:root {
  --auth-paper: #FAF9F7;
  --auth-surface: #FFFFFF;
  --auth-rail: #111318;
  --auth-ink: #111318;
  --auth-muted: #5F6673;
  --auth-subtle: #8B929E;
  --auth-rule: #E5E7EB;
  --auth-rule-strong: #D1D5DB;
  --auth-accent: #0B5FFF;
  --auth-accent-soft: rgba(11, 95, 255, 0.08);
  --auth-green: #16A34A;
  --auth-green-soft: rgba(22, 163, 74, 0.12);
  --auth-amber: #D97706;
  --auth-danger: #DC2626;
  --auth-danger-soft: #FEF2F2;
  --auth-danger-border: #FECACA;
  --auth-serif: "Playfair Display", Georgia, serif;
  --auth-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --auth-mono: "DM Mono", ui-monospace, SFMono-Regular, monospace;
  --auth-radius: 14px;
  --auth-input-radius: 10px;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--auth-paper);
  color: var(--auth-ink);
  font-family: var(--auth-sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(340px, 43%) 1fr;
}

/* ── Left Editorial Showcase Rail ───────────────────────────────────────── */
.auth-rail {
  background: var(--auth-rail);
  color: #F8FAFC;
  padding: clamp(32px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-rail::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 18%, rgba(11, 95, 255, 0.22), transparent 46%),
    radial-gradient(circle at 86% 82%, rgba(22, 163, 74, 0.14), transparent 44%);
  pointer-events: none;
}

.auth-rail__top,
.auth-rail__body,
.auth-rail__foot {
  position: relative;
  z-index: 1;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.025em;
  color: #FFFFFF;
}

.auth-brand svg {
  flex-shrink: 0;
  color: #FFFFFF;
}

.auth-brand-word {
  display: inline-flex;
  align-items: flex-start;
  gap: 2px;
  font-weight: 800;
}

.auth-brand-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #E11D48;
  margin-top: 2px;
  flex-shrink: 0;
}

.auth-rail__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--auth-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #93C5FD;
  background: rgba(11, 95, 255, 0.16);
  border: 1px solid rgba(147, 197, 253, 0.25);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 22px;
}

.auth-rail__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.auth-rail__title {
  font-family: var(--auth-serif);
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  color: #FFFFFF;
}

.auth-rail__title em {
  font-style: italic;
  color: #60A5FA;
}

.auth-rail__lead {
  font-size: 15px;
  line-height: 1.65;
  color: rgba(248, 250, 252, 0.72);
  max-width: 40ch;
  margin: 0 0 32px;
}

.auth-rail__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.auth-rail__list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(248, 250, 252, 0.88);
}

.auth-rail__check {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #4ADE80;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.auth-rail__list strong {
  display: block;
  font-weight: 600;
  color: #FFFFFF;
}

.auth-rail__list span {
  color: rgba(248, 250, 252, 0.65);
  font-size: 13px;
}

.auth-rail__foot {
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: rgba(248, 250, 252, 0.56);
}

/* ── Right Form Workspace ───────────────────────────────────────────────── */
.auth-main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(20px, 3vw, 36px) clamp(18px, 4vw, 48px);
}

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 460px;
  width: 100%;
  margin: 0 auto 20px;
}

.auth-mobile-brand {
  display: none;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--auth-ink);
}

.auth-mobile-brand svg {
  flex-shrink: 0;
  color: var(--auth-ink);
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--auth-muted);
  transition: color 0.15s ease;
}

.auth-back-link:hover { color: var(--auth-ink); }

.auth-switch-hint {
  font-size: 13px;
  color: var(--auth-muted);
  margin-left: auto;
}

.auth-switch-hint a {
  color: var(--auth-accent);
  font-weight: 600;
}

.auth-switch-hint a:hover { text-decoration: underline; }

.auth-card-wrap {
  width: 100%;
  max-width: 460px;
  margin: auto;
}

.auth-card {
  background: var(--auth-surface);
  border: 1px solid var(--auth-rule);
  border-radius: var(--auth-radius);
  padding: clamp(24px, 4vw, 34px);
  box-shadow: 0 12px 32px -12px rgba(17, 19, 24, 0.08);
}

/* Mode tabs (Sign up / Sign in) */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: #F3F4F6;
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 22px;
}

.auth-tab {
  text-align: center;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--auth-muted);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.auth-tab:hover { color: var(--auth-ink); }

.auth-tab.is-active {
  background: var(--auth-surface);
  color: var(--auth-ink);
  box-shadow: 0 1px 3px rgba(17, 19, 24, 0.08);
}

.auth-head {
  margin-bottom: 20px;
}

.auth-title {
  font-family: var(--auth-serif);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--auth-ink);
}

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

/* Selected Plan Context Banner */
.auth-plan-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--auth-accent-soft);
  border: 1px solid rgba(11, 95, 255, 0.2);
  color: #0946B8;
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 13px;
  margin-bottom: 18px;
}

.auth-plan-pill strong { font-weight: 600; }

.auth-plan-pill a {
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  white-space: nowrap;
}

/* Status & Alert Boxes */
.auth-alert {
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 13.5px;
  line-height: 1.45;
  margin-bottom: 16px;
}

.auth-alert--error {
  background: var(--auth-danger-soft);
  border: 1px solid var(--auth-danger-border);
  color: #991B1B;
}

.auth-alert--success {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
}

.auth-alert--beta {
  background: #EEF4FF;
  border: 1px solid #D6E4FF;
  color: #1E3A8A;
}

.auth-alert--beta a {
  color: #0B5FFF;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.auth-alert--beta a:hover {
  color: #0047D6;
}

/* OAuth Social Buttons */
.auth-oauth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-oauth-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--auth-rule-strong);
  border-radius: var(--auth-input-radius);
  background: #FFFFFF;
  color: var(--auth-ink);
  font-size: 13.5px;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.auth-oauth-btn:hover {
  border-color: #9CA3AF;
  background: #F9FAFB;
}

.auth-oauth-btn:active { transform: translateY(1px); }

.auth-oauth-btn img {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.auth-last-badge {
  position: absolute;
  top: -8px;
  right: 8px;
  font-family: var(--auth-mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  color: #FFFFFF;
  background: var(--auth-green);
  padding: 3px 7px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.25);
  pointer-events: none;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--auth-subtle);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--auth-rule);
}

/* Form Controls */
.auth-form {
  display: grid;
  gap: 15px;
}

.auth-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.auth-field {
  display: grid;
  gap: 6px;
}

.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.auth-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.auth-forgot {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--auth-accent);
}

.auth-forgot:hover { text-decoration: underline; }

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input {
  width: 100%;
  height: 43px;
  padding: 0 13px;
  border-radius: var(--auth-input-radius);
  border: 1px solid var(--auth-rule-strong);
  background: #F9FAFB;
  color: var(--auth-ink);
  font-family: var(--auth-sans);
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.auth-input--pw {
  padding-right: 44px;
}

.auth-input:hover { border-color: #9CA3AF; }

.auth-input:focus {
  background: #FFFFFF;
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px rgba(11, 95, 255, 0.12);
}

.auth-input.is-invalid {
  border-color: var(--auth-danger);
  background: #FFFDFD;
}

.auth-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.auth-pw-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--auth-muted);
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.auth-pw-toggle:hover {
  color: var(--auth-ink);
  background: rgba(17, 19, 24, 0.05);
}

.auth-pw-toggle svg { width: 18px; height: 18px; }

.auth-error {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--auth-danger);
  line-height: 1.45;
}

.auth-error-link {
  color: #0B5FFF;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-left: 3px;
  white-space: nowrap;
}

.auth-error-link:hover {
  color: #0047D6;
}

/* Password live strength & checklist */
.auth-pw-meter {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}

.auth-pw-bars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  height: 4px;
}

.auth-pw-bar {
  border-radius: 999px;
  background: #E5E7EB;
  transition: background-color 0.2s ease;
}

.auth-pw-meter[data-level="1"] .auth-pw-bar:nth-child(1) { background: var(--auth-danger); }
.auth-pw-meter[data-level="2"] .auth-pw-bar:nth-child(-n+2) { background: var(--auth-amber); }
.auth-pw-meter[data-level="3"] .auth-pw-bar { background: var(--auth-green); }

.auth-pw-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--auth-subtle);
}

.auth-pw-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s ease;
}

.auth-pw-hint.is-met {
  color: var(--auth-green);
  font-weight: 500;
}

.auth-pw-hint-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Remember checkbox */
.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: #374151;
  cursor: pointer;
  user-select: none;
}

.auth-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--auth-accent);
  border-radius: 4px;
  cursor: pointer;
}

/* Submit Button */
.auth-submit {
  position: relative;
  width: 100%;
  height: 45px;
  border: 0;
  border-radius: var(--auth-input-radius);
  background: var(--auth-ink);
  color: #FFFFFF;
  font-family: var(--auth-sans);
  font-size: 14.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
}

.auth-submit:hover { background: #1F242E; }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:disabled { opacity: 0.72; cursor: wait; }

.auth-btn-secondary {
  width: 100%;
  height: 43px;
  border: 1px solid var(--auth-rule-strong);
  border-radius: var(--auth-input-radius);
  background: #FFFFFF;
  color: var(--auth-ink);
  font-family: var(--auth-sans);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.auth-btn-secondary:hover {
  background: #F9FAFB;
  border-color: #9CA3AF;
}

.auth-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: auth-spin 0.65s linear infinite;
}

@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-legal {
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--auth-subtle);
  text-align: center;
}

.auth-legal a {
  color: var(--auth-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-legal a:hover { color: var(--auth-ink); }

.auth-bottom-note {
  text-align: center;
  font-size: 12.5px;
  color: var(--auth-subtle);
  margin-top: 20px;
}

.auth-verify-email {
  display: inline-block;
  font-family: var(--auth-mono);
  font-size: 13px;
  color: var(--auth-ink);
  background: #F3F4F6;
  border: 1px solid var(--auth-rule);
  padding: 4px 10px;
  border-radius: 6px;
  margin-top: 6px;
}

.auth-verify-tips {
  margin: 18px 0;
  padding: 14px 16px;
  background: #F9FAFB;
  border: 1px solid var(--auth-rule);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--auth-muted);
}

.auth-verify-tips ul {
  margin: 6px 0 0 18px;
  padding: 0;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
  .auth-rail {
    display: none;
  }
  .auth-mobile-brand {
    display: inline-flex;
  }
  .auth-back-link--desktop {
    display: none;
  }
}

@media (max-width: 480px) {
  .auth-row-2,
  .auth-oauth-grid {
    grid-template-columns: 1fr;
  }
}
