/* ==========================================================
   MEETINGTRIP — STYLE SHEET (V2, calculator edition)
   Token system: colors, type, spacing, then components
   ========================================================== */

:root{
  /* Color */
  --navy:        #0B1F3A;
  --charcoal:    #1C2733;
  --ink-soft:    #4B5A70;
  --bg:          #FFFFFF;
  --bg-subtle:   #F6F8FC;
  --bg-panel:    #F0F4FA;
  --border:      #E3E8F0;
  --blue:        #2B5FE0;
  --blue-deep:   #163E9E;
  --blue-tint:   #E9F0FE;
  --green:       #1C8A5A;
  --green-tint:  #E6F5EE;
  --amber:       #B4720A;
  --amber-tint:  #FBF0DE;
  --red:         #C13C3C;
  --red-tint:    #FBEAEA;

  /* Time zone bands (west -> east, deepening blue) */
  --tz-pt: #DCE8FD;
  --tz-mt: #C6DAFB;
  --tz-ct: #AFCBF8;
  --tz-et: #98BCF5;

  /* Type */
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Layout */
  --wrap: 1160px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(11,31,58,0.06);
  --shadow-md: 0 8px 24px rgba(11,31,58,0.08);
  --shadow-lg: 0 24px 60px rgba(11,31,58,0.12);
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin: 0;
  font-family: var(--font-body);
  color: var(--charcoal);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
ul, ol{ list-style: none; margin: 0; padding: 0; }
button{ font: inherit; cursor: pointer; }

h1, h2, h3{ font-family: var(--font-display); color: var(--navy); margin: 0; letter-spacing: -0.01em; }
h1{ font-size: clamp(2rem, 4vw, 2.9rem); line-height: 1.1; font-weight: 600; }
h2{ font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 600; }
h3{ font-size: 1.15rem; font-weight: 600; }

.wrap{ max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.skip-link{
  position: absolute; left: -999px; top: 0; background: var(--navy); color: #fff;
  padding: 10px 16px; z-index: 999; border-radius: 0 0 8px 0;
}
.skip-link:focus{ left: 0; }

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

.eyebrow{
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-deep);
  margin: 0 0 10px;
  font-weight: 500;
}

.section-head{ max-width: 620px; margin: 0 0 40px; }
.section-sub{ color: var(--ink-soft); font-size: 1rem; margin: 10px 0 0; }

/* Buttons */
.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: var(--radius-sm);
  padding: 13px 22px; font-weight: 600; font-size: 0.95rem;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.btn-primary{ background: var(--blue); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover{ background: var(--blue-deep); box-shadow: var(--shadow-md); }
.btn-primary:active{ transform: translateY(1px); }
.btn-outline{ background: #fff; color: var(--navy); border: 1px solid var(--border); }
.btn-outline:hover{ border-color: var(--blue); color: var(--blue-deep); }
.btn-small{ padding: 10px 16px; font-size: 0.88rem; }
.btn-full{ width: 100%; }

/* ============ HEADER ============ */
.site-header{
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner{ display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand{ display: flex; align-items: center; gap: 8px; color: var(--navy); }
.brand-mark{ color: var(--blue); display: inline-flex; }
.brand-name{ font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }

.main-nav{ display: flex; gap: 32px; }
.main-nav a{ font-size: 0.92rem; font-weight: 500; color: var(--ink-soft); }
.main-nav a:hover{ color: var(--navy); }

.header-actions{ display: flex; align-items: center; gap: 14px; }
.nav-toggle{
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 38px; height: 38px; background: none; border: 1px solid var(--border); border-radius: 8px;
}
.nav-toggle span{ width: 18px; height: 2px; background: var(--navy); margin: 0 auto; }

/* ============ HERO ============ */
.hero{ background: linear-gradient(180deg, var(--bg-subtle) 0%, var(--bg) 100%); padding: 64px 0 40px; }
.hero-inner{ display: grid; grid-template-columns: 1fr; gap: 36px; }
.hero-copy{ max-width: 680px; }
.hero-sub{ color: var(--ink-soft); font-size: 1.08rem; margin: 16px 0 0; max-width: 560px; }

.search-card{
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px; display: grid; gap: 18px;
  grid-template-columns: repeat(6, 1fr);
  align-items: start;
}
.field{ display: flex; flex-direction: column; gap: 8px; grid-column: span 3; }
.field-date{ grid-column: span 2; align-self: end; }
.field-time{ grid-column: span 2; }
.field-style{ grid-column: span 2; }
.field-airport{ grid-column: span 3; position: relative; }
.swap-btn{
  grid-column: span 6; justify-self: center;
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--bg-subtle); color: var(--blue-deep); display: none;
  align-items: center; justify-content: center;
}

.field label, .field-legend{ font-size: 0.8rem; font-weight: 600; color: var(--navy); }
.field-help{ font-size: 0.76rem; color: var(--ink-soft); line-height: 1.4; }
.field input[type="date"], .field input[type="time"], .field input[type="text"]{
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 0.95rem; font-family: var(--font-body); color: var(--charcoal);
  background: var(--bg-subtle); width: 100%;
}
.field input:focus{ background: #fff; border-color: var(--blue); }
.field input::placeholder{ color: #9AA6B8; opacity: 1; }

.airport-input{ position: relative; display: flex; align-items: center; }
.airport-input .field-icon{ position: absolute; left: 14px; color: var(--ink-soft); pointer-events: none; }
.airport-input input{ padding-left: 40px; }

.autocomplete-list{
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); max-height: 280px; overflow-y: auto;
}
.autocomplete-list li{
  padding: 10px 14px; font-size: 0.85rem; cursor: pointer; display: flex; justify-content: space-between; gap: 10px;
}
.autocomplete-list li:hover, .autocomplete-list li.is-active{ background: var(--blue-tint); }
.autocomplete-list .ac-code{ font-family: var(--font-mono); color: var(--blue-deep); font-weight: 600; flex-shrink: 0; }
.autocomplete-list .ac-name{ color: var(--ink-soft); font-size: 0.78rem; }

/* Segmented travel-style control */
.segmented{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.segmented-btn{
  border: 1px solid var(--border); background: var(--bg-subtle); border-radius: var(--radius-sm);
  padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--ink-soft); text-align: center;
}
.segmented-btn .seg-title{ font-weight: 600; font-size: 0.85rem; color: var(--navy); }
.segmented-btn .seg-sub{ font-size: 0.68rem; }
.segmented-btn.is-active{ background: var(--navy); border-color: var(--navy); }
.segmented-btn.is-active .seg-title, .segmented-btn.is-active .seg-sub{ color: #fff; }

.search-card .btn-full{ grid-column: span 6; margin-top: 4px; }

/* ============ TRAVEL PLAN RESULT ============ */
.travel-plan{ padding: 56px 0 72px; }

.result-hero{
  background: linear-gradient(135deg, var(--navy), #142A50); color: #fff;
  border-radius: var(--radius-lg); padding: 32px 36px; box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}
.result-hero-route{ display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.result-route-label{ font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.result-badge{
  font-size: 0.75rem; font-weight: 700; padding: 7px 14px; border-radius: 999px;
  background: var(--blue-tint); color: var(--blue-deep);
}
.result-badge.is-tight{ background: var(--amber-tint); color: var(--amber); }
.result-badge.is-alert{ background: var(--red-tint); color: var(--red); }
.result-badge.is-relaxed{ background: var(--green-tint); color: var(--green); }

.result-hero-grid{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.result-hero-stat{ display: flex; flex-direction: column; gap: 6px; }
.result-hero-stat.is-primary .result-stat-value{ font-size: 2.2rem; color: #fff; }
.result-stat-label{ font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: #8FA3C9; }
.result-stat-value{ font-family: var(--font-display); font-size: 1.55rem; font-weight: 700; color: #E7EEFC; }
.result-stat-sub{ font-size: 0.82rem; color: #B9C6DE; }

/* Day-before card */
.day-before-card{
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--amber-tint); border: 1px solid #F0DDB2; color: var(--amber);
  border-radius: var(--radius-md); padding: 18px 22px; margin-bottom: 20px;
}
.day-before-card[hidden]{ display: none; }
.day-before-card svg{ flex-shrink: 0; margin-top: 2px; }
.day-before-card h3{ font-size: 1rem; color: #8A5A08; margin: 0 0 4px; }
.day-before-card p{ margin: 0; font-size: 0.9rem; color: #7A5006; line-height: 1.5; }

/* Timeline */
.timeline-card{
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 30px 32px; box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.timeline-card h2{ margin-bottom: 22px; }
.timeline{ display: flex; flex-direction: column; }
.timeline-step{ display: grid; grid-template-columns: 28px 1fr; gap: 16px; position: relative; padding-bottom: 26px; }
.timeline-step:last-child{ padding-bottom: 0; }
.timeline-dot{
  width: 12px; height: 12px; border-radius: 50%; background: var(--blue); margin-top: 4px; position: relative; z-index: 1;
}
.timeline-step.is-endpoint .timeline-dot{ background: var(--navy); width: 14px; height: 14px; margin-top: 3px; }
.timeline-step:not(:last-child)::before{
  content: ''; position: absolute; left: 5px; top: 18px; bottom: 0; width: 2px; background: var(--border);
}
.timeline-step.is-endpoint:not(:last-child)::before{ left: 6px; }
.timeline-content{ display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; }
.timeline-title{ font-weight: 600; color: var(--navy); font-size: 0.95rem; }
.timeline-detail{ font-size: 0.82rem; color: var(--ink-soft); flex-basis: 100%; }
.timeline-time{ font-family: var(--font-mono); font-weight: 600; color: var(--blue-deep); font-size: 0.95rem; white-space: nowrap; }
.timeline-step.is-endpoint .timeline-time{ color: var(--navy); font-size: 1.1rem; }

/* Breakdown */
.breakdown-card{
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px 26px; margin-bottom: 18px;
}
.breakdown-card summary{
  cursor: pointer; font-weight: 600; color: var(--navy); font-size: 0.95rem; list-style: none;
  display: flex; align-items: center; justify-content: space-between;
}
.breakdown-card summary::-webkit-details-marker{ display: none; }
.breakdown-card summary::after{ content: '+'; font-size: 1.2rem; color: var(--blue); }
.breakdown-card[open] summary::after{ content: '−'; }
.breakdown-grid{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 24px; margin: 20px 0 14px; }
.breakdown-grid dt{ font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); margin-bottom: 4px; }
.breakdown-grid dd{ margin: 0; font-weight: 600; color: var(--navy); font-size: 0.95rem; }
.estimate-note{ font-size: 0.78rem; color: var(--ink-soft); margin: 10px 0 0; }

.disclaimer{ font-size: 0.78rem; color: var(--ink-soft); line-height: 1.5; max-width: 760px; margin: 0 0 26px; }

.result-actions{ display: flex; flex-wrap: wrap; gap: 12px; }

/* ============ TIME ZONES ============ */
.timezones{ padding: 24px 0 72px; background: var(--bg-subtle); }
.timezone-grid{ display: grid; grid-template-columns: 1.5fr 1fr; gap: 28px; align-items: start; }

.tz-map-wrap{
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.tz-map{ width: 100%; height: auto; display: block; }
.tz-band{ stroke: #fff; stroke-width: 2; transition: opacity .2s ease; }
.tz-band[data-zone="PT"]{ fill: var(--tz-pt); }
.tz-band[data-zone="MT"]{ fill: var(--tz-mt); }
.tz-band[data-zone="CT"]{ fill: var(--tz-ct); }
.tz-band[data-zone="ET"]{ fill: var(--tz-et); }
.tz-band.is-active{ opacity: 1; filter: brightness(0.94); }

.tz-label{ font-family: var(--font-display); font-size: 15px; font-weight: 600; fill: var(--navy); }
.tz-time{ font-family: var(--font-mono); font-size: 13px; fill: var(--blue-deep); }

#flight-arc{ animation: dash 26s linear infinite; }
@keyframes dash{ to{ stroke-dashoffset: -240; } }
#marker-from, #marker-to{ fill: var(--navy); stroke: #fff; stroke-width: 3; }
#marker-to{ fill: var(--blue); }

.tz-extra{ display: flex; gap: 18px; margin-top: 14px; flex-wrap: wrap; }
.tz-chip{ font-size: 0.85rem; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; }
.chip-dot{ width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--tz-mt); }
.chip-dot[data-zone="HI"]{ background: var(--tz-pt); }

.tz-compare-card{
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px; box-shadow: var(--shadow-sm); align-self: stretch;
  display: flex; flex-direction: column; gap: 18px;
}
.tz-compare-label{ font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-soft); margin: 0; }
.tz-compare-diff{
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 12px 0; font-size: 0.9rem; color: var(--ink-soft);
}
.tz-compare-diff strong{ color: var(--blue-deep); font-size: 1.3rem; font-family: var(--font-display); }
.tz-compare-note{ margin: 0; font-size: 0.95rem; color: var(--charcoal); line-height: 1.5; }

/* ============ HOW IT WORKS ============ */
.how-it-works{ padding: 72px 0 88px; }
.steps{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step{
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px;
}
.step-index{ font-family: var(--font-mono); color: var(--blue); font-size: 0.85rem; font-weight: 600; }
.step h3{ margin: 12px 0 8px; }
.step p{ color: var(--ink-soft); margin: 0; font-size: 0.92rem; }

/* ============ MODAL ============ */
.window-modal{
  border: none; border-radius: var(--radius-lg); padding: 0; max-width: 480px; width: calc(100% - 40px);
  box-shadow: var(--shadow-lg);
}
.window-modal::backdrop{ background: rgba(11,31,58,0.55); backdrop-filter: blur(2px); }
.modal-inner{ padding: 30px; position: relative; }
.modal-close{
  position: absolute; top: 16px; right: 16px; background: var(--bg-subtle); border: none;
  width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft);
}
.modal-inner h3{ margin-bottom: 10px; padding-right: 30px; }
.modal-inner p{ color: var(--ink-soft); font-size: 0.92rem; line-height: 1.5; margin: 0 0 16px; }
.modal-copy-block{
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; font-family: var(--font-mono); font-size: 0.8rem; color: var(--charcoal);
  white-space: pre-wrap; margin: 0 0 18px; line-height: 1.6;
}
.modal-actions{ display: flex; flex-wrap: wrap; gap: 10px; }
.copy-confirm{ display: block; margin-top: 12px; font-size: 0.82rem; color: var(--green); font-weight: 600; }
.copy-confirm[hidden]{ display: none; }

/* ============ FOOTER ============ */
.site-footer{ border-top: 1px solid var(--border); padding: 48px 0; background: var(--bg-subtle); }
.footer-inner{ display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: flex-start; }
.footer-brand p{ color: var(--ink-soft); margin: 6px 0 0; font-size: 0.9rem; }
.footer-nav{ display: flex; flex-wrap: wrap; gap: 18px; }
.footer-nav a{ font-size: 0.88rem; color: var(--ink-soft); }
.footer-nav a:hover{ color: var(--navy); }
.footer-copy{ width: 100%; color: var(--ink-soft); font-size: 0.8rem; margin: 24px 0 0; }

/* ============ RESPONSIVE ============ */
@media (max-width: 960px){
  .timezone-grid{ grid-template-columns: 1fr; }
  .result-hero-grid{ grid-template-columns: 1fr; gap: 16px; }
  .breakdown-grid{ grid-template-columns: repeat(2, 1fr); }
  .steps{ grid-template-columns: 1fr; }
}

@media (max-width: 720px){
  .main-nav{ position: absolute; top: 72px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--border);
    flex-direction: column; padding: 16px 24px; gap: 16px; display: none; }
  .main-nav.is-open{ display: flex; }
  .nav-toggle{ display: flex; }
  .header-actions .btn-small{ display: none; }

  .search-card{ grid-template-columns: 1fr 1fr; padding: 22px; }
  .field{ grid-column: span 2; }
  .field-date, .field-time, .field-style{ grid-column: span 2; }
  .field-airport{ grid-column: span 2; }
  .swap-btn{ display: flex; }
  .search-card .btn-full{ grid-column: span 2; }

  .result-hero{ padding: 26px; }
  .result-hero-stat.is-primary .result-stat-value{ font-size: 1.8rem; }
  .breakdown-grid{ grid-template-columns: 1fr; }
  .timeline-card{ padding: 24px 20px; }
  .result-actions .btn{ width: 100%; }
}
