:root {
    --ink: #172b40;
    --muted: #627181;
    --surface: #ffffff;
    --canvas: #ffe4a7;
    --line: #dce4e9;
    --green: #0879bd;
    --green-dark: #075b8d;
    --green-soft: #e3f4fc;
    --sun: #ffd72f;
    --coral: #f3343b;
    --blue: #15a8df;
    --danger: #b83d3d;
    --shadow: 0 18px 50px rgba(24, 56, 47, 0.08);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--canvas);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background-color: var(--canvas);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.16)),
        url("../images/kids-venture-stars.webp");
    background-position: center top;
    background-repeat: repeat;
    background-size: 820px auto;
    background-attachment: fixed;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 104px;
    padding: 10px max(24px, calc((100vw - 1060px) / 2));
    border-bottom: 1px solid rgba(23, 50, 45, 0.08);
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(12px);
}

.brand {
    display: inline-flex;
    align-items: center;
    color: var(--ink);
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: 230px;
    height: 82px;
    object-fit: contain;
}

.secure-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.secure-label svg {
    width: 17px;
    fill: none;
    stroke: var(--green);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.page-shell {
    width: min(100% - 40px, 960px);
    margin: 0 auto;
    padding: 64px 0 56px;
}

.intro-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 48px;
    margin-bottom: 32px;
}

.eyebrow {
    display: block;
    margin-bottom: 9px;
    color: var(--green);
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 10px;
    font-size: clamp(2.25rem, 6vw, 3.65rem);
    line-height: 1;
    letter-spacing: -0.055em;
}

.intro-row > div > p {
    max-width: 590px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.6;
}

.progress-steps {
    display: flex;
    min-width: 300px;
    margin: 0 0 4px;
    padding: 0;
    list-style: none;
}

.progress-steps li {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 135px;
    color: #8a9793;
    font-size: 0.72rem;
}

.progress-steps li + li::before {
    position: absolute;
    top: 14px;
    right: 50%;
    width: 100%;
    height: 2px;
    background: var(--line);
    content: "";
}

.progress-steps span {
    z-index: 1;
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 2px solid var(--line);
    border-radius: 50%;
    background: var(--canvas);
    font-size: 0.74rem;
    font-weight: 800;
}

.progress-steps strong {
    font-weight: 700;
}

.progress-steps .active,
.progress-steps .complete {
    color: var(--ink);
}

.progress-steps .active span {
    border-color: var(--green);
    color: white;
    background: var(--green);
    box-shadow: 0 0 0 5px var(--green-soft);
}

.progress-steps .complete span {
    border-color: var(--green);
    color: var(--green);
    background: var(--green-soft);
}

.progress-steps .complete + li::before {
    background: var(--green);
}

.waiver-form {
    display: grid;
    gap: 22px;
}

.form-card,
.review-strip,
.success-card {
    border: 1px solid rgba(23, 50, 45, 0.09);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.form-card {
    padding: 30px;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 27px;
}

.section-heading > div:nth-child(2) {
    flex: 1;
}

.section-icon {
    display: grid;
    flex: 0 0 auto;
    width: 47px;
    height: 47px;
    place-items: center;
    border-radius: 15px;
    font-weight: 900;
}

.adult-icon {
    color: #166549;
    background: #ddf3e9;
}

.minor-icon {
    color: #8a5a00;
    background: #fff0c8;
}

.signature-icon {
    color: #9b4b3c;
    background: #fde7e1;
}

.section-heading h2,
.contract-heading-row h2 {
    margin-bottom: 4px;
    font-size: 1.28rem;
    letter-spacing: -0.025em;
}

.section-heading p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.heading-line {
    display: flex;
    align-items: center;
    gap: 10px;
}

.heading-line h2 {
    margin: 0;
}

.age-badge,
.version-label {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 999px;
    color: var(--green-dark);
    background: var(--green-soft);
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 18px;
}

.field-wide {
    grid-column: 1 / -1;
}

.field label {
    display: block;
    margin-bottom: 8px;
    color: #314d46;
    font-size: 0.77rem;
    font-weight: 800;
}

.field input {
    width: 100%;
    height: 53px;
    padding: 0 15px;
    border: 1px solid #cfdad4;
    border-radius: 12px;
    outline: none;
    color: var(--ink);
    background: #fbfcfb;
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.field input::placeholder {
    color: #9aa7a3;
}

.field input:hover {
    border-color: #a8bcb4;
}

.field input:focus {
    border-color: var(--green);
    background: white;
    box-shadow: 0 0 0 4px rgba(30, 139, 104, 0.12);
}

.field > span,
.signature-tools > span,
.consent-error,
.minor-list-error {
    display: block;
    min-height: 18px;
    margin-top: 6px;
    color: var(--danger);
    font-size: 0.74rem;
    font-weight: 650;
}

.minors-heading {
    align-items: center;
}

.add-minor {
    margin-left: auto;
}

.minor-list {
    display: grid;
    gap: 14px;
}

.minor-empty {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 18px 20px;
    border: 1px dashed #b8c9d2;
    border-radius: 15px;
    color: var(--muted);
    background: #fbfcfd;
}

.minor-empty[hidden] {
    display: none;
}

.minor-empty > span {
    display: grid;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 50%;
    color: var(--green-dark);
    background: var(--green-soft);
    font-weight: 900;
}

.minor-empty strong {
    display: block;
    margin-bottom: 3px;
    color: var(--ink);
    font-size: 0.82rem;
}

.minor-empty p {
    margin: 0;
    font-size: 0.76rem;
}

.minor-card {
    padding: 21px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fbfcfb;
}

.minor-card-new {
    animation: reveal-card 220ms ease-out;
}

@keyframes reveal-card {
    from { opacity: 0; transform: translateY(-7px); }
    to { opacity: 1; transform: translateY(0); }
}

.minor-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 17px;
}

.minor-card-heading h3 {
    margin: 0;
    font-size: 0.79rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.minor-fields {
    grid-template-columns: 1fr 1fr 1fr;
}

.remove-minor,
.clear-signature,
.edit-link {
    border: 0;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 750;
    text-decoration: none;
}

.remove-minor:hover,
.clear-signature:hover,
.edit-link:hover {
    color: var(--danger);
}

.remove-minor[hidden] {
    display: none;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 6px 3px 0;
}

.form-actions p {
    margin: 0;
    color: var(--muted);
    font-size: 0.76rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    min-height: 50px;
    padding: 0 22px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 800;
    text-decoration: none;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    min-width: 205px;
    color: white;
    background: var(--green);
    box-shadow: 0 10px 22px rgba(30, 139, 104, 0.2);
}

.button-primary:hover {
    background: var(--green-dark);
    box-shadow: 0 13px 27px rgba(30, 139, 104, 0.25);
}

.button-primary:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
}

.button-secondary {
    min-height: 42px;
    padding: 0 15px;
    border: 1px solid #c8d8d1;
    color: var(--green-dark);
    background: white;
    box-shadow: none;
}

.button-secondary:hover {
    border-color: var(--green);
    background: var(--green-soft);
}

.button-secondary:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.button-quiet {
    color: var(--muted);
    background: transparent;
}

.validation-summary:empty,
.validation-summary.validation-summary-valid {
    display: none;
}

.validation-summary {
    padding: 15px 18px;
    border: 1px solid #efc1ba;
    border-radius: 12px;
    color: #8e302e;
    background: #fff0ed;
    font-size: 0.83rem;
}

.validation-summary ul {
    margin: 0;
    padding-left: 20px;
}

.site-footer {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 0 20px 30px;
    color: #84918d;
    font-size: 0.7rem;
}

/* Contract */
.compact-intro {
    margin-bottom: 26px;
}

.contract-page {
    max-width: 920px;
}

.review-strip {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    align-items: center;
    gap: 24px;
    margin-bottom: 22px;
    padding: 19px 23px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(24, 56, 47, 0.05);
}

.review-strip.parent-only {
    grid-template-columns: 1fr auto;
}

.review-strip strong,
.review-label {
    display: block;
}

.review-strip strong {
    margin-top: 4px;
    font-size: 0.88rem;
}

.review-label,
.document-label {
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.review-participants > div {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 5px;
}

.participant-chip {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    color: #5d4b18;
    background: #fff2c9;
    font-size: 0.7rem;
    font-weight: 750;
}

.contract-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.contract-heading-row h2 {
    margin: 5px 0 0;
}

.contract-copy {
    height: 330px;
    overflow-y: auto;
    padding: 23px 25px;
    border: 1px solid var(--line);
    border-radius: 14px;
    outline: none;
    color: #354b46;
    background: #fafbf9;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.94rem;
    line-height: 1.75;
    white-space: pre-wrap;
    scrollbar-color: #a9bbb4 transparent;
    scrollbar-width: thin;
}

.contract-copy:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(30, 139, 104, 0.1);
}

.scroll-note {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 0.7rem;
    text-align: center;
}

.signature-card .section-heading {
    margin-bottom: 19px;
}

.signature-pad {
    position: relative;
    height: 220px;
    overflow: hidden;
    border: 1.5px dashed #a9bcb4;
    border-radius: 14px;
    background:
        linear-gradient(to bottom, transparent 68%, rgba(23, 50, 45, 0.025) 68%),
        #fbfcfb;
}

.signature-pad canvas {
    position: absolute;
    z-index: 2;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
}

.signature-line {
    position: absolute;
    right: 8%;
    bottom: 48px;
    left: 8%;
    height: 1px;
    background: #9fb1ab;
}

.sign-here {
    position: absolute;
    bottom: 25px;
    left: 8%;
    color: #94a39f;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.signature-pad.has-signature .sign-here {
    opacity: 0;
}

.signature-tools {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 34px;
}

.clear-signature {
    padding: 8px 2px;
    color: var(--green-dark);
}

.consent-check {
    position: relative;
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 12px;
    align-items: start;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 13px;
    color: #3d514c;
    background: #f8faf8;
    cursor: pointer;
    font-size: 0.78rem;
    line-height: 1.55;
}

.consent-check input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.checkmark {
    display: grid;
    width: 21px;
    height: 21px;
    margin-top: 1px;
    place-items: center;
    border: 1.5px solid #9cafaa;
    border-radius: 6px;
    background: white;
}

.consent-check input:focus-visible + .checkmark {
    box-shadow: 0 0 0 4px rgba(30, 139, 104, 0.16);
}

.consent-check input:checked + .checkmark {
    border-color: var(--green);
    background: var(--green);
}

.consent-check input:checked + .checkmark::after {
    color: white;
    content: "✓";
    font-size: 0.82rem;
    font-weight: 900;
}

.consent-error {
    margin-left: 2px;
}

.contract-actions {
    padding-top: 2px;
}

/* Success */
.success-shell {
    display: grid;
    min-height: calc(100vh - 160px);
    padding: 70px 20px;
    place-items: center;
}

.success-card {
    width: min(100%, 590px);
    padding: 54px 48px 46px;
    text-align: center;
}

.success-burst {
    position: relative;
    display: grid;
    width: 82px;
    height: 82px;
    margin: 0 auto 26px;
    place-items: center;
    border-radius: 30px;
    color: white;
    background: var(--green);
    box-shadow: 0 0 0 10px var(--green-soft), 0 18px 35px rgba(30, 139, 104, 0.2);
    transform: rotate(-4deg);
}

.success-burst span {
    font-size: 2rem;
    font-weight: 900;
    transform: rotate(4deg);
}

.success-card h1 {
    margin-bottom: 14px;
    font-size: clamp(2.2rem, 8vw, 3.2rem);
}

.success-card > p {
    max-width: 440px;
    margin: 0 auto 28px;
    color: var(--muted);
    line-height: 1.65;
}

.confirmation-details {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    margin: 0 0 30px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f9faf9;
    text-align: left;
}

.confirmation-details div {
    padding: 2px 13px;
}

.confirmation-details div + div {
    border-left: 1px solid var(--line);
}

.confirmation-details dt {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.confirmation-details dd {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 800;
}

.member-qr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 148px;
    align-items: center;
    gap: 18px;
    margin: 0 0 30px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--green-soft);
    text-align: left;
}

.member-qr .eyebrow {
    margin-bottom: 6px;
}

.member-qr h2 {
    margin-bottom: 6px;
    font-size: 1.05rem;
}

.member-qr p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

.member-qr-image {
    display: block;
    width: 148px;
    height: 148px;
    padding: 8px;
    border-radius: 10px;
    background: white;
}

.member-qr-value {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 0.7rem !important;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.error-card {
    padding-top: 48px;
}

@media (max-width: 760px) {
    .site-header {
        min-height: 86px;
        padding: 8px 14px;
    }

    .brand-logo {
        width: 178px;
        height: 68px;
    }

    .secure-label {
        font-size: 0;
    }

    .page-shell {
        width: min(100% - 28px, 960px);
        padding-top: 38px;
    }

    .intro-row {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .progress-steps {
        width: 100%;
        min-width: 0;
    }

    .form-card {
        padding: 22px 18px;
        border-radius: 18px;
    }

    .field-grid,
    .minor-fields {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .minors-heading {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .minors-heading .add-minor {
        width: 100%;
        margin: 2px 0 0 62px;
    }

    .minor-card {
        padding: 18px 15px;
    }

    .form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .form-actions p {
        text-align: center;
    }

    .button-primary {
        width: 100%;
    }

    .review-strip {
        grid-template-columns: 1fr auto;
    }

    .review-participants {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .edit-link {
        grid-column: 2;
        grid-row: 1;
    }

    .contract-copy {
        height: 370px;
        padding: 20px 18px;
    }

    .contract-actions {
        flex-direction: column-reverse;
    }

    .contract-actions .button-quiet {
        width: 100%;
    }

    .success-card {
        padding: 46px 22px 34px;
    }

    .confirmation-details {
        grid-template-columns: 1fr;
    }

    .member-qr {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .member-qr-image {
        margin: 0 auto;
    }

    .member-qr-value {
        grid-column: auto;
    }

    .confirmation-details div + div {
        margin-top: 12px;
        padding-top: 14px;
        border-top: 1px solid var(--line);
        border-left: 0;
    }
}

@media (max-width: 430px) {
    .brand-logo {
        width: 155px;
        height: 62px;
    }

    h1 {
        font-size: 2.45rem;
    }

    .progress-steps strong {
        font-size: 0.66rem;
    }

    .section-heading {
        align-items: flex-start;
    }

    .heading-line {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .site-footer {
        flex-direction: column;
        align-items: center;
        gap: 3px;
    }

    .site-footer span[aria-hidden] {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Protected database administration */
.admin-page {
    width: min(100% - 40px, 820px);
}

.admin-title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.admin-title-row h1 {
    margin-bottom: 10px;
    font-size: clamp(2.15rem, 6vw, 3.25rem);
}

.admin-title-row p {
    max-width: 590px;
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.admin-card {
    margin-top: 22px;
}

.admin-login-card {
    max-width: 560px;
    margin-right: auto;
    margin-left: auto;
}

.admin-notice,
.security-callout {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 18px 0;
    padding: 16px 18px;
    border: 1px solid #b8ddd0;
    border-radius: 14px;
    color: #175943;
    background: #edf9f4;
    font-size: 0.83rem;
    line-height: 1.5;
}

.security-callout > span {
    display: grid;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    color: white;
    background: var(--green);
    font-weight: 900;
}

.security-callout strong {
    display: block;
    margin-bottom: 3px;
}

.security-callout p {
    margin: 0;
    color: #41685c;
}

.admin-options {
    display: grid;
    gap: 10px;
    padding: 17px 18px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #f8faf9;
}

.admin-options label {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #3d514c;
    font-size: 0.8rem;
    font-weight: 700;
}

.admin-options input {
    width: 18px;
    height: 18px;
    accent-color: var(--green);
}

.admin-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.split-actions {
    justify-content: space-between;
}

@media (max-width: 620px) {
    .admin-title-row,
    .split-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-title-row .button,
    .split-actions .button,
    .admin-actions .button {
        width: 100%;
    }
}
