*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy:        #1a3a5c;
    --navy-dark:   #0f2440;
    --navy-light:  #e8f0f8;
    --amber:       #e8a020;
    --amber-light: #fff8ed;
    --amber-row:   #ffb800;
    --green:       #1a5c2a;
    --green-light: #e8f4e8;
    --red:         #8b1a1a;
    --red-light:   #fdf0f0;
    --border:      #94a3b8;
    --text:        #0f172a;
    --text-muted:  #475569;
    --gray-bg:     #f0f4f8;
    --white:       #ffffff;
    --radius:      10px;
    --radius-lg:   16px;
    --disabled-bg: #e2e8f0;
    --disabled-text: #94a3b8;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--gray-bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: 3rem;
    -webkit-text-size-adjust: 100%;
}

/* Header */
.page-header {
    background: var(--navy);
    color: white;
    text-align: center;
    padding: 1.25rem 1rem 1rem;
}
.page-header h1 {
    font-family: 'DM Serif Display', serif;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 4px;
}
.page-header p { font-size: 13px; opacity: 0.8; }

.event-bar {
    background: var(--amber);
    color: var(--navy-dark);
    text-align: center;
    padding: 9px 1rem;
    font-size: 13px;
    font-weight: 600;
}

/* Layout */
.form-wrap {
    max-width: 500px;
    margin: 1.25rem auto 0;
    padding: 0 1rem;
}

/* Waiver scroll box */
.waiver-scroll {
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    max-height: 160px;
    overflow-y: scroll;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    -webkit-overflow-scrolling: touch;
}
.waiver-scroll p { margin-bottom: 0.6rem; }
.waiver-scroll p:last-child { margin-bottom: 0; }
.waiver-scroll strong { color: var(--text); }

/* Read checkbox */
.read-check-wrap {
    margin-bottom: 1rem;
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.2s;
}
.read-check-wrap.scrolled { opacity: 1; pointer-events: auto; }
.read-check-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--navy);
    cursor: pointer;
    padding: 10px 14px;
    background: var(--navy-light);
    border: 2px solid var(--navy);
    border-radius: var(--radius);
}
.read-check-label input { width: 20px; height: 20px; accent-color: var(--navy); flex-shrink: 0; }

/* Fieldset disabled state */
fieldset { border: none; padding: 0; }
fieldset:disabled { pointer-events: none; }
fieldset:disabled .card,
fieldset:disabled .guardian-card,
fieldset:disabled .vol-row,
fieldset:disabled .optin-list { opacity: 0.45; filter: grayscale(0.3); }
fieldset:disabled .submit-btn { opacity: 0.45; cursor: not-allowed; }

/* Cards */
.card {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--navy);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 1rem;
}
.section-gap { margin-top: 1rem; }

/* Fields */
.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field.span2 { grid-column: span 2; }

label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input[type=text],
input[type=email],
input[type=tel],
input[type=date],
select {
    width: 100%;
    padding: 11px 13px;
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: white;
    color: var(--text);
    -webkit-appearance: none;
    transition: border-color 0.15s;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(26,58,92,0.12);
}

/* Radio group */
.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    background: white;
    transition: border-color 0.15s;
}
.radio-label input[type=radio] { width: 20px; height: 20px; accent-color: var(--navy); flex-shrink: 0; }
.radio-label:has(input:checked) { border-color: var(--navy); background: var(--navy-light); }

.minor-notice {
    margin-top: 0.75rem;
    padding: 10px 14px;
    background: var(--amber-light);
    border: 2px solid var(--amber);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: #7a4500;
}

/* Signature */
.sig-wrap {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: #fafafa;
    position: relative;
    height: 100px;
    overflow: hidden;
    touch-action: none;
    cursor: crosshair;
}
.sig-wrap canvas { display: block; width: 100%; height: 100%; }
.sig-line {
    position: absolute;
    bottom: 24px;
    left: 14px;
    right: 70px;
    height: 1px;
    background: var(--border);
    pointer-events: none;
}
.sig-hint {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--border);
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 0.2s;
}
.sig-clear {
    position: absolute;
    top: 7px;
    right: 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    pointer-events: auto;
}

/* Minor blocks */
.minor-block {
    background: var(--amber-light);
    border: 1.5px solid #f0c060;
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}
.minor-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: #7a4500;
    margin-bottom: 0.6rem;
}
.remove-minor {
    font-size: 12px;
    font-weight: 500;
    color: var(--red);
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
}
.add-minor-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    background: none;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    margin-bottom: 1rem;
}

/* Guardian card */
.guardian-card {
    background: var(--navy-light);
    border: 2px solid var(--navy);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

/* Opt-ins */
.optin-list {
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.optin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: white;
    border-bottom: 1px solid var(--border);
}
.optin-row:last-child { border-bottom: none; }
.optin-label { font-size: 15px; color: var(--text); }

/* Toggle */
.toggle-wrap { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.toggle-wrap input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.2s;
}
.toggle-wrap input:checked + .toggle-track { background: var(--navy); }
.toggle-track::after {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    background: white;
    border-radius: 50%;
    top: 3px; left: 3px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.toggle-wrap input:checked + .toggle-track::after { transform: translateX(20px); }

/* Volunteer row */
.vol-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: var(--green-light);
    border: 2px solid #7fba8a;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}
.vol-row input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--green); flex-shrink: 0; margin-top: 2px; }
.vol-row label { font-size: 15px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text); cursor: pointer; }

/* Links */
.links-row {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border);
    margin-bottom: 1rem;
}
.links-row a { font-size: 13px; color: var(--text-muted); text-decoration: none; }

/* Submit */
.submit-btn {
    display: block;
    width: 100%;
    padding: 16px;
    background: var(--navy);
    color: white;
    font-family: 'DM Sans', sans-serif;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: background 0.15s;
}
.submit-btn:hover { background: var(--navy-dark); }
.submit-btn:active { transform: scale(0.99); }

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 1rem;
}
.alert-error { background: var(--red-light); border: 2px solid var(--red); color: var(--red); }
.alert-success { background: var(--green-light); border: 2px solid var(--green); color: var(--green); }

/* Notice / event list */
.notice {
    font-size: 16px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 1rem;
    padding: 1rem 0;
}
.event-list { display: flex; flex-direction: column; gap: 10px; }
.event-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 1rem 1.25rem;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s;
}
.event-item:hover { border-color: var(--navy); }
.event-item strong { font-size: 16px; color: var(--navy); }
.event-item span { font-size: 14px; color: var(--text-muted); }
.event-time { font-weight: 600; color: var(--text); }

/* Checkin table */
.checkin-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.checkin-table th {
    background: var(--navy);
    color: white;
    padding: 10px 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.checkin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.checkin-table tr.unconfirmed { background: #fff3b0; }
.checkin-table tr.checked-in { background: var(--green-light); }
.checkin-table tr:hover { filter: brightness(0.97); }

/* Admin */
.admin-wrap { max-width: 700px; margin: 1.5rem auto; padding: 0 1rem; }
.admin-header { background: var(--navy-dark); color: white; padding: 1rem 1.5rem; display: flex; justify-content: space-between; align-items: center; }
.admin-header h2 { font-size: 18px; font-weight: 500; }
.btn { display: inline-block; padding: 9px 18px; border-radius: var(--radius); font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; border: 2px solid transparent; transition: all 0.15s; }
.btn-primary { background: var(--navy); color: white; }
.btn-primary:hover { background: var(--navy-dark); }
.btn-secondary { background: white; color: var(--navy); border-color: var(--navy); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger { background: var(--red); color: white; }

/* Misc */
.note { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 0.6rem; padding-bottom: 1rem; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt1 { margin-top: 1rem; }
.mb1 { margin-bottom: 1rem; }

/* Stats bar */
.stats-bar {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 1rem;
}
.stat-card {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    text-align: center;
}
.stat-num { font-size: 28px; font-weight: 600; color: var(--navy); }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }

/* Search bar */
.search-bar { width: 100%; padding: 12px 14px; font-family: 'DM Sans', sans-serif; font-size: 16px; border: 2px solid var(--border); border-radius: var(--radius); margin-bottom: 1rem; }
.search-bar:focus { outline: none; border-color: var(--navy); }
