/* Brand colours and typography from topendcivil.com.au; assets are served locally. */
@font-face {
  font-family: "Galano Grotesque";
  src: url("/assets/fonts/GalanoGrotesque-Black.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Galano Grotesque";
  src: url("/assets/fonts/GalanoGrotesque-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Galano Grotesque";
  src: url("/assets/fonts/GalanoGrotesque-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito Sans";
  src: url("/assets/fonts/NunitoSans-Latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
:root {
  --tec-navy: #29235c;
  --tec-orange: #e95a0c;
  --navy-deep: #0b0a24;
  --navy-light: #f1f0f6;
  --orange-light: #f2762f;
  --orange-hover: #d14e0a;
  --orange-button: #b7440a;
  --ink: #050a1e;
  --muted: #5e6478;
  --paper: #f4f2ee;
  --border: #29235c24;
  --font-display: "Galano Grotesque", system-ui, sans-serif;
  --font-body: "Nunito Sans", "Segoe UI", sans-serif;
  --gutter: clamp(20px, 5vw, 80px);
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px var(--gutter);
  color: #fff;
  background: var(--tec-navy);
  border-bottom: 1px solid #ffffff1a;
}
.brand { display: inline-flex; align-items: center; gap: 24px; min-width: 0; }
.brand img { display: block; width: 200px; height: auto; }
.brand-tag {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: .15em;
  border-left: 1px solid #ffffff38;
  padding: 12px 0 12px 24px;
}
.header-link, .aircraft-tag {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}
.header-link { border: 2px solid var(--tec-orange); border-radius: 6px; padding: 10px 18px; }
.header-link:hover { background: var(--orange-button); }
.aircraft-tag { color: #dad8e6; }
.page-hero { background: var(--paper); color: var(--tec-navy); border-bottom: 1px solid var(--border); }
.hero-inner { max-width: 1440px; margin: auto; padding: 28px var(--gutter) 24px; }
h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.2;
  letter-spacing: -.01em;
  font-weight: 700;
  margin: 0 0 10px;
}
.intro { max-width: 680px; font-size: 16px; line-height: 1.6; color: var(--muted); margin: 0; }
main { width: 100%; max-width: 1440px; margin: 0 auto; padding: 24px var(--gutter) 48px; flex: 1; }
.grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
body[data-page="book"] .grid { grid-template-columns: minmax(0, 2fr) minmax(260px, .85fr); }
body[data-page="admin"] .grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.card { padding: 24px; background: #fff; border: 1px solid var(--border); border-radius: 6px; min-width: 0; }
h2 { font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1.3; letter-spacing: -.01em; color: var(--tec-navy); margin: 0 0 20px; }
p { line-height: 1.65; }
.section-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
label { display: block; margin: 0 0 18px; font-weight: 700; font-size: 14px; color: var(--tec-navy); }
input { display: block; width: 100%; margin-top: 7px; padding: 13px 15px; border: 2px solid var(--border); border-radius: 10px; background: var(--navy-light); color: var(--ink); min-height: 48px; transition: border-color .14s, background .14s, box-shadow .14s; }
input:hover:not(:disabled) { border-color: #29235c47; }
input:focus { outline: none; border-color: var(--tec-orange); box-shadow: 0 0 0 3px #fde3d3; background: #fff; }
input:disabled { opacity: .7; cursor: not-allowed; }
input[readonly] { font-size: 13px; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--orange-button);
  color: #fff;
  border: 2px solid transparent;
  border-radius: 4px;
  padding: 13px 22px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  cursor: pointer;
  transition: background .14s, box-shadow .14s;
}
button:hover:not(:disabled), .button:hover { background: #963a0d; box-shadow: 0 6px 18px #0b0a2414; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--tec-orange); outline-offset: 4px; }
.secondary { color: var(--tec-navy); background: #fff; border-color: #29235c47; }
.secondary:hover:not(:disabled) { background: var(--navy-light); border-color: var(--tec-navy); box-shadow: none; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.65; }
.badge { display: inline-block; color: var(--tec-navy); background: var(--navy-light); padding: 6px 10px; font-size: 11px; border-radius: 4px; font-weight: 700; white-space: nowrap; }
.legend { display: flex; gap: 22px; color: var(--muted); font-size: 12px; margin: 0 0 16px; }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend span::before { content: ""; width: 11px; height: 11px; border: 1px solid #29235c47; border-radius: 2px; background: #fff; }
.legend span:last-child::before { background: #fde3d3; border-color: var(--tec-orange); }
.calendar-controls { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.calendar-controls label { flex: 1; max-width: 230px; margin: 0; }
.calendar-controls button { padding: 12px; min-height: 48px; }
.calendar-scroll { overflow-x: auto; }
.calendar-loading { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 240px; color: var(--tec-navy); font-size: 14px; }
.spinner { width: 26px; height: 26px; flex-shrink: 0; border: 3px solid var(--border); border-top-color: var(--tec-orange); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.calendar[aria-busy="true"] { display: none; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; min-width: 560px; }
.weekday { text-align: center; padding: 8px 0; font-size: 12px; font-weight: 700; color: var(--tec-navy); }
.calendar-error { grid-column: 1 / -1; }
.day { padding: 6px 4px; border: 1px solid var(--border); border-radius: 4px; min-height: 108px; text-align: center; font-size: 11px; background: #fff; }
.day.outside-window { background: #f5f5f5; color: var(--muted); }
.day.today { border-color: var(--tec-navy); }
.day strong { display: block; margin-bottom: 8px; }
.day button { padding: 7px 1px; width: 100%; min-height: 34px; font-size: 10px; letter-spacing: 0; border-color: transparent; background: var(--navy-light); }
.day button:disabled { cursor: not-allowed; }
.day button[aria-pressed="true"] { background: var(--tec-navy); color: #fff; }
.day p { color: var(--muted); }
.busy { display: block; background: #fde3d3; color: #963a0d; border-left: 2px solid var(--tec-orange); border-radius: 3px; padding: 6px 2px; margin-top: 5px; overflow-wrap: anywhere; font-weight: 700; }
.space { margin-top: 24px; }
#message:not(:empty) { background: var(--navy-light); color: var(--tec-navy); border-left: 3px solid var(--tec-orange); padding: 15px 18px; border-radius: 4px; margin: 0 0 24px; overflow-wrap: anywhere; }
#message.error { background: #fef3ec; color: #963a0d; }
#links > div { padding: 16px 0; border-top: 1px solid var(--border); }
#links > div:first-child { padding-top: 0; border-top: 0; }
#links button { padding: 9px 14px; font-size: 11px; }
#links input { margin-bottom: 10px; }
#links button + button { margin-left: 8px; }
#links p { margin: 6px 0; overflow-wrap: anywhere; }
#created-link { border-top: 1px solid var(--border); padding-top: 22px; margin-top: 24px; }
#result { border-top: 4px solid var(--tec-orange); }
#result p { overflow-wrap: anywhere; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th, td { padding: 15px 10px; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.6; }
th { color: var(--tec-navy); background: var(--navy-light); font-weight: 700; }
td button { font-size: 10px; padding: 9px 12px; }
footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px var(--gutter); color: #afabc8; background: var(--navy-deep); }
.footer-brand img { display: block; width: 160px; height: auto; }
.footer-copy { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; font-size: 12px; }
.footer-copy span:first-child { color: #fff; }
.home-card { max-width: 760px; }
.home-card p { color: var(--muted); }
[hidden] { display: none !important; }
@media (max-width: 960px) {
  .grid, body[data-page="admin"] .grid, body[data-page="book"] .grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  header { padding-block: 16px; gap: 12px; }
  .brand img { width: 150px; }
  .brand-tag { display: none; }
  .header-link { font-size: 10px; padding: 9px 10px; }
  .hero-inner { padding-top: 22px; padding-bottom: 20px; }
  h1 { font-size: 28px; }
  main { padding-top: 24px; padding-bottom: 40px; }
  .card { padding: 20px; }
  h2 { font-size: 18px; }
  input { font-size: 16px; }
  .section-heading { flex-wrap: wrap; }
  .section-heading .badge { margin: 0 0 18px; }
  .calendar { gap: 3px; }
  .day { padding: 6px 2px; font-size: 10px; }
  .day button { font-family: var(--font-body); font-size: 10px; font-weight: 700; }
  footer { padding-block: 24px; flex-wrap: wrap; }
  .footer-copy { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
  *, *::before, *::after { transition: none !important; }
}
