﻿@font-face {
    font-family: "Inter Tight";
    src: url("../fonts/InterTight-Variable.ttf") format("truetype");
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "Be Vietnam Pro";
    src: url("../fonts/BeVietnamPro-Bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}

:root {
    color-scheme: light;
    font-family: "Inter Tight", system-ui, sans-serif;
    color: #251e1b;
    background: #fcf8f2;
    accent-color: #b31024;
    --red: #a30c1e;
    --line: #eee6de;
}

* { box-sizing: border-box; }
body { margin: 0; }
.page {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 53fr) minmax(0, 47fr);
    min-height: 100dvh;
}

.apricot-branch { display: none; }

.registration {
    grid-area: 1 / 1;
    width: 100%;
    max-width: 58rem;
    justify-self: end;
    padding: clamp(1.75rem, 3vw, 3.25rem) clamp(1.5rem, 4.25vw, 4.75rem);
}
.hero { margin-bottom: 1.6rem; }
.hero p {
    display: inline-block;
    margin: 0 0 .6rem;
    padding: .35rem .9rem;
    border-radius: 999px;
    background: #f7dfd9;
    color: var(--red);
    font-weight: 700;
}
h1 {
    width: fit-content;
    margin: 0;
    color: #900b1b;
    font-family: "Be Vietnam Pro", system-ui, sans-serif;
    font-size: clamp(2.25rem, 3.35vw, 4rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: normal;
}
.hero-year { white-space: nowrap; font-variant-numeric: lining-nums; }
.hero-swoosh {
    display: block;
    width: clamp(7rem, 16vw, 17rem);
    height: .9rem;
    margin: .15rem 0 0 auto;
    fill: #efb91f;
}

.photo {
    grid-area: 1 / 2;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100dvh;
    overflow: hidden;
    background: #376355;
    clip-path: polygon(
        5% 0, 100% 0, 100% 100%, 4% 100%,
        2.6% 88%, 1.5% 76%, .8% 64%, .6% 52%, .9% 40%, 1.6% 28%, 2.8% 16%
    );
    clip-path: shape(
        from 5% 0,
        line to 100% 0,
        line to 100% 100%,
        line to 4% 100%,
        curve to 5% 0 with -.7% 68% / -1.1% 34%,
        close
    );
}
.photo picture { display: block; height: 100%; }
.photo-wave { display: none; }
.photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 52% center;
}

h2 { margin: 0 0 .8rem; color: var(--red); font-size: 1.25rem; line-height: 1.3; }
.panel, .success {
    margin-bottom: .8rem;
    padding: 1rem clamp(.9rem, 1.65vw, 1.5rem);
    border: 1px solid var(--line);
    border-radius: .9rem;
    background: #fffdf9;
}
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem clamp(.8rem, 1.75vw, 1.6rem); }
.count-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; }
.count-grid > div { display: flex; flex-direction: column; }
.count-grid label { flex: 1; }
label, legend { display: block; margin-bottom: .35rem; font-size: .9rem; }
label { font-weight: 700; }
.required-mark { color: var(--red); }
input:not([type="radio"]) {
    display: block;
    width: 100%;
    min-height: 2.65rem;
    padding: .5rem .7rem;
    border: 1px solid #d7cec7;
    border-radius: .5rem;
    background: #fff;
    color: inherit;
    font: inherit;
}
input::placeholder { color: #69615d; opacity: 1; }
:focus-visible { outline: 2px solid #a30c1e; outline-offset: 2px; }
.hint { margin: 0 0 .75rem; color: #5e534d; font-size: .9rem; }
.total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: .8rem;
    padding: .55rem .85rem;
    border-radius: .55rem;
    background: #f8e2de;
    color: var(--red);
    font-weight: 700;
}
.total output { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
fieldset + fieldset, #donor-field { margin-top: .8rem; }
.choices { display: flex; flex-wrap: wrap; gap: 1.35rem; }
.choices label { display: flex; align-items: center; gap: .45rem; margin: 0; min-height: 2rem; font-weight: 400; cursor: pointer; }
.choices input { width: 1.15rem; height: 1.15rem; margin: 0; }
button, .success a {
    display: inline-block;
    padding: .8rem 1.5rem;
    border: 0;
    border-radius: .65rem;
    background: linear-gradient(180deg, #c31e2c, #a20b20);
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
button { width: 100%; }
button:hover, .success a:hover { background: #910c1c; }

.validation-summary-valid, .field-validation-valid { display: none; }
.validation-summary-errors { margin-bottom: .8rem; padding: .75rem 1rem; border: 1px solid #9b2233; border-radius: .6rem; background: #fff8f7; }
.validation-summary-errors ul { margin: 0; padding-left: 1.25rem; }
.field-validation-error { display: block; margin-top: .35rem; font-size: .875rem; }
.field-validation-error, .validation-summary-errors { color: var(--red); }

@media (max-width: 64rem) {
    .count-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 50rem) {
    .page { display: block; }
    .registration { max-width: 42rem; margin-inline: auto; padding: .85rem .85rem 1rem; }
    .photo {
        position: relative;
        height: clamp(9.5rem, 36vw, 16rem);
        clip-path: none;
    }
    .photo img { object-position: 50% 30%; }
    .photo-wave {
        position: absolute;
        inset: auto 0 0;
        display: block;
        width: 100%;
        height: clamp(1.5rem, 7vw, 3rem);
    }
    .hero { text-align: center; }
    .hero p { border: 1px solid #f0d3af; }
    .hero h1 { margin-inline: auto; font-size: clamp(1.65rem, 6.1vw, 3rem); }
}

@media (max-height: 56rem), (max-width: 50rem) {
    .registration { padding-block: .8rem; }
    .hero { margin-bottom: .65rem; }
    .hero p { padding: .22rem .65rem; margin-bottom: .28rem; font-size: .875rem; }
    h1 { font-size: clamp(1.65rem, 3.1vw, 3.25rem); }
    h2 { margin-bottom: .35rem; font-size: 1.05rem; }
    .panel { margin-bottom: .45rem; padding-block: .55rem; }
    .grid { gap: .42rem .75rem; }
    label, legend { margin-bottom: .18rem; line-height: 1.25; }
    input:not([type="radio"]) { min-height: 2.25rem; padding: .3rem .55rem; }
    .hint { margin-bottom: .35rem; }
    .total { margin-top: .4rem; padding: .3rem .65rem; }
    fieldset + fieldset, #donor-field { margin-top: .35rem; }
    #donor-field:not([hidden]) + fieldset { margin-top: .35rem; }
    .choices label { min-height: 1.75rem; }
    button { padding-block: .55rem; }
}

@media (max-width: 50rem) {
    .registration .panel { padding-inline: .65rem; }
    .grid { gap: .4rem .6rem; }
    .count-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .count-grid label { font-size: .875rem; }
    input:not([type="radio"]) { text-overflow: ellipsis; }
}

@media (min-width: 50.001rem) {
    .registration {
        display: flex;
        flex-direction: column;
    }

    .registration form {
        display: flex;
        flex: 1;
        flex-direction: column;
        gap: clamp(.45rem, 1.2dvh, 1rem);
    }

    .registration .panel {
        display: grid;
        flex: 1 0 auto;
        align-content: center;
        margin-bottom: 0;
    }

    .registration .validation-summary-errors { margin-bottom: 0; }
}

@media (min-width: 64rem) {
    .apricot-branch {
        position: absolute;
        top: 0;
        left: 0;
        display: block;
        width: clamp(7rem, 10vw, 12rem);
        height: auto;
        pointer-events: none;
    }

    .hero { padding-inline-start: clamp(2.5rem, 5vw, 6rem); }
}
