/**
 * Auth screens — Rose & Slate (sms-design-system)
 */
:root {
  --rose-400: #e8608a;
  --rose-600: #c03060;
  --slate-50: #f5f4f9;
  --slate-100: #f0eef8;
  --slate-200: #e5e3ef;
  --slate-400: #a0a0b8;
  --slate-600: #6b6b80;
  --slate-900: #2d2d3e;
  --success-text: #2e7d32;
  --danger-text: #c62828;
  --auth-focus-ring: 0 0 0 3px rgba(232, 96, 138, 0.20);
  --auth-shadow-modal: 0 8px 32px rgba(45, 45, 62, 0.14), 0 2px 8px rgba(45, 45, 62, 0.08);
}

body.ui-body.auth-page-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--slate-50) !important;
  color: var(--slate-900);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
}

body.auth-page-body > .notifications {
  position: fixed;
  z-index: 10000;
}

.auth-page {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
}

/* Centered split panel (desktop) / single card (mobile) */
.auth-panel {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 0.5px solid var(--slate-200);
  border-radius: 16px;
  box-shadow: var(--auth-shadow-modal);
  overflow: hidden;
}

.auth-panel--split {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .auth-panel--split {
    grid-template-columns: 1.15fr 1fr;
    max-width: 920px;
    min-height: 520px;
  }
}

/* Left image — desktop only */
.auth-visual {
  display: none;
  position: relative;
  min-height: 280px;
  background: var(--slate-900);
  overflow: hidden;
}

@media (min-width: 900px) {
  .auth-panel--split .auth-visual {
    display: block;
    min-height: 100%;
  }
}

.auth-visual-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: blur(8px);
  transform: scale(1.06);
}

/* Form column */
.auth-form-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 32px 28px;
}

@media (min-width: 900px) {
  .auth-form-side {
    padding: 40px 36px;
  }
}

@media (max-width: 899px) {
  .auth-form-side {
    padding: 28px 24px;
  }
}

.auth-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin: 0 0 20px;
  display: block;
}

@media (min-width: 900px) {
  .auth-logo {
    width: 104px;
    height: 104px;
    margin-bottom: 24px;
  }
}

.auth-form-side form {
  width: 100%;
  max-width: 340px;
}

.auth-card-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--slate-900);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
  text-align: center;
  width: 100%;
}

.auth-card-subtitle {
  font-size: 14px;
  color: var(--slate-600);
  margin: 0 0 28px;
  text-align: center;
  width: 100%;
}

.auth-mode {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 340px;
  margin: -12px 0 24px;
  box-sizing: border-box;
}

button.auth-mode-btn {
  appearance: none;
  -webkit-appearance: none;
  flex: 1 1 0;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 0.5px solid #e5e3ef;
  background-color: #fff;
  background-image: none;
  color: #6b6b80;
  font-family: Inter, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: none;
}

button.auth-mode-btn:hover:not(.is-active) {
  background-color: #f5f4f9;
  color: #2d2d3e;
}

button.auth-mode-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(232, 96, 138, 0.20);
}

button.auth-mode-btn.is-active {
  background-color: #fce4ed;
  border-color: #fce4ed;
  color: #7a1a3c;
}

.auth-field {
  margin-bottom: 16px;
}

.auth-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-900);
  margin-bottom: 6px;
}

.auth-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 12px;
  background: #fff;
  border: 0.5px solid var(--slate-200);
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input-wrap:focus-within {
  border-color: var(--rose-400);
  box-shadow: var(--auth-focus-ring);
}

.auth-input-wrap i {
  color: var(--slate-400);
  font-size: 14px;
  flex-shrink: 0;
}

.auth-input-wrap input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--slate-900);
  font-family: inherit;
}

.auth-input-wrap input::placeholder {
  color: var(--slate-400);
}

.auth-toggle-password {
  cursor: pointer;
  color: var(--slate-400);
  font-size: 14px;
  flex-shrink: 0;
  padding: 4px;
  border: none;
  background: none;
}

.auth-toggle-password:hover {
  color: var(--slate-600);
}

.auth-btn {
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  background: var(--rose-400);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s;
}

.auth-btn:hover:not(:disabled) {
  background: var(--rose-600);
}

.auth-btn:focus-visible {
  outline: none;
  box-shadow: var(--auth-focus-ring);
}

.auth-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-btn.is-success {
  background: var(--success-text);
}

.auth-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  text-align: center;
}

.auth-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-600);
  text-decoration: none;
}

.auth-links a:hover {
  color: var(--rose-600);
}

/* OTP — simple centered card */
.auth-panel--otp {
  max-width: 420px;
}

.auth-otp-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 20px 0 8px;
}

.auth-otp-row input {
  width: 44px;
  height: 48px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  color: var(--slate-900);
  background: #fff;
  border: 0.5px solid var(--slate-200);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-otp-row input:focus {
  border-color: var(--rose-400);
  box-shadow: var(--auth-focus-ring);
}

.auth-error {
  display: none;
  margin-top: 8px;
  font-size: 13px;
  color: var(--danger-text);
  text-align: center;
}

.auth-callout {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 0.5px solid #ffcc80;
  background: #fff3e0;
  color: #e65100;
  font-size: 13px;
  line-height: 1.5;
}

.auth-field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--slate-400);
  line-height: 1.4;
}

/* ---- Teacher create-account wizard ---- */
body.ca-body {
  overflow-x: hidden;
}
.auth-page.ca-page {
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  padding: 16px;
  box-sizing: border-box;
  overflow-x: hidden;
}
@media (min-width: 640px) {
  .auth-page.ca-page { padding: 32px 16px; }
}
.auth-panel--wide,
.auth-page.ca-page .auth-panel.ca-shell {
  width: 100%;
  max-width: 560px;
  flex: 0 1 560px;
  margin: 0 auto;
  box-sizing: border-box;
  overflow: hidden;
}
.auth-form-side--wide {
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 20px 16px 24px;
  box-sizing: border-box;
}
@media (min-width: 640px) {
  .auth-form-side--wide { padding: 24px 28px 28px; }
}
.auth-form-side--wide form,
.ca-form,
.ca-shell-inner {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.ca-stepper { display: flex; gap: 4px; margin: 0 0 20px; overflow: hidden; padding-bottom: 0; }
.ca-step { flex: 1 1 0; min-width: 0; text-align: center; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--slate-400); background: none; border: none; font-family: inherit; padding: 0; }
.ca-step:focus-visible { outline: none; box-shadow: var(--auth-focus-ring); border-radius: 8px; }
.ca-step-dot { width: 28px; height: 28px; margin: 0 auto 6px; border-radius: 9999px; border: 0.5px solid var(--slate-200); background: #fff; color: var(--slate-600); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.ca-step.is-active { color: #7a1a3c; }
.ca-step.is-active .ca-step-dot { background: #fdf0f4; border-color: #f5b8d0; color: #7a1a3c; }
.ca-step.is-done { color: var(--slate-600); cursor: pointer; }
.ca-step.is-done .ca-step-dot { background: #e8f5e9; border-color: #a5d6a7; color: #2e7d32; }
.ca-step.has-error .ca-step-dot { border-color: #ef9a9a; color: #c62828; background: #fce4ec; }
.ca-panel { display: none; min-width: 0; }
.ca-panel.is-active { display: block; }
.ca-grid { display: grid; grid-template-columns: 1fr; gap: 16px; min-width: 0; }
@media (min-width: 640px) { .ca-grid-2 { grid-template-columns: 1fr 1fr; } }
.ca-field { min-width: 0; }
.ca-field label { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--slate-600); margin-bottom: 6px; }
.ca-field input, .ca-field select, .ca-field textarea { width: 100%; max-width: 100%; height: 38px; padding: 0 12px; border: 0.5px solid var(--slate-200); border-radius: 8px; font-size: 14px; font-family: inherit; color: var(--slate-900); background: #fff; box-sizing: border-box; }
.ca-field textarea { height: auto; min-height: 72px; padding: 10px 12px; }
.ca-field input:focus, .ca-field select:focus, .ca-field textarea:focus { outline: none; border-color: var(--rose-400); box-shadow: var(--auth-focus-ring); }
.ca-phone { display: flex; align-items: stretch; min-width: 0; width: 100%; }
.ca-phone-prefix { display: inline-flex; align-items: center; padding: 0 12px; border: 0.5px solid var(--slate-200); border-right: 0; border-radius: 8px 0 0 8px; background: var(--slate-50); color: var(--slate-600); font-size: 13px; font-weight: 500; flex-shrink: 0; }
.ca-phone input { border-radius: 0 8px 8px 0; flex: 1; min-width: 0; width: auto; }
.ca-phone.is-invalid .ca-phone-prefix,
.ca-phone.is-invalid input { border-color: #ef9a9a; }
.ca-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--slate-900); padding: 12px; border: 0.5px solid var(--slate-200); border-radius: 8px; background: var(--slate-50); margin-bottom: 16px; }
.ca-check input { accent-color: var(--rose-400); width: 16px; height: 16px; flex-shrink: 0; }
.ca-grade { border: 0.5px solid var(--slate-200); border-radius: 12px; background: #fff; margin-bottom: 8px; overflow: hidden; }
.ca-grade-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; cursor: pointer; user-select: none; }
.ca-grade-head:hover { background: var(--slate-50); }
.ca-grade-body { display: none; padding: 0 14px 14px; border-top: 0.5px solid var(--slate-200); }
.ca-grade.is-open .ca-grade-body { display: block; }
.ca-subj { padding: 10px 0; border-bottom: 0.5px solid var(--slate-100); }
.ca-subj:last-child { border-bottom: 0; }
.ca-subj-name { font-size: 13.5px; font-weight: 600; color: var(--slate-900); margin-bottom: 8px; }
.ca-secs { display: flex; flex-wrap: wrap; gap: 8px; }
.ca-secs label { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border: 0.5px solid var(--slate-200); border-radius: 8px; font-size: 12px; color: #50506a; cursor: pointer; text-transform: none; letter-spacing: 0; }
.ca-secs label:has(input:checked) { background: #fdf0f4; border-color: #f5b8d0; color: #7a1a3c; }
.ca-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 0.5px solid var(--slate-200); }
.ca-actions .auth-btn,
.ca-actions .ca-btn-ghost,
.ca-actions .ca-btn-continue { min-height: 44px; min-width: 0; }
.ca-btn-continue {
  flex: 1 1 140px;
  height: 44px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  border: 0.5px solid var(--slate-200);
  background: #fff;
  color: var(--slate-600);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ca-btn-continue:hover:not(:disabled) { background: var(--slate-50); }
.ca-btn-continue:focus-visible { outline: none; box-shadow: var(--auth-focus-ring); }
.ca-btn-create { flex: 1 1 160px; }
.ca-btn-ghost { height: 44px; min-height: 44px; padding: 0 16px; border-radius: 8px; border: 0.5px solid var(--slate-200); background: #fff; color: var(--slate-600); font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; justify-content: center; }
.ca-btn-ghost:hover:not(:disabled) { background: var(--slate-50); }
.ca-btn-ghost:focus-visible { outline: none; box-shadow: var(--auth-focus-ring); }
.ca-actions [hidden],
.auth-btn[hidden],
.ca-btn-ghost[hidden],
.ca-btn-continue[hidden] { display: none !important; }
.ca-btn-continue:disabled,
.ca-btn-ghost:disabled,
.auth-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.ca-review { background: var(--slate-50); border: 0.5px solid var(--slate-200); border-radius: 12px; padding: 16px; font-size: 13.5px; color: var(--slate-900); line-height: 1.5; overflow-wrap: anywhere; }
.ca-review h3 { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--slate-600); }
.ca-review dl { display: grid; grid-template-columns: 1fr; gap: 4px 12px; margin: 0 0 16px; }
@media (min-width: 640px) { .ca-review dl { grid-template-columns: 110px 1fr; } }
.ca-review dt { color: var(--slate-600); font-size: 12px; }
.ca-review dd { margin: 0; font-weight: 500; word-break: break-word; }
.ca-mono { font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace; font-size: 13px; }
.ca-success { text-align: center; padding: 8px 0 4px; }
.ca-success .ca-cred { margin: 16px 0; padding: 16px; border-radius: 12px; border: 0.5px solid #a5d6a7; background: #e8f5e9; color: #2e7d32; text-align: left; }
.ca-cred-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 0.5px solid #a5d6a7; }
.ca-cred-row:last-child { border-bottom: 0; padding-bottom: 0; }
.ca-cred-label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #2e7d32; }
.ca-banner { display: none; margin-bottom: 12px; padding: 12px 14px; border-radius: 8px; border: 0.5px solid #ffcc80; background: #fff3e0; color: #e65100; font-size: 13px; line-height: 1.5; }
.ca-banner.is-visible { display: block; }
.ca-banner--danger { border-color: #ef9a9a; background: #fce4ec; color: #c62828; }
.ca-muted { font-size: 13px; color: var(--slate-600); margin: 0 0 16px; }
.ca-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.ca-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; flex-shrink: 0; }
.ca-title { margin: 0; }
.ca-subtitle { margin: 4px 0 0; }
.ca-progress { height: 4px; background: var(--slate-100); border-radius: 9999px; margin: 0 0 16px; overflow: hidden; }
.ca-progress-bar { height: 100%; width: 20%; background: var(--rose-400); border-radius: 9999px; transition: width 0.2s ease; }
.ca-hint { display: block; margin-top: 6px; font-size: 12px; color: var(--slate-400); }
.ca-draft-note { font-size: 12px; color: var(--slate-600); margin: 0 0 12px; }
.ca-field--full { grid-column: 1 / -1; }
.ca-field input.input-error,
.ca-field select.input-error,
.ca-field textarea.input-error { border-color: #ef9a9a; }
.ca-field-error { display: block; margin-top: 6px; font-size: 12px; color: var(--danger-text); min-height: 0; }
.ca-banner--warn { border-color: #ffcc80; background: #fff3e0; color: #e65100; }
.ca-error-text { color: var(--danger-text); }
.ca-count { font-size: 12px; color: var(--slate-400); font-weight: 500; }
.ca-homeroom { margin-top: 16px; }
.ca-success-title { font-size: 20px; font-weight: 600; color: var(--slate-900); margin: 0 0 8px; }
.ca-success-btn { display: inline-flex; align-items: center; justify-content: center; margin-top: 8px; text-decoration: none; width: 100%; box-sizing: border-box; }
@media (max-width: 639px) {
  .ca-step-label { display: none; }
  .ca-step.is-active .ca-step-label { display: inline; }
  .ca-actions { flex-direction: column; }
  .ca-actions .ca-btn-ghost,
  .ca-actions .ca-btn-continue,
  .ca-actions .auth-btn { width: 100%; flex: 1 1 auto; }
}

