/* ==========================================================
   Project Beacon — style.css
   Dark theme, mobile-first, no frameworks.
   ========================================================== */

/* ----------------------------------------------------------
   THEME TOKENS
   ---------------------------------------------------------- */
:root {
  --bg: #0d1117;
  --surface: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #2f81f7;
  --success: #3fb950;
  --warning: #d29922;
  --danger: #f85149;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --radius: 6px;
  --max-w: 1100px;
  --header-h: 56px;
}

/* ----------------------------------------------------------
   RESET & BASE
   ---------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Visible focus for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

/* ----------------------------------------------------------
   UTILITIES
   ---------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1rem;
}

.section {
  padding: 3rem 0;
}

.section-alt {
  background: var(--surface);
}

.section h2 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.section-desc {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.section h2 + .section-desc {
  margin-top: 0.25rem;
}

/* ----------------------------------------------------------
   BUTTONS
   ---------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-align: center;
  min-height: 44px;
  line-height: 1.4;
  transition: background 0.15s ease;
}

.btn:hover,
.btn:focus-visible {
  background: #1a6fe0;
  text-decoration: none;
}

.btn-sm {
  padding: 0.375rem 1rem;
  min-height: 36px;
}

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

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

.btn-outline:hover,
.btn-outline:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  background: transparent;
}

/* ----------------------------------------------------------
   HEADER
   ---------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo:hover {
  text-decoration: none;
  color: var(--accent);
}

.logo-icon {
  color: var(--accent);
  font-size: 1rem;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-list a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.25rem 0;
}

.nav-list a:hover {
  color: var(--text);
  text-decoration: none;
}

/* Hide nav text on very small screens, keep ticket button */
@media (max-width: 599px) {
  .nav-list {
    gap: 0.75rem;
  }

  .nav-list li:not(:last-child) {
    display: none;
  }
}

/* ----------------------------------------------------------
   PROJECT CALENDAR TIMELINE
   ---------------------------------------------------------- */
.calendar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  overflow: hidden;
}

.calendar-track {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem 1rem;
  max-width: var(--max-w);
  margin: 0 auto;
}

/* Hide scrollbar but keep functionality */
.calendar-track::-webkit-scrollbar { height: 4px; }
.calendar-track::-webkit-scrollbar-track { background: transparent; }
.calendar-track::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.milestone {
  flex: 1 0 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.5rem 0.75rem;
  position: relative;
  scroll-snap-align: start;
  min-width: 140px;
}

/* Connecting line between milestones */
.milestone::before {
  content: "";
  position: absolute;
  top: 11px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
}

.milestone:first-child::before { left: 50%; }
.milestone:last-child::before { right: 50%; }

/* Dot marker */
.milestone-dot {
  position: relative;
  z-index: 1;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

/* Complete: filled dot with check */
.milestone[data-status="complete"] .milestone-dot {
  background: var(--success);
  border-color: var(--success);
}

.milestone[data-status="complete"] .milestone-dot::after {
  content: "\2713";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

/* Next upcoming: accent ring */
.milestone[data-status="next"] .milestone-dot {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.25);
  background: var(--accent);
}

.milestone[data-status="next"] .milestone-dot::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
}

/* Upcoming: open circle */
.milestone[data-status="upcoming"] .milestone-dot {
  border-color: var(--text-muted);
}

/* T-minus badge */
.milestone-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  margin-top: 0.5rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: rgba(139, 148, 158, 0.12);
  color: var(--text-muted);
}

.milestone[data-status="complete"] .milestone-badge {
  background: rgba(63, 185, 80, 0.12);
  color: var(--success);
}

.milestone[data-status="next"] .milestone-badge {
  background: rgba(47, 129, 247, 0.15);
  color: var(--accent);
}

/* Milestone name */
.milestone h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  margin-top: 0.375rem;
  line-height: 1.3;
  color: var(--text);
}

.milestone[data-status="complete"] h3 {
  color: var(--text-muted);
}

.milestone[data-status="next"] h3 {
  color: var(--accent);
}

/* Date */
.milestone time {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}

/* Connecting line turns green for completed segments */
.milestone[data-status="complete"]::before {
  background: var(--success);
}

/* The milestone right after the last complete one needs a gradient line */
.milestone[data-status="complete"] + .milestone[data-status="next"]::before,
.milestone[data-status="complete"] + .milestone[data-status="upcoming"]::before {
  background: linear-gradient(to right, var(--success), var(--border));
}

/* Desktop: no scroll needed, fit all inline */
@media (min-width: 900px) {
  .milestone {
    flex: 1 1 0;
    min-width: 0;
  }

  .calendar-track {
    overflow-x: visible;
    padding: 0.5rem 2rem;
  }
}

@media (min-width: 600px) {
  .calendar {
    padding: 1.5rem 0;
  }
}

/* ----------------------------------------------------------
   HERO STATUS BANNER
   ---------------------------------------------------------- */
.hero {
  padding: 2.5rem 0 2rem;
}

.status-banner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid;
}

.status-banner.status-ok {
  background: rgba(63, 185, 80, 0.08);
  border-color: rgba(63, 185, 80, 0.3);
}

.status-banner.status-warning {
  background: rgba(210, 153, 34, 0.08);
  border-color: rgba(210, 153, 34, 0.3);
}

.status-banner.status-danger {
  background: rgba(248, 81, 73, 0.08);
  border-color: rgba(248, 81, 73, 0.3);
}

.status-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 0.125rem;
}

.status-ok .status-icon { color: var(--success); }
.status-warning .status-icon { color: var(--warning); }
.status-danger .status-icon { color: var(--danger); }

.status-banner h1 {
  font-size: 1.25rem;
  line-height: 1.4;
}

.status-banner p {
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.hero-subtitle {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* ----------------------------------------------------------
   SERVICE STATUS GRID
   ---------------------------------------------------------- */
.status-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.status-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Status colours — always paired with text label */
[data-status="ok"] .status-dot { background: var(--success); }
[data-status="ok"] .status-label { color: var(--success); }

[data-status="warning"] .status-dot { background: var(--warning); }
[data-status="warning"] .status-label { color: var(--warning); }

[data-status="danger"] .status-dot { background: var(--danger); }
[data-status="danger"] .status-label { color: var(--danger); }

.status-card h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.status-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

@media (min-width: 600px) {
  .status-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .status-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ----------------------------------------------------------
   KNOWN ISSUES
   ---------------------------------------------------------- */
.issues-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.issue-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.section-alt .issue-card {
  background: var(--bg);
}

.issue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.issue-severity {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

[data-severity="danger"] .issue-severity { color: var(--danger); }
[data-severity="warning"] .issue-severity { color: var(--warning); }
[data-severity="low"] .issue-severity { color: var(--text-muted); }

.issue-header time {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.issue-card h3 {
  font-size: 1rem;
  margin-bottom: 0.375rem;
}

.issue-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ----------------------------------------------------------
   SELF-SERVICE GUIDES
   ---------------------------------------------------------- */
.guides-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.guide-link {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 500;
  transition: border-color 0.15s ease;
  min-height: 44px;
}

.guide-link:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.guide-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

@media (min-width: 600px) {
  .guides-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ----------------------------------------------------------
   COMMUNICATIONS TIMELINE
   ---------------------------------------------------------- */
.comms-timeline {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.comms-entry {
  position: relative;
  padding-left: 1.5rem;
  border-left: 2px solid var(--border);
}

.comms-entry time {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.comms-entry h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.comms-entry p {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ----------------------------------------------------------
   FAQ (native <details>)
   ---------------------------------------------------------- */
.faq-list {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.faq-item summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 44px;
}

/* Custom expand indicator */
.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-muted);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "\2212"; /* minus sign */
}

/* Remove default marker in all browsers */
.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-answer {
  padding: 0 1.25rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* ----------------------------------------------------------
   FOOTER
   ---------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ----------------------------------------------------------
   FORM PAGES
   ---------------------------------------------------------- */
.page-header {
  padding: 2rem 0 1rem;
}

.page-header h1 {
  font-size: 1.5rem;
}

.page-header p {
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-section h2 {
  font-size: 1.125rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label,
.form-group > .form-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.375rem;
}

.form-hint {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.9375rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 44px;
  transition: border-color 0.15s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(47, 129, 247, 0.25);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%238b949e' d='M1.4 0L6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

/* Radio and checkbox groups */
.radio-group,
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.radio-option,
.checkbox-option {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  min-height: 44px;
  transition: border-color 0.15s ease;
}

.radio-option:hover,
.checkbox-option:hover {
  border-color: var(--accent);
}

.radio-option input,
.checkbox-option input {
  margin-top: 0.1875rem;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.option-text {
  display: flex;
  flex-direction: column;
}

.option-text .option-label {
  font-weight: 500;
}

.option-text .option-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Character counter */
.char-count {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.char-count.over-limit {
  color: var(--danger);
}

/* Form actions */
.form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.5rem;
}

/* Validation feedback */
.form-group input:invalid:not(:placeholder-shown),
.form-group textarea:invalid:not(:placeholder-shown) {
  border-color: var(--danger);
}

.form-error {
  font-size: 0.8125rem;
  color: var(--danger);
  margin-top: 0.25rem;
}

/* Error alert bar */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}

.alert-danger {
  background: rgba(248, 81, 73, 0.08);
  border-color: rgba(248, 81, 73, 0.3);
  color: var(--danger);
}

.alert-success {
  background: rgba(63, 185, 80, 0.08);
  border-color: rgba(63, 185, 80, 0.3);
  color: var(--success);
}

/* ----------------------------------------------------------
   THANKS PAGE
   ---------------------------------------------------------- */
.thanks-page {
  min-height: calc(100vh - var(--header-h) - 100px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
}

.thanks-content {
  max-width: 520px;
}

.thanks-icon {
  font-size: 3rem;
  color: var(--success);
  margin-bottom: 1rem;
}

.thanks-content h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.thanks-content p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.thanks-content .btn {
  margin-top: 0.5rem;
}

/* ----------------------------------------------------------
   RESPONSIVE BREAKPOINTS
   ---------------------------------------------------------- */

/* 600px — tablet */
@media (min-width: 600px) {
  .container {
    padding: 0 1.5rem;
  }

  .section {
    padding: 4rem 0;
  }

  .section h2 {
    font-size: 1.75rem;
  }

  .hero {
    padding: 3rem 0 2.5rem;
  }

  .status-banner h1 {
    font-size: 1.5rem;
  }

  .form-section {
    padding: 2rem;
  }
}

/* 900px — desktop */
@media (min-width: 900px) {
  .container {
    padding: 0 2rem;
  }

  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .form-row .form-group {
    margin-bottom: 0;
  }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}
