/* ─── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
  --navy:        #0d2233;
  --navy-mid:    #122b42;
  --blue:        #1e3d78;
  --teal:        #2ab4b4;
  --green:       #3ecf8e;
  --green-dim:   #2fa870;
  --white:       #ffffff;
  --off-white:   #f4f7fa;
  --text:        #1a2e40;
  --text-muted:  #5a7184;
  --border:      #d6e4ef;
  --card-bg:     #ffffff;
  --shadow-sm:   0 2px 8px rgba(13,34,51,0.08);
  --shadow-md:   0 6px 24px rgba(13,34,51,0.12);
  --radius:      10px;
  --radius-sm:   6px;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'DM Sans', sans-serif;
  --transition:  0.2s ease;
}

/* ─── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  background: var(--off-white);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* ─── Header ────────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--navy);
  border-bottom: 3px solid var(--teal);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  background: var(--green);
  border-radius: 50%;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--white);
  letter-spacing: 0.01em;
}

.btn-submit, .btn-back {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 20px;
  transition: background var(--transition), color var(--transition);
}

.btn-submit {
  background: var(--green);
  color: var(--navy);
}

.btn-submit:hover { background: var(--green-dim); }

.btn-back {
  background: transparent;
  color: var(--teal);
  border: 1px solid var(--teal);
}

.btn-back:hover {
  background: rgba(42,180,180,0.1);
}

/* ─── Main ──────────────────────────────────────────────────────────────────── */
.main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  width: 100%;
}

/* ─── Filter Bar ────────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.filter-select {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a7184' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.filter-select:focus {
  outline: none;
  border-color: var(--teal);
}

.filter-count {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ─── Cards Grid ────────────────────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 900px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 580px) {
  .cards-grid { grid-template-columns: 1fr; }
}

/* ─── Highlight Card ────────────────────────────────────────────────────────── */
.highlight-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--green);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeSlideIn 0.4s ease forwards;
  transition: box-shadow var(--transition), transform var(--transition);
}

.highlight-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

@keyframes fadeSlideIn {
  to { opacity: 1; transform: translateY(0); }
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.person-badge {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.person-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.week-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.card-section h4 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal);
  margin-bottom: 6px;
}

.card-section p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ─── Loading / Empty / Error States ───────────────────────────────────────── */
.loading-state,
.empty-state,
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.empty-icon { font-size: 2.5rem; }

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ─── Footer ────────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.35);
  text-align: center;
  font-size: 0.75rem;
  padding: 16px 24px;
  letter-spacing: 0.03em;
}

/* ─── Form Page ─────────────────────────────────────────────────────────────── */
.main--form {
  max-width: 680px;
}

.form-wrapper {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.form-header {
  background: var(--navy);
  padding: 28px 32px;
  border-bottom: 3px solid var(--teal);
}

.form-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--white);
  margin-bottom: 4px;
}

.form-subtitle {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.55);
  font-weight: 300;
}

.form-subtitle strong { color: var(--green); font-weight: 500; }

.form-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ─── Form Fields ───────────────────────────────────────────────────────────── */
.field-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.req { color: var(--teal); }

.optional-tag {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
  background: var(--off-white);
  padding: 2px 7px;
  border-radius: 10px;
}

.field-input {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--off-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  transition: border-color var(--transition), background var(--transition);
  width: 100%;
}

.field-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}

.field-select { appearance: none; cursor: pointer; }

.field-input:focus {
  outline: none;
  border-color: var(--teal);
  background: var(--white);
}

.field-group.valid .field-input { border-color: var(--green); }
.field-group.invalid .field-input { border-color: #e05c5c; }

.field-check {
  position: absolute;
  right: 12px;
  top: 34px;
  color: var(--green);
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.field-group.valid .field-check { opacity: 1; }

.field-error {
  font-size: 0.78rem;
  color: #e05c5c;
  min-height: 1em;
}

.char-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
}

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-primary {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--green);
  color: var(--navy);
  border: none;
  border-radius: 6px;
  padding: 11px 28px;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
}

.btn-primary:hover:not(:disabled) { background: var(--green-dim); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-secondary {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--off-white);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 10px 20px;
  cursor: pointer;
  transition: border-color var(--transition);
}

.btn-secondary:hover { border-color: var(--teal); }

.btn-ghost {
  font-family: var(--font-body);
  font-size: 0.825rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

.btn-ghost:hover { color: var(--text); }

/* ─── Submit Error ──────────────────────────────────────────────────────────── */
.submit-error {
  background: #fff3f3;
  border: 1px solid #f5c6c6;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.875rem;
  color: #c0392b;
}

/* ─── Success Screen ────────────────────────────────────────────────────────── */
.success-screen {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 56px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: fadeSlideIn 0.5s ease forwards;
}

.success-icon {
  width: 64px;
  height: 64px;
  background: var(--green);
  color: var(--navy);
  border-radius: 50%;
  font-size: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.success-screen h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--navy);
}

.success-screen p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 360px;
}

.success-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
