/* CasePreparation app - shared styles */

:root {
  --navy: #0b2a3c;
  --navy-raised: #0f3549;
  --teal: #2ab7a9;
  --teal-dim: #1e8b81;
  --text: #eaf2f6;
  --muted: #9fb8c4;
  --line: rgba(255, 255, 255, 0.10);
  --danger: #e2705f;
  --radius: 10px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--navy);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

a { color: var(--teal); }

/* ---------- Wordmark ---------- */

.wordmark {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark span { color: var(--teal); }

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.user-box {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--muted);
  min-width: 0;
}
.user-box .email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

/* ---------- Layout ---------- */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.page-head { margin-bottom: 36px; }
.page-head h1 { font-size: 30px; }
.page-head p {
  color: var(--muted);
  margin: 8px 0 0;
  font-size: 15px;
}

/* ---------- Auth card ---------- */

.card {
  width: 100%;
  max-width: 420px;
  background: var(--navy-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
}
.card h1 {
  font-size: 24px;
  margin-bottom: 4px;
}
.card .lead {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 24px;
}

.auth-wrap .wordmark {
  font-size: 24px;
  margin-bottom: 28px;
}

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  padding: 0 0 10px;
  cursor: pointer;
}
.tab[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--teal);
}

/* ---------- Form ---------- */

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  background: rgba(0, 0, 0, 0.20);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  padding: 11px 13px;
}
.field input:focus {
  outline: none;
  border-color: var(--teal);
}
.hint {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--teal);
  border: 1px solid var(--teal);
  border-radius: 8px;
  color: #06222f;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  padding: 11px 20px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn:hover:not(:disabled) { background: var(--teal-dim); border-color: var(--teal-dim); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-block { width: 100%; }

.btn-quiet {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  padding: 8px 14px;
}
.btn-quiet:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); border-color: var(--line); }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* ---------- Messages ---------- */

.msg {
  font-size: 14px;
  margin-top: 16px;
  padding: 11px 13px;
  border-radius: 8px;
  display: none;
}
.msg.show { display: block; }
.msg.error {
  background: rgba(226, 112, 95, 0.12);
  border: 1px solid rgba(226, 112, 95, 0.35);
  color: #f2b6ab;
}
.msg.ok {
  background: rgba(42, 183, 169, 0.12);
  border: 1px solid rgba(42, 183, 169, 0.35);
  color: #8fe0d6;
}

/* ---------- Module cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.module {
  background: var(--navy-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
}
.module .eyebrow {
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 12px;
}
.module h2 {
  font-size: 19px;
  margin-bottom: 8px;
}
.module p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 22px;
  flex: 1;
}

/* ---------- Boot state ---------- */

.booting {
  visibility: hidden;
}

@media (max-width: 800px) {
  .grid { grid-template-columns: 1fr; }
  .main { padding: 32px 20px 64px; }
  .page-head h1 { font-size: 26px; }
  .card { padding: 26px 22px; }
  .user-box .email { max-width: 130px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
