/* ──────────────────────────────────────────────────────────────────────────
   AZGFD Population Management Hunts — site theme
   Color palette and contrast ratios are tuned for WCAG 2.1 AA.
   ────────────────────────────────────────────────────────────────────────── */

:root {
    /* Brand colors */
    --azgfd-olive:        #6B5A2E;  /* primary brand — white text on this is 7.0:1 (AAA) */
    --azgfd-olive-hover:  #564926;
    --azgfd-olive-light:  #8F7C4A;
    --azgfd-tan:          #DBC4A0;  /* hero band background */
    --azgfd-tan-light:    #F2E7D0;
    --azgfd-sand:         #FAF5EA;
    --azgfd-ink:          #212322;  /* body text — 14.5:1 on white (AAA) */
    --azgfd-muted:        #595855;  /* secondary text — 7.1:1 on white (AAA) */
    --azgfd-rule:         #E2DACA;  /* divider lines */
    --azgfd-warn:         #A8331E;  /* warnings — 6.8:1 on white (AAA) */
    --azgfd-focus:        #2563EB;  /* visible focus ring */

    /* Layout tokens */
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --shadow-sm: 0 1px 2px rgba(33,35,34,0.05), 0 1px 1px rgba(33,35,34,0.03);
    --shadow-md: 0 4px 12px rgba(33,35,34,0.06), 0 2px 4px rgba(33,35,34,0.04);
    --shadow-lg: 0 12px 32px rgba(33,35,34,0.08), 0 4px 8px rgba(33,35,34,0.04);
}

/* ── Base typography ─────────────────────────────────────────────────────── */

html { font-size: 14px; position: relative; min-height: 100%; }
@media (min-width: 768px) { html { font-size: 16px; } }

body {
    margin-bottom: 60px;
    background-color: #FFFFFF;
    color: var(--azgfd-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { color: var(--azgfd-ink); letter-spacing: -0.01em; }
h1, .h1 { font-weight: 600; }
h2, .h2 { font-weight: 600; }
.text-muted { color: var(--azgfd-muted) !important; }

a { color: var(--azgfd-olive); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--azgfd-olive-hover); }

/* ── Skip-to-content link (WCAG 2.4.1) ───────────────────────────────────── */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--azgfd-ink);
    color: #FFFFFF;
    padding: 0.5rem 0.875rem;
    z-index: 1080;
    border-radius: 0 0 var(--radius-md) 0;
}
.skip-link:focus { top: 0; color: #FFFFFF; outline: 3px solid var(--azgfd-focus); }

/* ── Universal focus indicator (WCAG 2.4.7) ──────────────────────────────── */

:focus-visible {
    outline: 3px solid var(--azgfd-focus);
    outline-offset: 2px;
    border-radius: 2px;
}
.btn:focus-visible, .form-control:focus-visible, .form-check-input:focus-visible {
    outline: 3px solid var(--azgfd-focus);
    outline-offset: 2px;
    box-shadow: none;
}
/* Bootstrap defaults a blue glow; replace with our focus ring */
.btn:focus, .btn:active:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: none;
}

/* WCAG 2.4.11 Focus Not Obscured (Minimum, AA) — keep focused fields from
   sitting flush against the viewport top under any future sticky chrome. */
:focus-visible,
.form-control,
.form-select,
.form-check-input,
fieldset,
.btn,
section,
h1, h2, h3 {
    scroll-margin-top: 1rem;
}

/* WCAG 2.5.8 Target Size (Minimum, AA) — interactive targets ≥ 24×24 px.
   Bootstrap btn-close defaults to ~16px, and small ".btn-link.btn-sm" links
   can shrink below the threshold; clamp them so the hit area stays compliant. */
.btn-close,
.btn-sm,
.form-check-input[type="checkbox"],
.form-check-input[type="radio"] {
    min-width: 24px;
    min-height: 24px;
}
.navbar-toggler { min-width: 44px; min-height: 44px; }

/* WCAG 2.3.3 Animation from Interactions / honor user motion preference.
   Suppress transitions/animations for users who request reduced motion. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ── Header / navbar ─────────────────────────────────────────────────────── */

.site-header {
    background-color: #FFFFFF;
    border-bottom: 1px dashed var(--azgfd-rule);
    box-shadow: var(--shadow-sm);
}
.site-header .navbar { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--azgfd-ink);
    font-weight: 600;
    font-size: 1.0625rem;
    text-decoration: none;
}
.brand-link:hover { color: var(--azgfd-olive-hover); }
.brand-logo {
    height: 44px;
    width: auto;
    display: block;
    flex-shrink: 0;
}
.brand-text { line-height: 1.2; }

.contact-logo {
    height: 64px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.site-header .nav-link {
    color: var(--azgfd-ink);
    font-weight: 500;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-md);
}
.site-header .nav-link:hover, .site-header .nav-link:focus-visible {
    background-color: var(--azgfd-tan-light);
    color: var(--azgfd-ink);
}
.user-greeting {
    color: var(--azgfd-ink);
    font-weight: 600;
    padding: 0.5rem 0.875rem;
}

/* ── Hero band ───────────────────────────────────────────────────────────── */

.hero {
    position: relative;
    background: linear-gradient(180deg, var(--azgfd-tan) 0%, var(--azgfd-tan-light) 100%);
    border-bottom: 1px solid var(--azgfd-rule);
    padding: 4.5rem 0;
    text-align: center;
    color: var(--azgfd-ink);
    overflow: hidden;
    isolation: isolate;
}

/* When a hero has a photo background, layer a warm dark overlay so headline
   text always meets WCAG AA contrast (4.5:1) on top. */
.hero--photo {
    color: #FFFFFF;
    background-color: var(--azgfd-ink);
    background-size: cover;
    background-position: center 35%;
    background-repeat: no-repeat;
}
.hero--photo::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(33,35,34,0.55) 0%, rgba(33,35,34,0.70) 100%);
}
.hero--photo h1,
.hero--photo .hero-eyebrow,
.hero--photo .lead { color: #FFFFFF; }
.hero--photo .hero-eyebrow { color: var(--azgfd-tan); }
.hero--photo .lead { color: rgba(255,255,255,0.92); }

.hero-logo {
    height: 96px;
    width: auto;
    margin: 0 auto 1rem;
    display: block;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.25));
}
.hero-eyebrow {
    color: var(--azgfd-olive-hover);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.hero h1 {
    font-size: clamp(1.75rem, 3vw + 1rem, 2.75rem);
    margin-bottom: 0.5rem;
}
.hero p.lead {
    font-size: 1.125rem;
    max-width: 36rem;
    margin: 0 auto 1.5rem;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: 0.625rem 1.25rem;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1rem; }

.btn-primary {
    background-color: var(--azgfd-olive);
    border-color: var(--azgfd-olive);
    color: #FFFFFF;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--azgfd-olive-hover);
    border-color: var(--azgfd-olive-hover);
    color: #FFFFFF;
}
.btn-outline-primary {
    color: var(--azgfd-olive);
    border-color: var(--azgfd-olive);
    background-color: transparent;
}
.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: var(--azgfd-olive);
    color: #FFFFFF;
    border-color: var(--azgfd-olive);
}
.btn-outline-secondary {
    color: var(--azgfd-muted);
    border-color: var(--azgfd-rule);
    background-color: transparent;
}
.btn-outline-secondary:hover, .btn-outline-secondary:focus {
    background-color: var(--azgfd-sand);
    color: var(--azgfd-ink);
    border-color: var(--azgfd-muted);
}
.btn-link { color: var(--azgfd-olive); }
.btn-link:hover { color: var(--azgfd-olive-hover); }

/* ── Cards ───────────────────────────────────────────────────────────────── */

.card {
    border: 1px solid var(--azgfd-rule);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-title { color: var(--azgfd-ink); font-weight: 600; }

.feature-card .card-body { padding: 1.75rem; }
.feature-card .card-title { font-size: 1.25rem; margin-bottom: 0.5rem; }

/* ── Page header (used on non-hero pages) ────────────────────────────────── */

.page-header {
    border-bottom: 1px solid var(--azgfd-rule);
    padding-bottom: 1.25rem;
    margin-bottom: 1.75rem;
}
.page-header h1 {
    font-size: clamp(1.5rem, 1.5vw + 1rem, 2.125rem);
    margin-bottom: 0.25rem;
}
.page-header .subhead { color: var(--azgfd-muted); margin-bottom: 0; }

.banner {
    font-family: Arial, sans-serif;
    text-align: center;
    padding: 10px;
    font-weight: bold;
    background-color: #fff;
}

    .banner.stage {
        background-color: #FFB345;
    }

    .banner.test {
        background-color: #D68FD6;
    }

    .banner.dev {
        background-color: #48566E;
    }

/* ── Accessible multi-step progress indicator ────────────────────────────── */

.steps-nav { margin-bottom: 2rem; }
.steps-nav ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    counter-reset: step;
}
.steps-nav .step {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--azgfd-rule);
    background-color: #FFFFFF;
    color: var(--azgfd-muted);
    font-size: 0.875rem;
    font-weight: 500;
}
.steps-nav .step .step-number {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background-color: var(--azgfd-rule);
    color: var(--azgfd-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}
.steps-nav .step.is-complete { background-color: var(--azgfd-sand); color: var(--azgfd-olive); border-color: var(--azgfd-tan-light); }
.steps-nav .step.is-complete .step-number { background-color: var(--azgfd-olive); color: #FFFFFF; }
.steps-nav .step.is-current { background-color: var(--azgfd-olive); color: #FFFFFF; border-color: var(--azgfd-olive); }
.steps-nav .step.is-current .step-number { background-color: #FFFFFF; color: var(--azgfd-olive); }
.steps-nav .step-arrow {
    color: var(--azgfd-rule);
    align-self: center;
    user-select: none;
}
@media (max-width: 575.98px) {
    .steps-nav .step-arrow { display: none; }
    .steps-nav .step { width: 100%; justify-content: flex-start; }
}

/* ── Form sections ───────────────────────────────────────────────────────── */

.form-section {
    margin-bottom: 1.75rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--azgfd-rule);
    border-radius: var(--radius-lg);
    background-color: #FFFFFF;
    box-shadow: var(--shadow-sm);
}
.form-section > legend,
.form-section > .form-section-heading {
    font-size: 1rem;
    font-weight: 600;
    color: var(--azgfd-ink);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--azgfd-rule);
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8125rem;
    color: var(--azgfd-olive);
}
.form-section.has-warning {
    border-color: rgba(168,51,30,0.25);
    background-color: #FFF8F6;
}

/* ── Species fieldset ────────────────────────────────────────────────────
   speciesIcons.png is a horizontal sprite (2816×1536, 5 columns:
   Bear, Elk, Javelina, Deer, Bison) with the species name labelled above
   and below each wooden disc. Zoom in so the disc fills the 72×72 window
   and crop past the labels with background-position. */
.species-fieldset > .species-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    text-transform: none;
    letter-spacing: normal;
    font-size: 1rem;
    color: var(--azgfd-ink);
    padding-bottom: 0.75rem;
}
.species-legend .species-name {
    font-size: 1.25rem;
    font-weight: 700;
}
.species-icon {
    display: inline-block;
    width: 80px;
    height: 80px;
    background-position: center;
    background-size: 80px;
    background-repeat: no-repeat;
    flex-shrink: 0;
    border-radius: 6px;
}
/* Column centers (scaled): Bear 45, Elk 135, Javelina 225, Deer 315, Bison 405.
   x offset = -(center - 40) to center each tile in the 80px window. */
.species-icon--bear {
    background-image: url('/images/Bear.png');
}
.species-icon--elk {
    background-image: url('/images/Elk.png');
}
.species-icon--javelina {
    background-image: url('/images/Javelina.png');
}
.species-icon--deer {
    background-image: url('/images/Deer.png');
}
.species-icon--bison {
    background-image: url('/images/Bison.png');
}

.species-fieldset.species-locked {
    background-color: #FAF6EE;
    border-color: rgba(107, 90, 46, 0.35);
}
.species-fieldset.species-locked .species-icon {
    opacity: 0.55;
    filter: grayscale(40%);
}

.required-marker {
    color: var(--azgfd-warn);
    font-weight: 700;
    margin-left: 0.125rem;
}
.form-text { color: var(--azgfd-muted); }
.form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid var(--azgfd-rule);
    margin-top: 1rem;
}

/* ── Alerts ──────────────────────────────────────────────────────────────── */

.alert-info {
    background-color: var(--azgfd-tan-light);
    color: var(--azgfd-ink);
    border-color: var(--azgfd-rule);
}
.notice-banner {
    color: var(--azgfd-warn);
    text-align: center;
    font-weight: 500;
}

.species-locked-badge {
    background-color: #ffc107 !important; /* Bootstrap warning yellow */
    color: #000000 !important; /* Pure black text for maximum contrast */
}
.species-locked-message {
    display: block; /* or 'inline-block' / 'inline' depending on the layout needs */
}
/* An asp-validation-summary always emits its <div>; hide it (and its alert styling)
   when there are no errors so we don't show an empty red box. */
.validation-summary-valid { display: none; }
.notice-banner a { color: var(--azgfd-warn); text-decoration: underline; }

/* ── Forms ───────────────────────────────────────────────────────────────── */

.form-label { font-weight: 500; color: var(--azgfd-ink); }
.form-control, .form-select {
    border-color: var(--azgfd-rule);
    border-radius: var(--radius-md);
}
.form-control:focus, .form-select:focus { border-color: var(--azgfd-olive); }

/* ── Footer ──────────────────────────────────────────────────────────────── */

.site-footer {
    border-top: 1px solid var(--azgfd-rule);
    background-color: var(--azgfd-sand);
    color: var(--azgfd-muted);
    padding: 1.5rem 0;
    margin-top: 4rem;
}
.site-footer a { color: var(--azgfd-olive); }
.footer-logo {
    height: 28px;
    width: auto;
    opacity: 0.75;
}

/* Buttons placed on photo heroes get a clearer focus ring against dark imagery */
.hero--photo .btn-primary {
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.hero--photo .btn-outline-secondary {
    color: #FFFFFF;
    border-color: rgba(255,255,255,0.7);
    background-color: transparent;
}
.hero--photo .btn-outline-secondary:hover,
.hero--photo .btn-outline-secondary:focus {
    background-color: rgba(255,255,255,0.12);
    color: #FFFFFF;
    border-color: #FFFFFF;
}

/* ── Checkout loader: buck-head silhouette (masked from the deer image) whose
   interior fills bottom-to-top while the CyberSource checkout button finishes
   mounting. Sits on the site background; light "empty" deer + olive rising fill. */

.elk-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 1rem;
    transition: opacity 0.35s ease;
}
.elk-loader--hidden { opacity: 0; }

.elk-loader-svg {
    width: 116px;                 /* aspect 1588:1786 → ~0.889 */
    height: 130px;
}

/* The empty deer (track) and the rising fill, both masked to the deer shape. */
.elk-track { fill: var(--azgfd-tan); }
.elk-fill {
    fill: var(--azgfd-olive);
    transform-box: fill-box;
    transform-origin: 50% 100%;          /* grow upward from the bottom */
    animation: elk-fill 4.2s ease-in-out infinite;
}
@keyframes elk-fill {
    0%   { transform: scaleY(0); opacity: 1; }   /* empty */
    78%  { transform: scaleY(1); opacity: 1; }   /* filled to 100% (gradual) */
    90%  { transform: scaleY(1); opacity: 1; }   /* hold */
    100% { transform: scaleY(1); opacity: 0; }   /* fade, then loop resets unseen */
}

.elk-caption {
    margin: 0;
    text-align: center;
    font-family: "Courier New", monospace;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.78rem;
    color: var(--azgfd-olive);
}
.elk-caption::after { content: "\2026"; }   /* … */

/* ── Home page: step numbers + season badge ──────────────────────────────── */

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--azgfd-olive);
    color: #FFFFFF;
    font-weight: 700;
    font-size: 0.95rem;
}
.season-badge {
    align-self: flex-start;
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: var(--azgfd-tan-light);
    color: var(--azgfd-olive);
    border: 1px solid var(--azgfd-tan);
    font-size: 0.78rem;
    font-weight: 600;
}

/* ── Honor reduced motion (WCAG 2.3.3) ───────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}
