/* Pukka – Win a Wellness Retreat to Bali
   Layout follows the 1080 × 1920 PSD; 1 design px = 100cqw / 1080. */

:root {
    --green: #13411f;
    --green-600: #1d5a2d;
    --ink: #1a2e1f;
    --muted: #5d6b60;
    --red: #e3262c;
    --cream: #f2dcae;
    --white: #ffffff;
    --radius-field: 8px;
    --font: "Figtree", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
    color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    font-family: var(--font);
    color: var(--ink);
    background: var(--cream) url("../img/bg.jpg") center bottom / cover no-repeat;
    -webkit-font-smoothing: antialiased;
}
@supports (background-image: image-set(url("x.webp") type("image/webp"))) {
    body { background-image: image-set(url("../img/bg.webp") type("image/webp"), url("../img/bg.jpg") type("image/jpeg")); }
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); }

/* ---------- Page column ---------- */
.page {
    container-type: inline-size;
    width: 100%;
    max-width: 680px;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}
.main { flex: 1 0 auto; padding: 0 max(14px, 3.9cqw); }

/* ---------- Header ---------- */
.hero { text-align: center; padding-top: 2.5cqw; }
.hero__logo { display: inline-block; width: 33.6cqw; }
.hero__logo img { width: 100%; }
.hero__headline { margin: 4.1cqw auto 0; width: 58.5cqw; }
.hero__headline img { width: 100%; }

/* ---------- Card ---------- */
.card {
    position: relative;
    z-index: 2;
    margin-top: 8.1cqw;
    background: var(--white);
    border: 2px solid var(--green);
    border-radius: clamp(14px, 2.8cqw, 22px);
    box-shadow: 0 6px 24px rgba(51, 34, 0, .14);
    padding: clamp(18px, 4.2cqw, 30px) clamp(16px, 4.2cqw, 30px) clamp(18px, 3.4cqw, 26px);
}
.card__title {
    margin: 0 0 12px;
    font-size: clamp(24px, 4.6cqw, 32px);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .01em;
    color: var(--green);
    text-align: center;
}
.card--message { text-align: center; font-size: 17px; line-height: 1.6; }
.card--message p { margin: 0 auto; max-width: 30em; }

/* ---------- Form ---------- */
.form-grid {
    display: grid;
    grid-template-columns: 1.32fr 1fr;     /* the PSD's asymmetric columns */
    column-gap: clamp(14px, 4.35cqw, 30px);
    row-gap: clamp(10px, 2.2cqw, 16px);
}
.field { min-width: 0; }
.field--full { grid-column: 1 / -1; }

.field label,
.checkbox label {
    display: block;
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
}
.req { color: var(--red); }

.field input[type="text"],
.field input[type="tel"],
.field input[type="email"] {
    width: 100%;
    height: 46px;
    padding: 0 12px;
    font: 500 16px/1 var(--font);           /* 16px stops iOS zooming on focus */
    color: var(--ink);
    background: var(--white);
    border: 2px solid var(--green);
    border-radius: var(--radius-field);
    outline: none;
    transition: box-shadow .15s, border-color .15s;
    appearance: none;
}
.field input:focus { box-shadow: 0 0 0 4px rgba(19, 65, 31, .16); }

.field__error {
    margin: 5px 0 0;
    min-height: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--red);
}
.field__error:empty { display: none; }
.field__hint { margin: 5px 0 0; font-size: 12.5px; color: var(--muted); }
.is-invalid .field__hint { display: none; }
.is-invalid input[type="text"],
.is-invalid input[type="tel"],
.is-invalid input[type="email"],
.is-invalid .file-input { border-color: var(--red); }

/* File picker styled as the PSD's input with "Choose Files" button */
.file-input {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 5px 0 12px;
    border: 2px solid var(--green);
    border-radius: var(--radius-field);
    background: var(--white);
    cursor: pointer;
    transition: box-shadow .15s;
}
.file-input:focus-within { box-shadow: 0 0 0 4px rgba(19, 65, 31, .16); }
.file-input input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.file-input__names {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 14px;
    color: #8a948c;
}
.file-input.has-files .file-input__names { color: var(--ink); font-weight: 600; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border: 0;
    border-radius: 6px;
    background: var(--green);
    color: var(--white);
    font-family: var(--font);
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s, transform .1s;
}
.btn:hover { background: var(--green-600); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(19, 65, 31, .35); outline-offset: 2px; }
.btn--small { flex: none; height: 32px; padding: 0 18px; font-size: 14px; pointer-events: none; }
.file-input:hover .btn--small { background: var(--green-600); }

/* Checkbox + submit row */
.form-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 20px;
    margin-top: clamp(16px, 3.4cqw, 26px);
}
.checkbox {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 10px;
}
.checkbox input {
    appearance: none;
    width: 22px;
    height: 22px;
    margin: 0;
    border: 2px solid var(--ink);
    border-radius: 4px;
    background: var(--white);
    display: grid;
    place-content: center;
    cursor: pointer;
}
.checkbox input::after {
    content: "";
    width: 12px;
    height: 7px;
    border: 3px solid var(--white);
    border-top: 0;
    border-right: 0;
    transform: rotate(-45deg) translate(1px, -1px);
    opacity: 0;
}
.checkbox input:checked { background: var(--green); border-color: var(--green); }
.checkbox input:checked::after { opacity: 1; }
.checkbox input:focus-visible { outline: 3px solid rgba(19, 65, 31, .35); outline-offset: 2px; }
.checkbox label { margin: 0; font-size: clamp(16px, 2.1cqw, 17px); font-weight: 600; cursor: pointer; }
.checkbox label a { color: var(--green); font-weight: 800; text-decoration: none; }
.checkbox label a:hover { text-decoration: underline; }
.checkbox .field__error { grid-column: 1 / -1; }
.checkbox.is-invalid input { border-color: var(--red); }

.btn--submit {
    min-width: 150px;
    height: 48px;
    padding: 0 34px;
    font-size: 17px;
    letter-spacing: .02em;
    border-radius: 8px;
}
.btn__progress {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--progress, 0%);
    background: rgba(255, 255, 255, .18);
    transition: width .2s;
}
.btn__label { position: relative; z-index: 1; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading .btn__label::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 10px;
    vertical-align: -2px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.form-alert {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #fdecec;
    border: 1px solid #f3b4b6;
    color: #a3161b;
    font-size: 15px;
    font-weight: 600;
}

/* Honeypot (hidden from people, visible to naive bots) */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Thank you ---------- */
.card--thanks {
    margin: 6.1cqw auto 0;
    width: 84.1cqw;
    max-width: 100%;
    min-height: 56.5cqw;
    border-width: 3px;
    border-radius: clamp(26px, 5.6cqw, 40px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 9cqw 6cqw;
}
.thanks__title {
    margin: 0;
    font-size: clamp(26px, 6.9cqw, 50px);
    line-height: 1.25;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--green);
}
.thanks__meta { margin: 22px 0 0; font-size: 16px; line-height: 1.55; color: var(--ink); }
.thanks__meta strong { color: var(--green); letter-spacing: .04em; white-space: nowrap; }
.thanks__links { margin: 14px 0 0; font-size: 15px; font-weight: 600; }

/* ---------- Terms ---------- */
.card--terms { padding: clamp(20px, 5cqw, 40px); }
.card--terms .card__title { margin-top: 6px; }
.terms__back { margin: 0; font-size: 14px; font-weight: 600; }
.terms__back a { text-decoration: none; }
.terms__lead { margin: 0 0 22px; text-align: center; color: var(--muted); font-weight: 600; }
.terms__updated { margin: 28px 0 0; font-size: 13px; color: var(--muted); }
.prose { font-size: 15.5px; line-height: 1.65; color: #2a3a2e; }
.prose h2 { margin: 26px 0 8px; font-size: 18px; font-weight: 800; color: var(--green); }
.prose p, .prose ul, .prose ol { margin: 0 0 12px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 6px; }
.prose li > ul { margin: 6px 0 0; list-style: disc; }
.prose ol > li::marker { font-weight: 700; color: var(--green); }
.page-terms .main { padding-bottom: 32px; }

/* ---------- Bottom scene ---------- */
.scene {
    position: relative;
    z-index: 1;
    margin-top: -4.4cqw;          /* card overlaps the hazy top of the artwork, as in the PSD */
    flex: none;
}
.scene__art {
    width: 100%;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 15%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 15%);
}
.scene__tagline {
    position: absolute;
    z-index: 2;
    top: 11.6cqw;
    left: 50%;
    width: 83.4cqw;
    transform: translateX(-50%);
}
.page-thanks .scene { margin-top: 1.5cqw; }
.page-thanks .scene__tagline { top: 7.2cqw; }

/* Wider screens: soften the artwork's side edges into the background */
@media (min-width: 700px) {
    body { position: relative; }
    body::after {               /* match the artwork's darker foreground grass across the full width */
        content: "";
        position: absolute;
        inset: auto 0 0 0;
        height: 34vw;
        max-height: 520px;
        background: linear-gradient(to bottom, rgba(45, 30, 5, 0) 0%, rgba(45, 30, 5, .35) 55%, rgba(30, 20, 3, .75) 100%);
        pointer-events: none;
        z-index: 0;
    }
    .page { position: relative; z-index: 1; }
    .scene__art {
        -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 15%), linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
        -webkit-mask-composite: source-in;
        mask-image: linear-gradient(to bottom, transparent 0, #000 15%), linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
        mask-composite: intersect;
    }
}

/* ---------- Footer ---------- */
.site-footer {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 10px;
    padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
    font-size: 13px;
    color: var(--ink);
}
.site-footer a { color: inherit; font-weight: 600; }
.scene + .site-footer {
    margin-top: -46px;
    color: rgba(255, 255, 255, .9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}

/* ---------- Small phones ---------- */
@media (max-width: 340px) {
    .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .form-footer { flex-direction: column; align-items: stretch; }
    .btn--submit { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation-duration: .01ms !important; }
}
