/* ============================================
   Sign Up Checklist Styles
   ============================================ */

.checklist-notice {
    background: #E8F0FE;
    border-left: 4px solid var(--tl-blue);
    border-radius: var(--radius);
    padding: 16px 20px;
    font-size: 0.9rem;
    color: var(--gray-700);
    line-height: 1.6;
    margin-bottom: 24px;
}
.checklist-notice strong {
    color: var(--brown-dark);
}
[data-theme="dark"] .checklist-notice {
    background: #1a2536;
}

/* Test-rollout lock: dim and disable everything for non-admins until launch.
   Admins (body.role-admin) see the items live so they can pay dues, etc.
   When dues launch publicly, drop the body:not(.role-admin) prefix to unlock for everyone. */
body:not(.role-admin) .checklist-items {
    opacity: 0.45;
    pointer-events: none;
}
body:not(.role-admin) .registered-adult-card {
    opacity: 0.45;
    pointer-events: none;
}
body.role-admin .checklist-notice { display: none; }

.checklist-trailman {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 28px 32px;
    margin-bottom: 24px;
}

.checklist-trailman-header {
    margin-bottom: 24px;
}
.checklist-trailman-name {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--brown-dark);
}
.checklist-age {
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-left: 8px;
}
.checklist-progress {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 4px;
}
.checklist-progress-bar {
    margin-top: 10px;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}
.checklist-progress-fill {
    height: 100%;
    background: #2D5E2A;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* --- Checklist items --- */
.checklist-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius);
    transition: background 0.15s;
}
.checklist-item:hover {
    background: var(--gray-100);
}
.checklist-item-done {
    opacity: 0.55;
}
/* The Registered Adult "done" row carries a live button (Print ID card), and
   a parent's opacity can't be undone by children — so this row keeps full
   opacity and mutes its text directly instead. */
.registered-adult-item.checklist-item-done { opacity: 1; }
.registered-adult-item.checklist-item-done .checklist-item-title { color: var(--gray-500); }
.registered-adult-item.checklist-item-done .checklist-item-desc { color: var(--gray-500); }
.checklist-item-done .checklist-item-title {
    text-decoration: line-through;
}

/* Custom checkbox */
.checklist-check {
    position: relative;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-top: 2px;
    cursor: pointer;
}
.checklist-check input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.checklist-checkmark {
    display: block;
    width: 24px;
    height: 24px;
    border: 2px solid var(--gray-200);
    border-radius: 6px;
    background: var(--white);
    transition: all 0.15s;
}
.checklist-check input:checked + .checklist-checkmark {
    background: #2D5E2A;
    border-color: #2D5E2A;
}
.checklist-check input:checked + .checklist-checkmark::after {
    content: '';
    display: block;
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
    margin: 2px 0 0 7px;
}

/* Item content */
.checklist-item-body {
    flex: 1;
    min-width: 0;
}
.checklist-item-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--brown-dark);
    margin-bottom: 4px;
}
.checklist-item-desc {
    font-size: 0.8rem;
    color: var(--gray-500);
    line-height: 1.5;
    margin-bottom: 8px;
}
.checklist-action {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 5px 14px;
    border-radius: var(--radius);
    text-decoration: none;
    transition: background 0.2s;
    background: var(--tl-blue);
    color: #fff;
}
.checklist-action:hover {
    opacity: 0.85;
}
.checklist-action-disabled {
    background: var(--gray-200);
    color: var(--gray-500);
    cursor: default;
}
.checklist-action-disabled:hover {
    opacity: 1;
}
.checklist-action-pay {
    border: none;
    cursor: pointer;
    background: #BA272C;
    color: #fff !important;
    font-size: 0.85rem;
    padding: 9px 22px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(186, 39, 44, 0.35);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
}
.checklist-action-pay:hover {
    background: #9E1D22;
    opacity: 1;
    box-shadow: 0 3px 10px rgba(186, 39, 44, 0.5);
}
.checklist-action-pay:disabled { opacity: 0.6; cursor: default; }

/* Uniforms — nested subtask blocks (Required: Bundle, Optional: T-Shirt) */
.checklist-subtask {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    margin: 10px 0;
    overflow: hidden;
}
.checklist-subtask-done {
    background: #f5f9f3;
    border-color: #c8e2c5;
}
[data-theme="dark"] .checklist-subtask-done {
    background: #20301E;
    border-color: #3A5C37;
}
.checklist-subtask-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--gray-100);
    cursor: pointer;
    border-bottom: 1px solid var(--gray-200);
    user-select: none;
}
.checklist-subtask-done .checklist-subtask-head {
    background: #DBEDD9;
    border-bottom-color: #c8e2c5;
}
[data-theme="dark"] .checklist-subtask-done .checklist-subtask-head {
    background: #2A3F26;
    border-bottom-color: #3A5C37;
}
.checklist-subtask-head input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.checklist-subtask-mark {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-500);
    border-radius: 4px;
    background: var(--white);
    position: relative;
    flex-shrink: 0;
}
.checklist-subtask-head input[type="checkbox"]:checked + .checklist-subtask-mark {
    background: #2D5E2A;
    border-color: #2D5E2A;
}
.checklist-subtask-head input[type="checkbox"]:checked + .checklist-subtask-mark::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}
.checklist-subtask-title {
    font-size: 0.95rem;
    color: var(--gray-900);
    flex: 1;
}
.checklist-subtask-body {
    padding: 12px 14px 14px;
}
.checklist-subtask-body > p:first-child {
    margin-top: 0;
}

/* Uniforms — explicit "not required" note (belt / pants / socks) */
.checklist-uniform-note {
    background: #fff8e0;
    border-left: 4px solid #d4a017;
    padding: 8px 12px;
    border-radius: 6px;
    margin: 8px 0 12px;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #5C4A2F;
}
.checklist-uniform-note strong {
    color: #876237;
}
[data-theme="dark"] .checklist-uniform-note {
    background: #33290F;
    color: #D8CCB7;
}
[data-theme="dark"] .checklist-uniform-note strong {
    color: #E8C87A;
}

/* Uniforms — preview image gallery (shirt + shoulder loops + lanyard) */
.checklist-uniform-previews {
    display: flex;
    gap: 12px;
    margin: 10px 0 12px;
    flex-wrap: wrap;
}
.checklist-uniform-preview {
    flex: 0 0 auto;
    margin: 0;
    text-align: center;
    width: 110px;
}
.checklist-uniform-preview a {
    display: block;
    text-decoration: none;
}
.checklist-uniform-preview img {
    display: block;
    width: 110px;
    height: 110px;
    object-fit: contain;
    background: var(--white);
    border-radius: 6px;
    border: 1px solid var(--gray-200);
    padding: 6px;
    transition: border-color 0.15s ease;
}
.checklist-uniform-preview a:hover img {
    border-color: var(--tl-blue);
}
.checklist-uniform-preview figcaption {
    margin-top: 4px;
    font-size: 0.78rem;
    color: var(--gray-700);
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Uniforms — staggered info text + buttons (required, then optional pair with "or") */
.checklist-uniform-info {
    font-size: 0.9rem;
    color: var(--gray-700);
    line-height: 1.5;
    margin: 6px 0 8px;
}
.checklist-uniform-info:not(:first-of-type) {
    margin-top: 16px;
}
.checklist-uniform-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.checklist-uniform-or {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
    font-weight: 600;
}
.checklist-action-secondary {
    background: var(--white);
    color: var(--tl-blue);
    border: 1px solid var(--tl-blue);
}
.checklist-action-secondary:hover { background: var(--tl-blue); color: #fff; opacity: 1; }
.checklist-uniform-hint {
    font-size: 0.82rem;
    color: var(--gray-500);
    font-style: italic;
    margin: 12px 0 0;
}
.checklist-uniform-status {
    display: inline-block;
    margin-top: 8px;
    color: #2D5E2A;
    font-size: 0.85rem;
    font-weight: 600;
}
.checklist-uniform-check {
    cursor: pointer;
}

.dues-success-banner {
    background: #DBEDD9;
    color: #2D5E2A;
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 0.95rem;
}
[data-theme="dark"] .dues-success-banner {
    background: #1E2F1C;
    color: #9CCB96;
}

/* Empty state */
.checklist-empty {
    text-align: center;
    padding: 48px 0;
    color: var(--gray-500);
    font-size: 0.9rem;
}
.checklist-empty a {
    color: var(--tl-blue);
}
.checklist-loading {
    text-align: center;
    padding: 48px 0;
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* --- Registered Adult Card --- */
.registered-adult-card {
    background: linear-gradient(135deg, #E8F0FE, #F0F4FF);
    border: 2px solid var(--tl-blue);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 24px;
}
[data-theme="dark"] .registered-adult-card {
    background: linear-gradient(135deg, #1a2536, #1e2d42);
    border-color: var(--tl-blue);
}
.registered-adult-body {
    flex: 1;
    min-width: 0;
}
.registered-adult-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--tl-blue);
    margin-bottom: 8px;
}
.registered-adult-desc {
    font-size: 0.85rem;
    color: var(--gray-500);
    line-height: 1.6;
    margin-bottom: 12px;
}
.registered-adult-desc strong {
    color: var(--brown-dark);
}
[data-theme="dark"] .registered-adult-desc strong {
    /* Was var(--gray-100) — which flips to #242220 (near-black) in dark mode,
     * leaving the emphasized text nearly invisible on the navy card. */
    color: #EDEAE5;
}
.registered-adult-item {
    margin: 12px 0 4px;
    padding: 12px;
    background: rgba(255,255,255,0.5);
    border-radius: var(--radius);
}
[data-theme="dark"] .registered-adult-item {
    background: rgba(255,255,255,0.05);
}

/* Registered Adult — per-man states (in progress / request / opted out) */
.ra-status-badge {
    display: inline-block;
    padding: 2px 10px;
    margin-right: 6px;
    border-radius: 10px;
    background: #FFF1D6;
    color: #876237;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
[data-theme="dark"] .ra-status-badge {
    background: #33290F;
    color: #D8B778;
}
.ra-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2px 0 10px;
}
/* One block per man inside the Registered Adult card: name, then two
   independent items (registration + adult health form). */
.ra-person { margin-top: 18px; }
.ra-person:first-of-type { margin-top: 6px; }
.ra-person-name {
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--gray-800, #222);
    margin: 0 0 6px;
}
.ra-person .registered-adult-item + .registered-adult-item { margin-top: 8px; }
.ra-chip {
    padding: 3px 10px;
    border-radius: 10px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    color: var(--gray-700);
    font-size: 0.75rem;
}
.ra-link-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--tl-blue);
    text-decoration: underline;
}
.ra-link-btn:hover { opacity: 0.8; }
.ra-optout-row {
    margin-top: 10px;
}
.ra-optout-row .ra-link-btn {
    color: var(--gray-500);
}
.ra-opted-out .checklist-item-title {
    color: var(--gray-500);
}
.ra-confirm {
    margin: 10px 0 4px;
    padding: 12px 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
}
.ra-confirm-text {
    font-size: 0.85rem;
    color: var(--gray-700);
    line-height: 1.5;
    margin: 0 0 10px;
}
.ra-leader-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--gray-700);
    margin-bottom: 12px;
    cursor: pointer;
}
.ra-leader-label input {
    margin-top: 2px;
    accent-color: var(--tl-blue);
}
.ra-confirm-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}
/* .checklist-action was written for <a>; the RA request/send are <button>s */
.registered-adult-item button.checklist-action {
    border: none;
    cursor: pointer;
}
.registered-adult-item button.checklist-action:disabled {
    opacity: 0.6;
    cursor: default;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .checklist-trailman {
        padding: 20px;
    }
    .checklist-item {
        padding: 12px 8px;
        gap: 12px;
    }
}


/* === Dark mode (audit #87-88, added 2026-08-05) =========================== */
[data-theme="dark"] .checklist-uniform-status { color: #9CCB96; }
[data-theme="dark"] .checklist-progress-fill { background: #4C8A47; }

/* Troop Numeral Patch — placement schematic (click-through to full size) */
.checklist-patch-figure {
    display: block;
    max-width: 460px;
    margin: 4px 0 10px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
}
.checklist-patch-figure img {
    width: 100%;
    height: auto;
    display: block;
}
.checklist-item-done .checklist-patch-figure { opacity: 0.6; }

/* Full-screen image lightbox (troop patch schematic) */
.tl-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    padding: 24px;
}
.tl-lightbox img {
    max-width: min(1100px, 94vw);
    max-height: 92vh;
    border-radius: 10px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
    background: #fff;
}
.tl-lightbox-close {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 2rem;
    line-height: 1;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px 10px;
}

/* Trail Life Connect step (tlc-step.js): status badge + fee / waiver chips. */
.tlc-step-badge-row { margin: 2px 0 6px; }
.ra-status-badge.tlc-badge-done { background: #DBEDD9; color: #2D5E2A; }
[data-theme="dark"] .ra-status-badge.tlc-badge-done { background: #1F3A1E; color: #A9D8A4; }
.ra-chip.tlc-chip-done { background: #DBEDD9; border-color: #B9D8B5; color: #2D5E2A; }
[data-theme="dark"] .ra-chip.tlc-chip-done { background: #1F3A1E; border-color: #2F5A2C; color: #A9D8A4; }
.ra-chip.tlc-chip-todo { background: #FFF1D6; border-color: #EBD3A4; color: #876237; }
[data-theme="dark"] .ra-chip.tlc-chip-todo { background: #33290F; border-color: #5A4A22; color: #D8B778; }
/* "— done" / "— not done" is for screen readers; the colour + check mark say it visually. */
.tlc-chip-state { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
