/* Airline Pilot Logbook Printing Co. — Customer portal
   Theme matched to the main site: navy (#0B1F3A), gold (#C4A35A),
   cream (#F7F4EE) on white. Pill buttons, sticky white header,
   navy footer. Shared by every portal page. */

:root {
  --navy: #0B1F3A;
  --navy-deep: #071528;
  --gold: #C4A35A;
  --gold-hover: #D4B56E;
  --white: #FFFFFF;
  --cream: #F7F4EE;
  --paper: #FFFFFF;
  --charcoal: #2C2C2C;
  --muted: #5A5A5A;
  --line: #E5E1D8;
  --radius: 12px;

  --pill-confirmed: #5A5A5A;
  --pill-proof-pending: #b26a00;
  --pill-proof-approved: #0B1F3A;
  --pill-in-production: #0B1F3A;
  --pill-shipped: #3f7f6b;
  --pill-delivered: #2e7d4f;
  --pill-refunded: #8a8578;
  --pill-default: #5A5A5A;

  --focus: #C4A35A;
  --shadow: 0 8px 30px rgba(11, 31, 58, 0.08);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--white);
  color: var(--charcoal);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--navy);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
a:hover { color: var(--gold); }

/* ---------- Header (sticky white, logo like the main site) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 0.9rem 1.25rem;
}
.site-header-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 1;
  min-width: 0;
  text-decoration: none;
}
.logo-mark {
  height: 44px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  flex-shrink: 0;
}
.wordmark {
  font-weight: 700;
  letter-spacing: 0.01em;
  font-size: 1.05rem;
  color: var(--navy);
  text-decoration: none;
}
.wordmark:hover { color: var(--gold); text-decoration: none; }
.header-tag {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}
.header-actions { display: flex; align-items: center; gap: 0.75rem; }
.header-email {
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Layout ---------- */
.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}
.wrap-narrow { max-width: 520px; }

h1 { font-size: 1.6rem; margin: 0 0 0.5rem; color: var(--navy); }
h2 { font-size: 1.15rem; margin: 1.75rem 0 0.5rem; color: var(--navy); }
p { margin: 0.5rem 0; }
.sub { color: var(--muted); font-size: 0.95rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }

/* ---------- Cards ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1rem 0;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 0.35rem; font-size: 1.05rem; color: var(--navy); }
.card-link { text-decoration: none; color: inherit; display: block; }
.card-link:hover { border-color: var(--gold); }
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ---------- Status pills ---------- */
.pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--pill-default);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  white-space: nowrap;
}
.pill.confirmed      { background: var(--pill-confirmed); }
.pill.proof_pending  { background: var(--pill-proof-pending); }
.pill.proof_approved { background: var(--pill-proof-approved); }
.pill.in_production  { background: var(--pill-in-production); }
.pill.shipped        { background: var(--pill-shipped); }
.pill.delivered      { background: var(--pill-delivered); }
.pill.refunded       { background: var(--pill-refunded); }
.pill.pending        { background: var(--pill-proof-pending); }
.pill.approved       { background: var(--pill-delivered); }

/* ---------- Buttons (pill, gold primary like the main site) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--gold);
  color: var(--navy);
  border: 2px solid var(--gold);
  border-radius: 999px;
  padding: 0.85rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn:hover {
  background: var(--gold-hover);
  border-color: var(--gold-hover);
  color: var(--navy);
  text-decoration: none;
  transform: translateY(-1px);
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
}
.btn-ghost:hover { background: var(--cream); border-color: var(--navy); color: var(--navy); }
/* Sign out — small quiet outline pill for the white header. */
.btn-outline-cream {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--line);
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  border-radius: 999px;
  font-weight: 600;
}
.btn-outline-cream:hover { background: var(--cream); border-color: var(--navy); color: var(--navy); }
.btn-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; }
.btn-block { display: block; width: 100%; }
.btn-lg { padding: 1rem 1.75rem; font-size: 1.05rem; }

/* ---------- Forms ---------- */
.field { margin: 1rem 0; }
label { display: block; font-weight: 600; margin-bottom: 0.35rem; color: var(--navy); }
input[type="email"], input[type="text"], textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--charcoal);
}
input:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
textarea { min-height: 110px; resize: vertical; }
.hint { font-size: 0.88rem; color: var(--muted); margin-top: 0.4rem; }

/* ---------- Alerts / states ---------- */
.alert {
  border: 1px solid var(--line);
  border-left: 4px solid var(--pill-default);
  border-radius: 8px;
  background: var(--paper);
  padding: 0.9rem 1rem;
  margin: 1rem 0;
}
.alert.error { border-left-color: #b3382e; }
.alert.action { border-left-color: var(--pill-proof-pending); }
.alert.ok { border-left-color: var(--pill-delivered); }
.alert p { margin: 0.25rem 0; }

.spinner {
  width: 34px; height: 34px;
  border: 4px solid var(--line);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center { text-align: center; }

/* ---------- Lists: books, proofs ---------- */
.list-reset { list-style: none; margin: 0.5rem 0; padding: 0; }
.list-reset li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}
.list-reset li:last-child { border-bottom: 0; }
.meta { color: var(--muted); font-size: 0.9rem; }

table.books {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0;
  font-size: 0.95rem;
}
table.books th, table.books td {
  text-align: left;
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--line);
}
table.books th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 0.25rem 1rem; margin: 0.75rem 0; }
.kv dt { color: var(--muted); font-size: 0.9rem; }
.kv dd { margin: 0; font-weight: 600; color: var(--navy); }

/* ---------- Timeline (vertical) ---------- */
.timeline { list-style: none; margin: 1rem 0; padding: 0; }
.timeline li {
  position: relative;
  padding: 0 0 1.25rem 1.75rem;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: 6px; top: 6px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--navy);
}
.timeline li::after {
  content: "";
  position: absolute;
  left: 10px; top: 20px; bottom: 0;
  width: 2px;
  background: var(--line);
}
.timeline li:last-child::after { display: none; }
.timeline .t-label { font-weight: 700; color: var(--navy); }
.timeline .t-sub { font-size: 0.9rem; color: var(--muted); }
.timeline .t-at { font-size: 0.82rem; color: var(--muted); }

/* ---------- Proof callout ---------- */
.proof-callout {
  background: var(--cream);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin-top: 0.9rem;
}
.proof-callout strong { color: var(--navy); }

/* ---------- PDF embed ---------- */
.pdf-frame {
  width: 100%;
  height: 65vh;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.pdf-fallback { margin-top: 0.5rem; font-size: 0.9rem; }

/* ---------- Checklist ---------- */
.checklist { list-style: none; padding: 0; margin: 0.75rem 0; }
.checklist li {
  padding: 0.5rem 0 0.5rem 2rem;
  position: relative;
  border-bottom: 1px solid var(--line);
}
.checklist li:last-child { border-bottom: 0; }
.checklist li::before {
  content: "☐";
  position: absolute;
  left: 0.25rem;
  color: var(--muted);
  font-size: 1.05rem;
}

/* ---------- Demo banner ---------- */
.demo-banner {
  background: repeating-linear-gradient(
    -45deg,
    #b26a00, #b26a00 18px,
    #0B1F3A 18px, #0B1F3A 36px
  );
  color: #fff;
  text-align: center;
  padding: 0.85rem 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.demo-note {
  background: var(--cream);
  border-bottom: 1px solid var(--gold);
  padding: 0.6rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--charcoal);
}

/* ---------- Footer (navy, branded like the main site) ---------- */
.site-footer {
  background: var(--navy-deep);
  color: rgba(255, 255, 255, 0.75);
  border-top: 1px solid rgba(196, 163, 90, 0.2);
  margin-top: 2rem;
  padding: 2.5rem 1.25rem 2rem;
}
.footer-inner {
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  gap: 1.5rem;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.footer-logo {
  height: 56px;
  width: auto;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
}
.footer-name {
  margin: 0;
  font-weight: 650;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.3;
}
.footer-tag {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--gold);
  text-transform: uppercase;
}
.footer-contact p {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}
.footer-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}
.footer-contact a { color: var(--gold); }
.footer-legal a { margin-right: 1rem; }
.footer-copy {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--navy);
  font-size: 0.95rem;
}
.back-link:hover { color: var(--gold); }

@media (max-width: 520px) {
  h1 { font-size: 1.35rem; }
  .kv { grid-template-columns: 110px 1fr; }
  .header-email { display: none; }
  .pdf-frame { height: 60vh; min-height: 340px; }
}
