/* =========================================================
   GAV · Semana do Cliente — Salinópolis
   ========================================================= */

:root {
    --color-navy: #0b306b;
    --color-navy-deep: #071f47;
    --color-cream: #fcf7df;
    --color-white: #ffffff;
    --color-black: #000000;
    --color-gold-100: #f3e2b3;
    --color-gold-300: #d9b76a;
    --color-gold-500: #c19a4c;
    --color-gold-700: #96742f;
    --color-terracotta: #b9793f;
    --color-ink: #2a2a2a;
    --color-error: #ff8a80;
    --color-form-bg: #053f9b;
    --color-btn: #ba8c5a;

    --font-display: "fraunces", Georgia, "Times New Roman", serif;
    --font-sans: "motiva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

    --container-w: 1180px;
    --radius-lg: 28px;
    --radius-md: 16px;
    --radius-sm: 10px;

    --ease-luxe: cubic-bezier(0.16, 1, 0.3, 1);
    --dur-base: 0.9s;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100dvh;
    background-color: var(--color-navy);
    color: var(--color-white);
    font-family: var(--font-sans);
    font-weight: 400;
    line-height: 1.5;
    position: relative;
    overflow-x: hidden;
}
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; }
a { color: inherit; }
ul { margin: 0; padding: 0; }

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

.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    background: var(--color-cream);
    color: var(--color-navy-deep);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    z-index: 1000;
    font-weight: 700;
    transition: top 0.2s var(--ease-luxe);
}
.skip-link:focus { top: 1rem; }

:focus-visible {
    outline: 2px solid var(--color-gold-300);
    outline-offset: 3px;
}

.container {
    width: 100%;
    max-width: var(--container-w);
    margin-inline: auto;
    padding-inline: 1.5rem;
}

/* ---------- Background hero image (fixed at the back of the whole site) ---------- */
.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    line-height: 0;
    z-index: 0;
    pointer-events: none;
    user-select: none;
}
.hero-bg img {
    width: 100%;
    height: auto;
}

/* Every content layer sits above the background image */
.site-header,
main,
.site-footer {
    position: relative;
    z-index: 1;
}

/* ---------- Header ---------- */
.site-header {
    padding: clamp(1.5rem, 4vw, 3rem) 0 0;
    text-align: center;
}
.site-logo {
    width: min(320px, 62vw);
    height: auto;
    margin-inline: auto;
}

/* ---------- Hero ---------- */
.hero { padding-bottom: clamp(3rem, 8vw, 5rem); }
.hero__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: clamp(1.5rem, 5vw, 3rem);
}

.hero__eyebrow {
    font-family: var(--font-sans);
    font-weight: 300;
    letter-spacing: 0.5em;
    text-indent: 0.5em;
    font-size: clamp(0.75rem, 1.6vw, 1rem);
    color: var(--color-white);
    text-transform: uppercase;
}

.hero__title {
    font-family: var(--font-display);
    font-optical-sizing: auto;
    font-weight: 700;
    font-size: clamp(3.5rem, 12vw, 6rem);
    line-height: 0.95;
    color: var(--color-cream);
    letter-spacing: 0.01em;
    text-transform: uppercase;
    text-wrap: balance;
}

.pill {
    display: inline-block;
    margin-top: 1.1rem;
    padding: 0.5em 1.4em;
    background: var(--color-cream);
    border-radius: 999px;
    font-size: clamp(0.7rem, 1.4vw, 0.85rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--color-navy);
}

.hero__badge {
    display: block;
    margin: 1.75rem auto 0;
    width: min(280px, 60vw);
    height: auto;
}

.hero__dates {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    color: var(--color-white);
    margin-top: 1.25rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.hero__text {
    max-width: 34rem;
    margin: 0.85rem auto 0;
    font-size: clamp(0.9rem, 1.6vw, 1rem);
    color: rgba(255, 255, 255, 0.88);
    font-weight: 600;
    line-height: 1.3;
}

/* ---------- Form card ---------- */
.form-card {
    margin: clamp(2.5rem, 6vw, 3.5rem) auto 0;
    max-width: 900px;
    width: 100%;
    background: var(--color-form-bg);
    border-radius: 0;
    box-shadow:
        0 30px 60px -20px rgba(0, 0, 0, 0.45),
        0 10px 24px -12px rgba(0, 0, 0, 0.3);
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    overflow: hidden;
    text-align: left;
}

.form-card__photo { position: relative; }
.form-card__photo picture,
.form-card__photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.form-card__content {
    padding: clamp(1.1rem, 3vw, 1.5rem);
    display: flex;
    flex-direction: column;
    color: var(--color-cream);
}

.form-card__title {
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: 1.1rem;
    line-height: 1.35;
    color: var(--color-white);
    margin-bottom: 0.9rem;
}
.form-card__title strong { font-weight: 700; }

#lead-form { display: flex; flex-direction: column; }

.field { margin-bottom: 0.6rem; display: flex; flex-direction: column; }
.field label {
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(252, 247, 223, 0.85);
    margin-bottom: 0.25rem;
}
.field input {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    padding: 0.6em 0.8em;
    border: 1.5px solid #d9dce3;
    border-radius: var(--radius-sm);
    background: #fbfbfd;
    color: var(--color-ink);
    transition: border-color 0.2s var(--ease-luxe), box-shadow 0.2s var(--ease-luxe);
}
.field input:hover { border-color: #b9bfcc; }
.field input:focus {
    outline: none;
    border-color: var(--color-gold-500);
    box-shadow: 0 0 0 4px rgba(193, 154, 76, 0.18);
}
.field input:user-invalid,
.field input.is-invalid {
    border-color: var(--color-error);
}

.field__error {
    display: block;
    min-height: 1.1em;
    font-size: 0.75rem;
    color: var(--color-error);
    margin-top: 0.3rem;
}

.hp-field {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.btn-submit {
    position: relative;
    margin-top: 0.3rem;
    border: none;
    border-radius: 999px;
    max-width: 300px;
    min-width: 300px;
    padding: 0.60em 1.5em;
    background: var(--color-btn);
    color: var(--color-navy-deep);
    font-weight: 700;
    font-size: 1.2rem;
    margin: 20px auto 0;
    letter-spacing: 0.03em;
    cursor: pointer;
    box-shadow: 0 12px 24px -10px rgba(150, 116, 47, 0.55);
    transition: transform 0.25s var(--ease-luxe), box-shadow 0.25s var(--ease-luxe), filter 0.25s var(--ease-luxe);
}
.btn-submit:hover { transform: translateY(-2px); filter: brightness(1.04); }
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled {
    cursor: not-allowed;
    filter: grayscale(0.3) brightness(0.95);
    transform: none;
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.3rem;
    font-size: 0.7rem;
    line-height: 1.45;
    color: rgba(252, 247, 223, 0.85);
    cursor: pointer;
}
.checkbox input {
    margin-top: 0.15em;
    width: 15px;
    height: 15px;
    accent-color: var(--color-gold-500);
    flex-shrink: 0;
}

/* ---------- Toast (popup de sucesso/erro do formulário) ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    width: min(420px, calc(100vw - 2rem));
    padding: 1rem 1.1rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-gold-500);
    background: var(--color-navy-deep);
    color: var(--color-white);
    box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.55);
    opacity: 0;
    transform: translate(-50%, 12px);
    pointer-events: none;
    transition: opacity 0.3s var(--ease-luxe), transform 0.3s var(--ease-luxe);
}
.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}
.toast[data-state="success"] { border-left-color: #8fe3ab; }
.toast[data-state="error"] { border-left-color: var(--color-error); }
.toast__message {
    flex: 1 1 auto;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.45;
}
.toast__close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: var(--color-cream);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.1rem 0.25rem;
    opacity: 0.75;
    transition: opacity 0.2s var(--ease-luxe);
}
.toast__close:hover { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
    .toast { transition: opacity 0.2s linear; transform: translate(-50%, 0); }
}

.link-regulamento {
    display: inline-block;
    margin-top: 2.25rem;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-cream);
    text-decoration: underline;
    text-underline-offset: 4px;
    opacity: 0.9;
    transition: opacity 0.2s var(--ease-luxe);
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
}
.link-regulamento:hover { opacity: 1; }

/* ---------- Modal do regulamento ---------- */
.modal {
    border: none;
    padding: 0;
    width: min(720px, 92vw);
    max-height: 85vh;
    background: var(--color-navy-deep);
    color: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}
.modal:not([open]) { display: none; }
.modal[open] {
    display: flex;
    flex-direction: column;
}
.modal::backdrop {
    background: rgba(4, 12, 30, 0.72);
    backdrop-filter: blur(2px);
}

.modal__header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem clamp(1.5rem, 4vw, 2.5rem);
    border-bottom: 1px solid rgba(252, 247, 223, 0.15);
}
.modal__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.15rem, 2.8vw, 1.5rem);
    color: var(--color-cream);
    margin: 0;
}
.modal__close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(252, 247, 223, 0.08);
    border: none;
    color: var(--color-cream);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s var(--ease-luxe);
}
.modal__close:hover { background: rgba(252, 247, 223, 0.18); }

.modal__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.modal__footer {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    padding: 1rem clamp(1.5rem, 4vw, 2.5rem);
    border-top: 1px solid rgba(252, 247, 223, 0.15);
}

.btn-modal-close {
    border: none;
    border-radius: 999px;
    padding: 0.65em 1.85em;
    background: var(--color-btn);
    color: var(--color-navy-deep);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: transform 0.2s var(--ease-luxe), filter 0.2s var(--ease-luxe);
}
.btn-modal-close:hover { transform: translateY(-1px); filter: brightness(1.05); }

/* ---------- Footer ---------- */
.site-footer {
    padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(2rem, 5vw, 3rem);
    text-align: center;
    padding-bottom: 0;
}
.site-footer__logo {
    width: min(220px, 48vw);
    height: auto;
    margin-inline: auto;
}
.site-footer::after {
    content: "";
    display: block;
    margin-top: clamp(1.5rem, 4vw, 2.25rem);
    height: 30px;
    width: 100%;
    background: linear-gradient(90deg, var(--color-terracotta), var(--color-gold-300));
}

/* ---------- Scroll reveal ---------- */
[data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity var(--dur-base) var(--ease-luxe), transform var(--dur-base) var(--ease-luxe);
    transition-delay: calc(var(--reveal-delay, 0) * 90ms);
}
[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}
.form-card[data-reveal] { transform: translateY(36px) scale(0.98); }
.form-card[data-reveal].is-visible { transform: translateY(0) scale(1); }

@media (prefers-reduced-motion: reduce) {
    [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .form-card {
        grid-template-columns: 1fr;
        max-width: 450px;
    }
    .form-card__photo picture,
    .form-card__photo img {
        height: auto;
        aspect-ratio: 4 / 3;
    }
}

@media (min-width: 641px) and (max-width: 900px) {
    .hero__title { font-size: clamp(4rem, 14vw, 6rem); }
}

/* ---------- Regulamento page ---------- */
.regulamento {
    max-width: 760px;
    margin: 0 auto;
    padding: clamp(2rem, 6vw, 4rem) 0 4rem;
    color: var(--color-white);
}
.regulamento h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 2.75rem);
    color: var(--color-cream);
    margin-bottom: 1.5rem;
}
.regulamento h2 {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    margin-top: 2rem;
    margin-bottom: 0.6rem;
    color: var(--color-gold-100);
}
.regulamento p, .regulamento li { color: rgba(255,255,255,0.88); line-height: 1.7; }
.regulamento p { margin-bottom: 1rem; }
.regulamento p:last-child { margin-bottom: 0; }
.regulamento ol, .regulamento ul { padding-left: 1.25rem; }
.regulamento a.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    color: var(--color-cream);
    text-decoration: underline;
}

.modal__body.regulamento {
    max-width: none;
    margin: 0;
    padding: 20px;
}
