/* FairwayDesk — Below Zero Golf brand tokens and base styles. */
:root {
  --navy: #0E2236;
  --frost: #EEF6FA;
  --ice: #CFE6F2;
  --mid-blue: #2D5877;
  --deep-hole: #060F18;
  --flag-orange: #E8602C;      /* accent on light; graphics and large text only */
  --flag-orange-on-navy: #F26B3A;
  --white: #FFFFFF;
  --error: #A3261B;
  --error-bg: #FBE9E6;
  --ok: #1E6B3A;
  --ok-bg: #E4F3EA;

  --font-head: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --tap: 48px;
  --radius: 10px;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--frost);
  color: var(--navy);
  font: 400 17px/1.5 var(--font-body);
}
img { max-width: 100%; }
[hidden] { display: none !important; }

h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
.label-caps {
  font-family: var(--font-head); font-weight: 500;
  text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; color: var(--mid-blue);
}
p { margin: 0 0 1em; }
a { color: var(--mid-blue); }

/* ---------- header ---------- */
.site-header {
  background: var(--navy); color: var(--frost);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px var(--gutter);
  border-bottom: 4px solid var(--flag-orange-on-navy);
}
.wordmark { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.wordmark b { font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; letter-spacing: -.01em; }
.wordmark span { font-family: var(--font-head); font-weight: 500; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ice); }
.site-header .who { display: flex; gap: 12px; align-items: center; font-size: .85rem; color: var(--ice); overflow-wrap: anywhere; text-align: right; }

main { max-width: 760px; margin: 0 auto; padding: 24px var(--gutter) 64px; }

/* ---------- cards ---------- */
.card {
  background: var(--white); border: 1px solid var(--ice); border-radius: var(--radius);
  padding: 20px; margin-bottom: 20px;
}
.card > :last-child { margin-bottom: 0; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; margin-bottom: 6px; }
.hint { font-size: .9rem; color: var(--mid-blue); margin: 4px 0 0; }
input[type=text], input[type=number], input:not([type]), input[inputmode] {
  font: inherit; color: var(--navy); background: var(--white);
  min-height: var(--tap); width: 100%; padding: 10px 12px;
  border: 2px solid var(--mid-blue); border-radius: 8px;
}
input:focus-visible, button:focus-visible, a:focus-visible, .file-btn:focus-within {
  outline: 3px solid var(--mid-blue); outline-offset: 2px;
}
input[aria-invalid=true] { border-color: var(--error); background: var(--error-bg); }
.field { margin-bottom: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1 1 140px; margin-bottom: 0; }

/* ---------- buttons ---------- */
button, .btn {
  font: 600 1rem/1 var(--font-body);
  min-height: var(--tap); min-width: var(--tap); padding: 0 20px;
  border-radius: 8px; border: 2px solid var(--navy);
  background: var(--navy); color: var(--frost);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none;
}
button:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--flag-orange); border-color: var(--flag-orange); color: var(--navy); font-size: 1.05rem; }
.btn-ghost { background: transparent; color: var(--navy); }
.btn-danger { background: transparent; color: var(--error); border-color: var(--error); }
.btn-block { width: 100%; }
.site-header button { background: transparent; color: var(--frost); border-color: var(--ice); padding: 0 14px; }

/* ---------- messages ---------- */
.msg { border-radius: 8px; padding: 12px 14px; margin: 12px 0; font-weight: 600; }
.msg-error { background: var(--error-bg); color: var(--error); }
.msg-ok { background: var(--ok-bg); color: var(--ok); }
.msg p { margin: 0; }
.msg p + ul { margin-top: .4em; }
.msg ul { margin: 0; padding-left: 1.2em; font-weight: 400; }

/* ---------- sign-in ---------- */
.signin { max-width: 420px; margin: 8vh auto 0; text-align: center; }
.signin .btn { width: 100%; margin-top: 12px; background: var(--white); color: var(--navy); border-color: var(--navy); font-size: 1.05rem; }
.signin svg { width: 20px; height: 20px; flex: none; }

/* ---------- course profile ---------- */
.logo-box {
  display: flex; align-items: center; justify-content: center;
  width: 100%; max-width: 320px; min-height: 140px; padding: 12px;
  border: 2px dashed var(--ice); border-radius: var(--radius); background: var(--frost);
  margin-bottom: 12px; color: var(--mid-blue); text-align: center;
}
.logo-box img { max-height: 160px; object-fit: contain; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.required { color: var(--error); font-weight: 600; font-size: .9rem; }

.tee-list { list-style: none; margin: 0 0 16px; padding: 0; }
.tee-list li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 14px 0; border-bottom: 1px solid var(--ice);
}
.tee-list li:first-child { border-top: 1px solid var(--ice); }
.tee-list .tee-name { font-weight: 600; font-size: 1.1rem; flex: 1 1 100%; }
.tee-list .tee-facts { flex: 1 1 auto; font-size: .95rem; color: var(--mid-blue); }
.tee-list .tee-actions { display: flex; gap: 8px; }
.empty { color: var(--mid-blue); }

/* ---------- tee holes ---------- */
.nines { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 640px) { .nines { grid-template-columns: 1fr 1fr; } }
.holes { width: 100%; border-collapse: collapse; }
.holes caption { text-align: left; padding-bottom: 6px; }
.holes th, .holes td { padding: 4px; text-align: center; }
.holes th[scope=row] { font-family: var(--font-head); font-weight: 700; width: 3.2em; }
.holes thead th { font-family: var(--font-head); font-weight: 500; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--mid-blue); }
.holes input { text-align: center; padding: 8px 4px; }
.holes tfoot td, .holes tfoot th { font-weight: 600; border-top: 2px solid var(--ice); padding-top: 8px; }
.holes .hole-err td { padding: 0 4px 8px; text-align: left; color: var(--error); font-size: .9rem; font-weight: 600; }

.sticky-save {
  position: sticky; bottom: 0; background: var(--frost);
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--ice);
  display: flex; gap: 12px; flex-wrap: wrap;
}
.sticky-save .btn-primary { flex: 1 1 200px; }
.back { display: inline-flex; align-items: center; min-height: var(--tap); margin-bottom: 8px; font-weight: 600; }
