/* ==========================================================================
   MPD Golf Tournament — styles
   Professional-but-fun fundraising theme. Navy (police) + gold + fairway green.
   Mobile-first, accessible focus states, no external fonts (CSP-friendly).
   ========================================================================== */

:root {
  --navy: #0b2545;
  --navy-2: #13315c;
  --gold: #e0b53f;
  --gold-dark: #b8902a;
  --green: #1f7a4d;
  --green-light: #2f9c64;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1a2333;
  --muted: #5b6677;
  --border: #d9e0ea;
  --danger: #b3261e;
  --success: #1f7a4d;
  --radius: 12px;
  --shadow: 0 6px 20px rgba(11, 37, 69, 0.1);
  --max: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

h1, h2, h3 { line-height: 1.2; color: var(--navy); }
a { color: var(--green); }
img { max-width: 100%; height: auto; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 1rem; }

/* ---- Skip link (accessibility) ---- */
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--gold); color: var(--navy);
  padding: .6rem 1rem; z-index: 100; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* ---- Security banner ---- */
.security-banner {
  background: var(--navy); color: #fff; font-size: .85rem; text-align: center;
  padding: .5rem 1rem;
}
.security-banner strong { color: var(--gold); }
.security-banner code { background: rgba(255,255,255,.12); padding: .1rem .35rem; border-radius: 4px; }

/* ---- Header / nav ---- */
.site-header { background: var(--navy-2); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow); }
.nav { display: flex; align-items: center; justify-content: space-between; padding: .7rem 1rem; gap: 1rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; color: #fff; text-decoration: none; }
.brand .badge { width: 34px; height: 34px; background: var(--gold); color: var(--navy); border-radius: 50%; display: grid; place-items: center; font-weight: 900; }
/* MPD badge logo, presented as a clean white tile against dark backgrounds */
.brand-logo { height: 42px; width: auto; display: block; background: #fff; border-radius: 8px; padding: 3px; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.hero-logo { width: 132px; height: auto; display: block; margin: 0 auto 1rem; background: #fff; border-radius: 14px; padding: 10px; box-shadow: var(--shadow); }
.footer-logo { height: 60px; width: auto; background: #fff; border-radius: 8px; padding: 5px; }
.footer-brand { display: flex; align-items: center; gap: .8rem; }
.nav-links { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.nav-links a { color: #dce6f4; text-decoration: none; font-weight: 600; }
.nav-links a:hover { color: var(--gold); }

/* ---- Buttons ---- */
.btn {
  display: inline-block; cursor: pointer; border: none; border-radius: 999px;
  padding: .8rem 1.6rem; font-weight: 700; font-size: 1rem; text-decoration: none;
  transition: transform .05s ease, background .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gold); color: var(--navy); }
.btn-primary:hover { background: var(--gold-dark); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-light); }
.btn-ghost { background: transparent; color: #fff; border: 2px solid var(--gold); }
.btn-block { display: block; width: 100%; text-align: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--green) 100%);
  color: #fff; padding: 3.5rem 1rem; text-align: center;
}
.hero h1 { color: #fff; font-size: clamp(1.8rem, 4vw, 3rem); margin: .3rem 0; }
.hero .tagline { font-size: 1.2rem; color: #ffe9b0; }
.hero .event-meta { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; margin: 1.4rem 0; }
.hero .event-meta div { background: rgba(255,255,255,.12); padding: .6rem 1.1rem; border-radius: var(--radius); }
.hero .event-meta .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); }

/* ---- Sections ---- */
section { padding: 2.6rem 0; }
.section-title { text-align: center; margin-bottom: .4rem; font-size: 1.8rem; }
.section-sub { text-align: center; color: var(--muted); margin-bottom: 1.8rem; }

.grid { display: grid; gap: 1.2rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.3rem; box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card .icon { font-size: 1.6rem; }

.alt-bg { background: #eef2f8; }

/* ---- Stat cards (admin) ---- */
.stat { text-align: center; }
.stat .num { font-size: 2rem; font-weight: 800; color: var(--green); }
.stat .lbl { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }

/* ---- Sponsors ---- */
.sponsor-list { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.sponsor-chip {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.4rem; min-width: 180px; text-align: center; box-shadow: var(--shadow);
}
.sponsor-chip .level { font-size: .75rem; color: var(--gold-dark); text-transform: uppercase; font-weight: 700; }

/* ---- Forms ---- */
.form-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .35rem; }
.field .req { color: var(--danger); }
.field input, .field select, .field textarea {
  width: 100%; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 8px;
  font-size: 1rem; font-family: inherit; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 3px solid rgba(31,122,77,.35); border-color: var(--green);
}
.field .error-text { color: var(--danger); font-size: .85rem; margin-top: .3rem; min-height: 1em; }
.field.has-error input, .field.has-error select { border-color: var(--danger); }
.hint { color: var(--muted); font-size: .85rem; }

fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin: 0 0 1.2rem; }
legend { font-weight: 700; padding: 0 .5rem; color: var(--navy); }

.type-toggle { display: flex; gap: .6rem; flex-wrap: wrap; }
.type-toggle label {
  flex: 1; min-width: 140px; border: 2px solid var(--border); border-radius: var(--radius);
  padding: .9rem; cursor: pointer; text-align: center; font-weight: 600;
}
.type-toggle input { position: absolute; opacity: 0; }
.type-toggle input:checked + span { color: var(--green); }
.type-toggle label:has(input:checked) { border-color: var(--green); background: #eafaf1; }

/* ---- Order summary ---- */
.summary { position: sticky; top: 80px; }
.summary .row { display: flex; justify-content: space-between; padding: .35rem 0; border-bottom: 1px dashed var(--border); }
.summary .row.total { border-bottom: none; font-weight: 800; font-size: 1.25rem; color: var(--navy); margin-top: .5rem; }

/* ---- Payment notice ---- */
.payment-notice {
  background: #fff8e6; border: 1px solid var(--gold); border-radius: var(--radius);
  padding: 1rem; font-size: .9rem; margin: 1rem 0;
}
.payment-notice strong { color: var(--gold-dark); }

/* ---- Alerts ---- */
.alert { padding: 1rem; border-radius: var(--radius); margin: 1rem 0; }
.alert-error { background: #fdecea; border: 1px solid var(--danger); color: #7a1a14; }
.alert-success { background: #e8f6ee; border: 1px solid var(--success); color: #14502f; }
.alert-info { background: #e9f1fb; border: 1px solid var(--navy-2); color: var(--navy); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: .65rem .75rem; border-bottom: 1px solid var(--border); font-size: .9rem; }
th { background: var(--navy); color: #fff; position: sticky; top: 0; }
tbody tr:hover { background: #f0f4fa; cursor: pointer; }

.badge-status { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.status-PAID_DEMO, .status-PAID, .status-MANUAL_PAID, .status-COMPED { background: #e8f6ee; color: var(--success); }
.status-PENDING_PAYMENT { background: #fff3d6; color: var(--gold-dark); }
.status-MANUAL_REVIEW, .status-PAYMENT_FAILED { background: #fdecea; color: var(--danger); }

/* ---- Thank-you ---- */
.receipt-box {
  background: #fff; border: 2px dashed var(--green); border-radius: var(--radius);
  padding: 1.5rem; text-align: center; margin: 1.2rem 0;
}
.receipt-box .receipt-number { font-size: 1.6rem; font-weight: 800; letter-spacing: .05em; color: var(--navy); }

/* ---- Footer ---- */
.site-footer { background: var(--navy); color: #c7d3e6; padding: 2rem 1rem; margin-top: 2rem; }
.site-footer a { color: var(--gold); }
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; }
.site-footer h4 { color: #fff; margin: 0 0 .5rem; }

.muted { color: var(--muted); }
.center { text-align: center; }
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; }
.hidden { display: none !important; }

.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar input, .toolbar select { padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 8px; }

/* ---- Spinner ---- */
.spinner { display: inline-block; width: 1em; height: 1em; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .summary { position: static; }
}
