/* ====================================================
   Flight Attendant Network — Global Styles
   ==================================================== */
:root {
  --navy:   #14213d;
  --blue:   #1f6fb2;
  --bluedk: #143d63;
  --gold:   #d9a441;
  --green:  #2e7d54;
  --red:    #b00020;
  --cloud:  #f4f7fb;
  --white:  #fff;
  --gray:   #dde6f0;
  --muted:  #5d6b82;
  --text:   #1f2933;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Outfit', system-ui, sans-serif; color: var(--text); background: var(--cloud); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Typography --- */
h1 { font-size: 1.9rem; }
h2 { font-size: 1.5rem; margin-bottom: .6rem; color: var(--navy); }
h3 { font-size: 1.2rem; margin-bottom: .4rem; color: var(--navy); }
p  { line-height: 1.6; margin-bottom: .75rem; }
ul, ol { margin: .5rem 0 .75rem 1.4rem; line-height: 1.6; }

/* --- Site nav bar --- */
.site-nav {
  background: var(--navy);
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  flex-wrap: wrap;
}
.site-nav .brand {
  font-family: Georgia, serif;
  color: var(--gold);
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 20px 14px 0;
  white-space: nowrap;
  letter-spacing: .5px;
}
.site-nav a.nav-link {
  color: rgba(255,255,255,.75);
  padding: 14px 12px;
  font-size: .87rem;
  font-weight: 600;
  white-space: nowrap;
  transition: color .15s;
}
.site-nav a.nav-link:hover, .site-nav a.nav-link.active { color: #fff; text-decoration: none; }
.site-nav .spacer { flex: 1; }
.site-nav .nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}
.site-nav .nav-user span { color: rgba(255,255,255,.6); font-size: .82rem; }
.btn-signout {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.35);
  color: #fff;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-signout:hover { background: rgba(255,255,255,.12); }

/* --- Page wrapper --- */
.page-wrap { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; }

/* --- Cards --- */
.card {
  background: var(--white);
  border: 1px solid var(--gray);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 2px 8px rgba(20,33,61,.06);
}
.card + .card { margin-top: 14px; }

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background .15s, color .15s;
}
.btn-primary  { background: var(--navy); color: #fff; }
.btn-primary:hover  { background: var(--blue); }
.btn-blue     { background: var(--blue); color: #fff; }
.btn-blue:hover     { background: var(--bluedk); }
.btn-green    { background: var(--green); color: #fff; }
.btn-ghost    { background: transparent; color: var(--blue); border: 1.5px solid var(--blue); }
.btn-ghost:hover    { background: var(--cloud); }
.btn-sm       { padding: 6px 14px; font-size: .85rem; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* --- Form fields --- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-size: .85rem; font-weight: 700; color: var(--text); }
.field input, .field select, .field textarea {
  border: 1.5px solid var(--gray);
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  width: 100%;
  outline: none;
  transition: border .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); }
.field textarea { resize: vertical; min-height: 80px; }
.error-msg { color: var(--red); font-size: .88rem; min-height: 1.1em; }
.field-note  { font-size: .8rem; color: var(--muted); }

/* --- Login / auth pages --- */
body.auth-page {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--navy);
}
.auth-box {
  background: var(--white);
  border-radius: 18px;
  padding: 44px 36px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 16px 48px rgba(0,0,0,.32);
}
.auth-box h1 { color: var(--navy); font-family: Georgia, serif; margin-bottom: 4px; }
.auth-subtitle { color: var(--muted); font-size: .95rem; margin-bottom: 28px; }
.auth-divider { border: none; border-top: 1px solid var(--gray); margin: 20px 0; }
.auth-link-row { text-align: center; font-size: .9rem; color: var(--muted); }
.auth-link-row a { color: var(--blue); font-weight: 700; }
.auth-note { font-size: .82rem; color: var(--muted); text-align: center; line-height: 1.5; margin-top: 16px; }

/* File upload drop zone */
.file-drop {
  position: relative;
  border: 2px dashed var(--gray);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
  cursor: pointer;
  transition: border .2s;
}
.file-drop:hover { border-color: var(--blue); }
.file-drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop span { font-size: .9rem; color: var(--muted); pointer-events: none; }

/* --- Dashboard grid --- */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.dash-tile {
  background: var(--white);
  border: 1px solid var(--gray);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .15s, transform .15s;
  display: block;
}
.dash-tile:hover { box-shadow: 0 6px 20px rgba(20,33,61,.12); transform: translateY(-2px); text-decoration: none; }
.dash-tile .tile-icon { font-size: 2.2rem; margin-bottom: 10px; }
.dash-tile .tile-title { font-weight: 700; font-size: 1rem; color: var(--navy); }
.dash-tile .tile-desc  { font-size: .82rem; color: var(--muted); margin-top: 4px; }

/* --- Manual --- */
.manual-wrap { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
.manual-toc {
  background: var(--white);
  border: 1px solid var(--gray);
  border-radius: var(--radius);
  padding: 18px;
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}
.manual-toc h3 { font-size: .9rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 12px; }
.manual-toc a { display: block; padding: 5px 8px; border-radius: 6px; font-size: .88rem; color: var(--text); }
.manual-toc a:hover { background: var(--cloud); text-decoration: none; }
.manual-toc a.toc-active { background: var(--navy); color: #fff; }
.manual-content section { margin-bottom: 48px; }
.manual-content h2 { font-size: 1.5rem; border-bottom: 2px solid var(--gold); padding-bottom: 8px; margin-bottom: 18px; }
.manual-content h3 { font-size: 1.1rem; color: var(--blue); margin: 20px 0 8px; }
.manual-content h4 { font-size: 1rem; color: var(--navy); margin: 14px 0 6px; }
.chapter-review { background: var(--cloud); border-left: 4px solid var(--gold); border-radius: 0 8px 8px 0; padding: 16px 18px; margin-top: 24px; }
.chapter-review h4 { color: var(--navy); margin-bottom: 10px; }
.key-terms { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.key-term { background: var(--navy); color: #fff; padding: 4px 12px; border-radius: 20px; font-size: .82rem; }
@media (max-width: 720px) { .manual-wrap { grid-template-columns: 1fr; } .manual-toc { position: static; max-height: 200px; } }

/* --- Flashcards --- */
.flashcard-wrap { max-width: 680px; margin: 0 auto; }
.flashcard {
  background: var(--white);
  border: 1px solid var(--gray);
  border-radius: 20px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(20,33,61,.1);
  transition: border-color .2s;
}
.flashcard:hover { border-color: var(--gold); }
.flashcard .fc-category { background: var(--gray); padding: 5px 14px; border-radius: 99px; font-size: .85rem; margin-bottom: 14px; }
.flashcard .fc-hint { color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-size: .8rem; margin-bottom: 10px; }
.flashcard .fc-term { font-size: 1.8rem; font-weight: 700; color: var(--navy); line-height: 1.2; }
.flashcard .fc-chapter { color: var(--muted); font-size: .9rem; margin-top: 14px; }
.fc-controls { display: flex; justify-content: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.cat-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.cat-btn { background: var(--white); border: 1.5px solid var(--gray); border-radius: 20px; padding: 6px 14px; font-size: .85rem; font-weight: 600; cursor: pointer; }
.cat-btn.active, .cat-btn:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.fc-progress { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 12px; }

/* --- Quiz --- */
.quiz-wrap { max-width: 700px; margin: 0 auto; }
.quiz-box { background: var(--white); border-radius: var(--radius); padding: 28px; box-shadow: 0 4px 16px rgba(20,33,61,.08); }
.quiz-q { font-size: 1.15rem; font-weight: 700; margin-bottom: 18px; color: var(--navy); }
.quiz-choices { display: grid; gap: 10px; }
.quiz-choice { background: var(--cloud); border: 1.5px solid var(--gray); border-radius: 10px; padding: 12px 16px; text-align: left; font-size: .95rem; cursor: pointer; font-family: inherit; transition: background .15s, border-color .15s; }
.quiz-choice:hover { background: #e8f0fe; border-color: var(--blue); }
.quiz-choice.correct { background: #d1f0d9; border-color: var(--green); }
.quiz-choice.wrong   { background: #fde8e8; border-color: var(--red); }
.quiz-result { margin-top: 14px; padding: 12px 16px; border-radius: 8px; font-weight: 600; }
.quiz-result.correct { background: #d1f0d9; color: #0f5132; }
.quiz-result.wrong   { background: #fde8e8; color: var(--red); }
.quiz-progress { color: var(--muted); font-size: .88rem; margin-bottom: 10px; }

/* --- Airport codes --- */
.airport-search { width: 100%; padding: 12px 16px; border: 1.5px solid var(--gray); border-radius: 10px; font-size: 1rem; font-family: inherit; outline: none; margin-bottom: 18px; }
.airport-search:focus { border-color: var(--blue); }
.airport-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: 0 2px 8px rgba(20,33,61,.06); }
.airport-table thead { background: var(--navy); color: #fff; }
.airport-table th { padding: 12px 16px; text-align: left; font-size: .88rem; }
.airport-table td { padding: 10px 16px; font-size: .9rem; border-bottom: 1px solid var(--cloud); }
.airport-table tr:last-child td { border-bottom: none; }
.airport-table tr.state-row td { background: var(--cloud); font-weight: 700; font-size: .85rem; color: var(--navy); }
.airport-table tr:hover td { background: #f0f4fb; }

/* --- Forum --- */
.forum-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.thread-item { background: var(--white); border: 1px solid var(--gray); border-radius: var(--radius); padding: 16px 20px; display: flex; gap: 16px; align-items: flex-start; transition: box-shadow .15s; }
.thread-item:hover { box-shadow: 0 4px 14px rgba(20,33,61,.08); }
.thread-item + .thread-item { margin-top: 10px; }
.thread-icon { width: 42px; height: 42px; border-radius: 50%; background: var(--navy); color: var(--gold); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1rem; flex-shrink: 0; }
.thread-meta { flex: 1; }
.thread-title { font-weight: 700; color: var(--navy); font-size: 1rem; }
.thread-title a { color: var(--navy); }
.thread-title a:hover { color: var(--blue); text-decoration: none; }
.thread-sub { font-size: .83rem; color: var(--muted); margin-top: 4px; }
.thread-stats { text-align: right; font-size: .82rem; color: var(--muted); white-space: nowrap; }
.pinned-badge { background: var(--gold); color: var(--navy); font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; margin-right: 6px; }
.category-tag { background: var(--cloud); color: var(--blue); font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.forum-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.forum-cat-btn { background: var(--white); border: 1.5px solid var(--gray); border-radius: 20px; padding: 6px 14px; font-size: .85rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.forum-cat-btn.active, .forum-cat-btn:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

/* --- Thread view / posts --- */
.post-item { background: var(--white); border: 1px solid var(--gray); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; }
.post-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.post-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--bluedk); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; font-size: .9rem; }
.post-author { font-weight: 700; font-size: .95rem; color: var(--navy); }
.post-time   { font-size: .8rem; color: var(--muted); }
.post-content { line-height: 1.6; font-size: .95rem; }
.reply-form { background: var(--white); border: 1px solid var(--gray); border-radius: var(--radius); padding: 20px; margin-top: 8px; }

/* --- Messages --- */
.msg-layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; height: calc(100vh - 130px); }
.msg-list { background: var(--white); border: 1px solid var(--gray); border-radius: var(--radius); overflow-y: auto; }
.msg-conv-item { padding: 14px 16px; border-bottom: 1px solid var(--gray); cursor: pointer; transition: background .15s; }
.msg-conv-item:hover, .msg-conv-item.active { background: var(--cloud); }
.msg-conv-name { font-weight: 700; font-size: .92rem; color: var(--navy); }
.msg-conv-preview { font-size: .82rem; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-unread .msg-conv-name::after { content: '•'; color: var(--blue); margin-left: 6px; }
.msg-pane { background: var(--white); border: 1px solid var(--gray); border-radius: var(--radius); display: flex; flex-direction: column; }
.msg-pane-header { padding: 16px 20px; border-bottom: 1px solid var(--gray); font-weight: 700; color: var(--navy); }
.msg-messages { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.msg-bubble { max-width: 70%; padding: 10px 14px; border-radius: 14px; font-size: .93rem; line-height: 1.4; }
.msg-bubble.mine { background: var(--navy); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-bubble.theirs { background: var(--cloud); color: var(--text); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-bubble .msg-ts { font-size: .72rem; opacity: .65; margin-top: 4px; }
.msg-input-row { padding: 14px 20px; border-top: 1px solid var(--gray); display: flex; gap: 10px; }
.msg-input-row input { flex: 1; border: 1.5px solid var(--gray); border-radius: 24px; padding: 10px 16px; font-size: .95rem; font-family: inherit; outline: none; }
.msg-input-row input:focus { border-color: var(--blue); }
.msg-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .95rem; }
@media (max-width: 650px) { .msg-layout { grid-template-columns: 1fr; height: auto; } }

/* --- Disclaimer page --- */
.disclaimer-box { max-width: 700px; margin: 60px auto; background: var(--white); border-radius: 18px; padding: 48px 40px; box-shadow: 0 12px 40px rgba(0,0,0,.12); }
.disclaimer-box h1 { color: var(--navy); margin-bottom: 6px; font-family: Georgia, serif; }
.disclaimer-text { background: var(--cloud); border-radius: 10px; padding: 20px; max-height: 320px; overflow-y: auto; font-size: .9rem; line-height: 1.65; margin: 20px 0; border: 1px solid var(--gray); }
.agree-row { display: flex; align-items: center; gap: 12px; margin: 20px 0; font-size: .95rem; cursor: pointer; }
.agree-row input[type="checkbox"] { width: 20px; height: 20px; cursor: pointer; }

/* --- Misc utility --- */
.tag { display: inline-block; background: var(--cloud); color: var(--blue); font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.badge-new { background: var(--gold); color: var(--navy); font-size: .72rem; font-weight: 700; padding: 2px 7px; border-radius: 4px; }
.muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');
