/* ============================================================
   CrewBench — main stylesheet
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:       #1d9e75;
  --green-dark:  #0f6e56;
  --green-light: #e1f5ee;
  --red:         #e24b4a;
  --red-light:   #fcebeb;
  --amber:       #ba7517;
  --amber-light: #faeeda;
  --blue:        #185fa5;
  --blue-light:  #e6f1fb;
  --gray-50:     #f9f9f9;
  --gray-100:    #f0f0f0;
  --gray-400:    #888;
  --gray-700:    #444;
  --gray-900:    #1a1a1a;
  --radius:      8px;
  --radius-lg:   12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--gray-900);
  background: var(--gray-50);
}

/* ---- Nav ---- */
.navbar {
  background: #fff;
  border-bottom: 1px solid var(--gray-100);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.nav-brand {
  font-size: 17px;
  font-weight: 600;
  color: var(--green-dark);
  text-decoration: none;
  letter-spacing: -0.3px;
}
.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a { color: var(--gray-700); text-decoration: none; font-size: 14px; }
.nav-links a:hover { color: var(--green-dark); }

/* ---- Layout ---- */
.main-content { max-width: 860px; margin: 0 auto; padding: 32px 24px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 16px; }
.page-header h1 { font-size: 22px; font-weight: 600; }
.page-subtitle { font-size: 14px; color: var(--gray-400); margin-top: 4px; }

/* ---- Flash messages ---- */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: 14px; }
.flash-notice { background: var(--green-light); color: var(--green-dark); }
.flash-alert  { background: var(--red-light);   color: var(--red); }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.1s;
}
.btn-primary        { background: var(--green); color: #fff; border-color: var(--green); }
.btn-primary:hover  { background: var(--green-dark); }
.btn-secondary      { background: #fff; color: var(--gray-700); border-color: var(--gray-100); }
.btn-secondary:hover{ background: var(--gray-50); }
.btn-danger         { background: var(--red); color: #fff; }
.btn-danger-outline { background: transparent; color: var(--red); border-color: var(--red); }
.btn-confirm        { background: var(--green-light); color: var(--green-dark); border-color: var(--green-light); font-size: 13px; padding: 5px 12px; }
.btn-current        { background: var(--gray-100); color: var(--gray-400); cursor: default; }
.btn-upgrade        { background: var(--amber-light); color: var(--amber); border-color: var(--amber-light); }
.btn-sm             { padding: 5px 10px; font-size: 13px; }

/* ---- Trip cards ---- */
.trip-list { display: flex; flex-direction: column; gap: 10px; }
.trip-card {
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.15s;
}
.trip-card:hover { border-color: var(--green); }
.trip-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.trip-route       { font-size: 16px; font-weight: 600; }
.trip-card-meta   { font-size: 13px; color: var(--gray-400); margin-bottom: 8px; display: flex; gap: 12px; }
.trip-card-responses { display: flex; gap: 12px; font-size: 13px; }
.resp-available   { color: var(--green-dark); }
.resp-pending     { color: var(--amber); }
.resp-unavailable { color: var(--red); }

/* ---- Status badges ---- */
.badge-open        { background: var(--blue-light);  color: var(--blue);       padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-filled      { background: var(--green-light); color: var(--green-dark); padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-cancelled   { background: var(--gray-100);    color: var(--gray-400);   padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-available   { background: var(--green-light); color: var(--green-dark); padding: 2px 8px; border-radius: 20px; font-size: 12px; }
.badge-pending     { background: var(--amber-light); color: var(--amber);      padding: 2px 8px; border-radius: 20px; font-size: 12px; }
.badge-unavailable { background: var(--red-light);   color: var(--red);        padding: 2px 8px; border-radius: 20px; font-size: 12px; }

/* ---- Response stats ---- */
.response-stats { display: flex; gap: 12px; margin-bottom: 24px; }
.stat { flex: 1; background: #fff; border: 1px solid var(--gray-100); border-radius: var(--radius); padding: 14px; text-align: center; }
.stat-number { font-size: 28px; font-weight: 600; }
.stat-label  { font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.stat-available .stat-number   { color: var(--green-dark); }
.stat-pending .stat-number     { color: var(--amber); }
.stat-unavailable .stat-number { color: var(--red); }

/* ---- Response rows ---- */
.response-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}
.response-row:last-child { border-bottom: none; }
.response-pilot  { display: flex; align-items: center; gap: 10px; flex: 1; }
.response-status { display: flex; align-items: center; gap: 8px; }
.response-time   { font-size: 12px; color: var(--gray-400); }
.response-actions { min-width: 80px; text-align: right; }
.pilot-initials  { width: 36px; height: 36px; border-radius: 50%; background: var(--blue-light); color: var(--blue); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.pilot-name      { font-weight: 500; font-size: 14px; display: block; }
.pilot-ratings   { font-size: 12px; color: var(--gray-400); }

/* ---- Confirmed banner ---- */
.confirmed-banner {
  background: var(--green-light);
  color: var(--green-dark);
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
}

/* ---- Notify section ---- */
.notify-section  { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--gray-100); }
.notify-section h2 { font-size: 16px; margin-bottom: 14px; }
.pilot-checkboxes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.pilot-checkbox-label { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 8px; border-radius: var(--radius); border: 1px solid var(--gray-100); background: #fff; }
.pilot-checkbox-label:hover { border-color: var(--green); }
.pilot-checkbox-label input { margin: 0; }

/* ---- Usage bar ---- */
.usage-bar {
  background: var(--amber-light);
  color: var(--amber);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.usage-bar a { color: var(--amber); font-weight: 500; }

/* ---- Forms ---- */
.form { max-width: 520px; }
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-size: 13px; font-weight: 500; color: var(--gray-700); margin-bottom: 6px; }
.form-input { width: 100%; padding: 9px 12px; border: 1px solid var(--gray-100); border-radius: var(--radius); font-size: 14px; color: var(--gray-900); background: #fff; }
.form-input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(29,158,117,0.12); }
.form-hint  { font-size: 12px; color: var(--gray-400); margin-top: 4px; display: block; }
.form-errors { background: var(--red-light); color: var(--red); padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; font-size: 13px; }
.form-actions { display: flex; gap: 10px; margin-top: 24px; }

/* ---- Bench pilots ---- */
.pilot-list    { display: flex; flex-direction: column; gap: 8px; }
.pilot-card    { background: #fff; border: 1px solid var(--gray-100); border-radius: var(--radius-lg); padding: 14px 18px; display: flex; align-items: center; gap: 14px; }
.pilot-card.pilot-inactive { opacity: 0.5; }
.pilot-info    { flex: 1; }
.pilot-contact { font-size: 12px; color: var(--gray-400); display: block; }
.pilot-actions { display: flex; gap: 8px; }

/* ---- Pricing ---- */
.billing-toggle { display: flex; gap: 6px; margin-bottom: 24px; }
.toggle-btn { padding: 7px 16px; border-radius: var(--radius); border: 1px solid var(--gray-100); background: #fff; cursor: pointer; font-size: 14px; color: var(--gray-700); }
.toggle-btn.active { background: var(--green); color: #fff; border-color: var(--green); }
.save-badge { background: var(--amber-light); color: var(--amber); font-size: 11px; padding: 1px 6px; border-radius: 20px; margin-left: 6px; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 32px; }
.pricing-card { background: #fff; border: 1px solid var(--gray-100); border-radius: var(--radius-lg); padding: 24px; position: relative; }
.pricing-card-featured { border: 2px solid var(--green); }
.pricing-card-badge { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--green); color: #fff; font-size: 11px; font-weight: 500; padding: 2px 12px; border-radius: 20px; white-space: nowrap; }
.pricing-card-header h2 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.price-amount { font-size: 28px; font-weight: 700; }
.price-period { font-size: 14px; font-weight: 400; color: var(--gray-400); }
.price-saving { font-size: 12px; color: var(--green-dark); display: block; margin-top: 2px; }
.pricing-features { list-style: none; margin: 16px 0; font-size: 14px; }
.pricing-features li { padding: 5px 0; border-bottom: 1px solid var(--gray-100); }
.pricing-features li::before { content: "✓ "; color: var(--green); font-weight: 600; }
.pricing-features li:last-child { border-bottom: none; }
.pricing-actions { margin-top: 16px; }
.plan-status-card { background: #fff; border: 1px solid var(--gray-100); border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: 24px; }
.plan-status-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.plan-badge { font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 20px; }
.plan-badge-free  { background: var(--gray-100);    color: var(--gray-700); }
.plan-badge-pro   { background: var(--green-light); color: var(--green-dark); }
.plan-badge-scale { background: var(--blue-light);  color: var(--blue); }
.billing-interval { font-size: 12px; color: var(--gray-400); margin-left: 8px; }
.cancellation-notice { font-size: 13px; color: var(--amber); }
.cancel-section { padding-top: 24px; border-top: 1px solid var(--gray-100); font-size: 14px; color: var(--gray-400); }
.cancel-section p { margin-bottom: 12px; }

/* ---- Respond page (pilot magic link) ---- */
.respond-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--gray-50); }
.respond-card { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--gray-100); padding: 32px; max-width: 440px; width: 100%; }
.respond-header h1 { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.respond-header p  { color: var(--gray-400); font-size: 14px; margin-bottom: 20px; }
.trip-details { background: var(--gray-50); border-radius: var(--radius); padding: 16px; margin-bottom: 24px; }
.trip-detail-row { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--gray-100); font-size: 14px; }
.trip-detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--gray-400); min-width: 70px; }
.detail-value { font-weight: 500; }
.respond-buttons { display: flex; flex-direction: column; gap: 10px; }
.btn-respond { width: 100%; padding: 14px; border-radius: var(--radius); font-size: 16px; font-weight: 600; cursor: pointer; border: none; }
.btn-available   { background: var(--green);   color: #fff; }
.btn-unavailable { background: var(--gray-100); color: var(--gray-700); }
.respond-footer { font-size: 12px; color: var(--gray-400); text-align: center; margin-top: 16px; }

/* ---- Result pages ---- */
.respond-card-result { text-align: center; }
.result-icon { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; margin: 0 auto 16px; }
.result-available   { background: var(--green-light); color: var(--green-dark); }
.result-unavailable { background: var(--red-light);   color: var(--red); }

/* ---- Empty states ---- */
.empty-state { text-align: center; padding: 48px 24px; color: var(--gray-400); }
.empty-state p { margin-bottom: 16px; }
.empty-state-small { color: var(--gray-400); font-size: 14px; padding: 12px 0; }

/* ---- Section headers ---- */
.section-header { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 12px; }
.section-header h2 { font-size: 16px; font-weight: 600; }

/* ---- Trip notes ---- */
.trip-notes { background: var(--gray-50); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px; font-size: 14px; color: var(--gray-700); }
.hint-text { font-size: 13px; color: var(--gray-400); }

/* ---- Plan detail ---- */
.plan-detail { font-size: 14px; color: var(--gray-700); }

@media (max-width: 600px) {
  .main-content { padding: 16px; }
  .response-stats { flex-wrap: wrap; }
  .stat { min-width: 80px; }
  .trip-card-meta { flex-direction: column; gap: 2px; }
}

.settings-section { max-width: 640px; }
.settings-section h2 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.settings-desc { font-size: 14px; color: var(--gray-400); margin-bottom: 20px; }
.ratings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 16px;
}

.badge-captain        { background: #E6F1FB; color: #0C447C; padding: 1px 8px; border-radius: 20px; font-size: 12px; }
.badge-first-officer  { background: #EEEDFE; color: #3C3489; padding: 1px 8px; border-radius: 20px; font-size: 12px; }
.badge-both           { background: #E1F5EE; color: #085041; padding: 1px 8px; border-radius: 20px; font-size: 12px; }
.inner-ratings  {margin-left: 5px;}

.pilot-checkbox-select-all {
  background: var(--gray-50);
  border-radius: var(--radius);
}
#notify-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.trip-card-past { opacity: 0.55; }
.badge-past { background: var(--gray-100); color: var(--gray-400); padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.show-all-row { text-align: center; margin-top: 20px; }
.edit-warning {
  background: var(--amber-light);
  color: var(--amber);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 18px;
}

/* ---- Landing page ---- */
.lp { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: #1a1a1a; }
.lp-nav { display: flex; justify-content: space-between; align-items: center; padding: 18px 8%; border-bottom: 1px solid #f0f0f0; background: #fff; }
.lp-brand { font-size: 20px; font-weight: 700; color: #0F6E56; letter-spacing: -0.5px; }
.lp-nav-links { display: flex; gap: 10px; }
.btn-lp-nav { padding: 8px 18px; border-radius: 8px; font-size: 14px; font-weight: 500; text-decoration: none; color: #444; border: 1px solid #e0e0e0; background: #fff; }
.btn-lp-nav.btn-lp-primary { background: #1D9E75; color: #fff; border-color: #1D9E75; }

.lp-hero { padding: 80px 8% 64px; text-align: center; }
.lp-tag { display: inline-block; background: #E1F5EE; color: #0F6E56; font-size: 13px; font-weight: 500; padding: 5px 16px; border-radius: 20px; margin-bottom: 24px; letter-spacing: 0.5px; }
.lp-hero h1 { font-size: 56px; font-weight: 700; line-height: 1.1; letter-spacing: -2px; margin-bottom: 22px; }
.lp-green { color: #1D9E75; }
.lp-hero p { font-size: 19px; color: #555; line-height: 1.7; margin-bottom: 36px; max-width: 640px; margin-left: auto; margin-right: auto; }
.lp-hero-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn-lp { display: inline-block; padding: 14px 30px; border-radius: 8px; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn-lp-primary { background: #1D9E75; color: #fff; }
.btn-lp-primary:hover { background: #0F6E56; }
.btn-lp-secondary { background: #fff; color: #444; border: 1px solid #e0e0e0; }
.btn-lp-outline { background: #fff; color: #1D9E75; border: 1.5px solid #1D9E75; display: block; text-align: center; }
.btn-lp-outline:hover { background: #E1F5EE; }

.lp-problem { background: #0F6E56; padding: 56px 8%; text-align: center; }
.lp-quote { font-size: 22px; font-style: italic; color: #fff; max-width: 700px; margin: 0 auto 12px; line-height: 1.6; }
.lp-attr { font-size: 14px; color: #9FE1CB; }

.lp-how { padding: 72px 8%; }
.lp-how h2 { font-size: 32px; font-weight: 700; text-align: center; margin-bottom: 44px; letter-spacing: -0.5px; }
.lp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.lp-step { background: #fff; border: 1px solid #f0f0f0; border-radius: 14px; padding: 32px 24px; text-align: center; }
.lp-step-num { width: 48px; height: 48px; border-radius: 12px; background: #E1F5EE; color: #0F6E56; font-size: 22px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.lp-step-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.lp-step-desc { font-size: 14px; color: #888; line-height: 1.6; }

.lp-why { background: #f9f9f9; padding: 72px 8%; border-top: 1px solid #f0f0f0; }
.lp-why h2 { font-size: 32px; font-weight: 700; text-align: center; margin-bottom: 40px; letter-spacing: -0.5px; }
.lp-features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.lp-feature { display: flex; gap: 16px; align-items: flex-start; background: #fff; border: 1px solid #f0f0f0; border-radius: 14px; padding: 24px; }
.lp-feature-icon { width: 40px; height: 40px; background: #E1F5EE; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lp-feature-title { font-size: 15px; font-weight: 600; margin-bottom: 5px; }
.lp-feature-desc { font-size: 14px; color: #888; line-height: 1.6; }

.lp-pricing { padding: 72px 8%; }
.lp-pricing h2 { font-size: 32px; font-weight: 700; text-align: center; margin-bottom: 10px; letter-spacing: -0.5px; }
.lp-pricing-sub { text-align: center; color: #888; font-size: 16px; margin-bottom: 40px; }
.lp-pricing-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 18px; }
.lp-pc { background: #fff; border: 1px solid #f0f0f0; border-radius: 16px; padding: 36px 28px; position: relative; }
.lp-pc-featured { border: 2px solid #1D9E75; }
.lp-pc-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: #1D9E75; color: #fff; font-size: 12px; font-weight: 600; padding: 3px 16px; border-radius: 20px; white-space: nowrap; }
.lp-pc-name { font-size: 13px; font-weight: 600; color: #888; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.lp-pc-price { font-size: 42px; font-weight: 700; letter-spacing: -1.5px; }
.lp-pc-period { font-size: 14px; color: #999; margin-bottom: 22px; }
.lp-pc-features { list-style: none; padding: 0; margin-bottom: 24px; }
.lp-pc-features li { font-size: 14px; color: #555; padding: 6px 0; border-bottom: 1px solid #f5f5f5; }
.lp-pc-features li::before { content: "✓ "; color: #1D9E75; font-weight: 700; }
.lp-pc-features li:last-child { border-bottom: none; }
.lp-annual-note { text-align: center; font-size: 14px; color: #888; margin-top: 14px; }

.lp-footer { padding: 28px 8%; border-top: 1px solid #f0f0f0; display: flex; gap: 24px; align-items: center; font-size: 14px; color: #999; }
.lp-footer a { color: #555; text-decoration: none; }
.lp-footer a:hover { color: #1D9E75; }

@media (max-width: 900px) {
  .lp-steps { grid-template-columns: 1fr; }
  .lp-features { grid-template-columns: 1fr; }
  .lp-pricing-cards { grid-template-columns: 1fr; }
}

.lp-hero { position: relative; overflow: hidden; padding: 120px 8% 80px; text-align: center; }
.lp-hero-video-wrap { position: absolute; inset: 0; z-index: 0; }
.lp-hero-video { width: 100%; height: 100%; object-fit: cover; }
.lp-hero-overlay { position: absolute; inset: 0; background: rgba(10, 40, 30, 0.65); }
.lp-hero-content { position: relative; z-index: 1; }
.lp-hero h1 { color: #fff; }
.lp-hero p { color: rgba(255,255,255,0.85); }

/* ---- Auth pages ---- */
.lp-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f9f9f9; padding: 24px; }
.lp-auth-card { background: #fff; border: 1px solid #f0f0f0; border-radius: 16px; padding: 40px; width: 100%; max-width: 440px; }
.lp-auth-header { text-align: center; margin-bottom: 28px; }
.lp-auth-header .lp-brand { display: block; font-size: 22px; font-weight: 700; color: #0F6E56; text-decoration: none; margin-bottom: 16px; }
.lp-auth-header h1 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.lp-auth-header p { font-size: 14px; color: #888; }
.lp-auth-switch { text-align: center; font-size: 13px; color: #888; margin-top: 16px; }
.lp-auth-switch a { color: #1D9E75; text-decoration: none; font-weight: 500; }