/* ===== Design tokens (colors, spacing, type) ===== */
:root {
  --navy-dark: #0d2345;
  --navy: #143d6b;
  --navy-darker: #1a1a2e;
  --teal: #028090;
  --teal-dark: #02666e;
  --ice: #caeaed;
  --ice-light: #e8f5f7;
  --ice-lightest: #f8fafc;
  --slate: #556677;
  --white: #ffffff;

  --radius: 12px;
  --shadow: 0 2px 10px rgba(13, 35, 69, 0.08);
  --shadow-hover: 0 6px 20px rgba(13, 35, 69, 0.14);

  font-family: -apple-system, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--navy-darker);
  background: var(--white);
  line-height: 1.5;
}

h1, h2, h3 {
  margin: 0 0 0.4em 0;
  font-weight: 700;
  color: var(--navy-dark);
}

p {
  margin: 0 0 1em 0;
}

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

/* ===== Layout helpers ===== */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-body {
  padding: 48px 0 80px;
}

/* ===== Top nav ===== */
.top-nav {
  background: var(--navy-dark);
  padding: 16px 0;
}

.top-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  color: var(--white);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.03em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  color: var(--ice);
  text-decoration: none;
  font-size: 14px;
}

.nav-links a:hover {
  color: var(--white);
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(160deg, var(--navy-dark), var(--navy-darker));
  color: var(--white);
  padding: 72px 0;
  text-align: center;
}

.hero h1 {
  color: var(--white);
  font-size: 40px;
  margin-bottom: 12px;
}

.hero .tagline {
  color: var(--ice);
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero .subtext {
  color: var(--ice-light);
  max-width: 480px;
  margin: 0 auto 32px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background: var(--teal);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--teal-dark);
}

.btn-secondary {
  background: var(--white);
  color: var(--teal-dark);
  border: 1px solid var(--ice);
}

.btn-secondary:hover {
  background: var(--ice-lightest);
}

.btn-block {
  display: block;
  width: 100%;
}

/* ===== Cards ===== */
.card {
  background: var(--white);
  border: 1px solid var(--ice);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

/* ===== Forms ===== */
.field {
  margin-bottom: 20px;
}

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

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--ice);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: var(--navy-darker);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.form-card {
  max-width: 420px;
  margin: -40px auto 0;
  position: relative;
}

/* ===== Section on light background ===== */
.section-light {
  background: var(--ice-lightest);
  padding: 48px 0;
}

/* ===== Teacher grid / cards ===== */
.teacher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.teacher-card {
  text-decoration: none;
  color: inherit;
  display: block;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ice);
  color: var(--navy-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 12px;
}

.teacher-name {
  font-weight: 700;
  color: var(--navy-dark);
}

.teacher-subject {
  color: var(--slate);
  font-size: 14px;
  margin-bottom: 10px;
}

.score-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.score-big {
  font-size: 22px;
  font-weight: 700;
  color: var(--teal-dark);
}

.review-count {
  font-size: 13px;
  color: var(--slate);
}

/* ===== Category rating bars ===== */
.rating-bar-row {
  display: grid;
  grid-template-columns: 160px 1fr 40px;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.rating-bar-label {
  font-size: 14px;
  color: var(--slate);
}

.rating-bar-track {
  background: var(--ice-light);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.rating-bar-fill {
  background: var(--teal);
  height: 100%;
  border-radius: 999px;
}

.rating-bar-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy-dark);
  text-align: right;
}

/* ===== Badges / notices ===== */
.badge {
  display: inline-block;
  background: var(--ice-light);
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.notice {
  background: var(--ice-light);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  color: var(--slate);
}

.notice strong {
  color: var(--navy-dark);
}

/* ===== Comments ===== */
.comment {
  border-top: 1px solid var(--ice);
  padding: 16px 0;
}

.comment:first-child {
  border-top: none;
}

.comment-meta {
  font-size: 13px;
  color: var(--slate);
  margin-bottom: 4px;
}

/* ===== Star input (rating form) ===== */
.star-input {
  display: flex;
  gap: 6px;
  font-size: 26px;
}

.star-input .star {
  cursor: pointer;
  color: var(--ice);
}

.star-input .star.filled {
  color: var(--teal);
}

/* ===== Nav dropdown (e.g. the home page "Log In" menu) ===== */
.dropdown {
  position: relative;
}

.dropdown-trigger {
  background: none;
  border: none;
  color: var(--ice);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.dropdown-trigger:hover {
  color: var(--white);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  min-width: 210px;
  padding: 8px;
  z-index: 10;
}

.dropdown-menu.open {
  display: block;
}

.dropdown-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--navy-darker);
  text-decoration: none;
  font-size: 14px;
}

.dropdown-menu a:hover {
  background: var(--ice-lightest);
}

/* ===== Admin data table ===== */
table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--ice-light);
  font-size: 14px;
}

table tr:last-child td {
  border-bottom: none;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--navy-dark);
  color: var(--ice);
  text-align: center;
  padding: 24px 0;
  font-size: 13px;
}

/* Shared school directory controls */
.school-picker-status { font-size:14px; line-height:1.5; color:var(--slate); margin:8px 0; }
.school-picker-detail { font-size:14px; font-weight:600; line-height:1.5; margin:8px 0; overflow-wrap:anywhere; }
.field select[size] { width:100%; max-width:100%; min-height:150px; padding:8px; }
.field select[size] option { padding:8px; white-space:normal; }
.field input[type="search"] { width:100%; margin-bottom:12px; }
.field select:focus-visible, .field input:focus-visible { outline:3px solid #3478c5; outline-offset:2px; }
