/* ============================================
   PUGNIC — Estilos principais
   ============================================ */

:root {
    --verde-escuro:  #2e7d32;
    --verde:         #4caf50;
    --verde-claro:   #a5d6a7;
    --vermelho:      #c62828;
    --amarelo:       #f9a825;
    --bege:          #fdf6e3;
    --marrom:        #5d4037;
    --marrom-claro:  #8d6e63;
    --branco:        #ffffff;
    --cinza-borda:   #e0e0e0;
    --sombra:        0 4px 24px rgba(0,0,0,.12);
    --radius:        14px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background-color: var(--bege);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(76,175,80,.08) 0%, transparent 60%),
        radial-gradient(circle at 85% 20%, rgba(249,168,37,.08) 0%, transparent 50%);
    color: #333;
    min-height: 100vh;
}

/* ---- Header ---- */
.site-header {
    background: linear-gradient(135deg, #1b5e20 0%, #388e3c 60%, #558b2f 100%);
    color: white;
    padding: 2rem 1rem 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.site-header::after {
    content: '';
    display: block;
    position: absolute;
    bottom: -2px; left: 0; right: 0;
    height: 40px;
    background: var(--bege);
    clip-path: ellipse(55% 100% at 50% 100%);
}

.header-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.pug-banner {
    width: clamp(160px, 30vw, 240px);
    filter: drop-shadow(0 6px 16px rgba(0,0,0,.35));
    animation: float 4s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-10px); }
}

.header-titulo {
    font-size: clamp(2.4rem, 6vw, 4rem);
    font-weight: 900;
    letter-spacing: .06em;
    text-shadow: 0 3px 8px rgba(0,0,0,.4);
    line-height: 1;
}
.header-subtitulo {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    opacity: .92;
    font-weight: 300;
}

.evento-info {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem 1.4rem;
    justify-content: center;
    font-size: .95rem;
}
.evento-info span {
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 999px;
    padding: .3rem .9rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

/* ---- Layout principal ---- */
.container {
    max-width: 780px;
    margin: 0 auto;
    padding: 2.5rem 1rem 4rem;
}

/* ---- Card do formulário ---- */
.form-card {
    background: var(--branco);
    border-radius: var(--radius);
    box-shadow: var(--sombra);
    overflow: hidden;
}

.form-section {
    padding: 1.8rem 2rem;
    border-bottom: 1px solid var(--cinza-borda);
}
.form-section:last-child { border-bottom: none; }

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--verde-escuro);
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1.2rem;
}
.section-title .icon {
    font-size: 1.4rem;
}

/* ---- Fields ---- */
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 540px) {
    .field-row { grid-template-columns: 1fr; }
    .form-section { padding: 1.4rem 1.2rem; }
}

.field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-bottom: .8rem;
}
.field.full { grid-column: 1 / -1; }

label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--marrom);
}
label .obrigatorio { color: var(--vermelho); margin-left: .15rem; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select {
    border: 1.5px solid var(--cinza-borda);
    border-radius: 8px;
    padding: .65rem .9rem;
    font-size: .97rem;
    transition: border-color .2s, box-shadow .2s;
    background: #fafafa;
    width: 100%;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--verde);
    box-shadow: 0 0 0 3px rgba(76,175,80,.15);
    background: white;
}
input.erro { border-color: var(--vermelho); }
.msg-erro { font-size: .78rem; color: var(--vermelho); }

/* ---- Lista dinâmica (acompanhantes / pugs) ---- */
.dynamic-list { display: flex; flex-direction: column; gap: .7rem; margin-top: .5rem; }

.dynamic-item {
    display: flex;
    gap: .6rem;
    align-items: flex-end;
    animation: slideIn .25s ease;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dynamic-item .field { flex: 1; margin-bottom: 0; }

.btn-remove {
    background: none;
    border: 1.5px solid var(--vermelho);
    color: var(--vermelho);
    border-radius: 8px;
    width: 38px; height: 38px;
    cursor: pointer;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: background .2s, color .2s;
    display: flex; align-items: center; justify-content: center;
    align-self: flex-end;
    margin-bottom: 0;
}
.btn-remove:hover { background: var(--vermelho); color: white; }

.btn-add {
    background: none;
    border: 1.5px dashed var(--verde);
    color: var(--verde-escuro);
    border-radius: 8px;
    padding: .55rem 1rem;
    cursor: pointer;
    font-size: .9rem;
    font-weight: 600;
    transition: background .2s;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: .4rem;
}
.btn-add:hover { background: rgba(76,175,80,.08); }

/* ---- Pug item (nome + idade lado a lado) ---- */
.pug-item {
    background: #f9f9f9;
    border: 1px solid var(--cinza-borda);
    border-radius: 10px;
    padding: .9rem 1rem;
    position: relative;
    animation: slideIn .25s ease;
}
.pug-item-header {
    font-size: .8rem;
    font-weight: 700;
    color: var(--marrom-claro);
    margin-bottom: .7rem;
    display: flex;
    align-items: center;
    gap: .3rem;
}
.pug-item .btn-remove {
    position: absolute;
    top: .7rem; right: .7rem;
    width: 30px; height: 30px;
    font-size: .95rem;
}
.pug-fields { display: grid; grid-template-columns: 1fr 120px; gap: .8rem; }
@media (max-width: 400px) { .pug-fields { grid-template-columns: 1fr; } }

/* ---- Botão submit ---- */
.btn-submit {
    display: block;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--verde-escuro), var(--verde));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: .03em;
    transition: opacity .2s, transform .15s;
    margin-top: .5rem;
}
.btn-submit:hover:not(:disabled) { opacity: .92; transform: translateY(-1px); }
.btn-submit:disabled { opacity: .6; cursor: not-allowed; }

.btn-submit .spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 3px solid rgba(255,255,255,.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: middle;
    margin-right: .4rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Modal de sucesso ---- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 100;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}
.modal-overlay.ativo { display: flex; }

.modal {
    background: white;
    border-radius: var(--radius);
    padding: 2.2rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: popIn .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes popIn {
    from { transform: scale(.85); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.modal-icone { font-size: 3rem; margin-bottom: .5rem; }
.modal-titulo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--verde-escuro);
    margin-bottom: .4rem;
}
.modal-texto { color: #555; font-size: .95rem; margin-bottom: 1.2rem; }

.modal-qrcode {
    background: #f5f5f5;
    border-radius: 10px;
    padding: 1rem;
    display: inline-block;
    margin-bottom: 1rem;
}
.modal-qrcode img { display: block; width: 200px; height: 200px; }

.modal-info {
    background: var(--verde-claro);
    border-radius: 8px;
    padding: .8rem 1rem;
    font-size: .88rem;
    color: var(--verde-escuro);
    margin-bottom: 1.2rem;
}

.btn-fechar {
    background: var(--verde-escuro);
    color: white;
    border: none;
    border-radius: 8px;
    padding: .7rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s;
}
.btn-fechar:hover { opacity: .85; }

/* ---- Alerta de erro global ---- */
.alerta-erro {
    background: #ffebee;
    border: 1.5px solid #e57373;
    border-radius: 8px;
    padding: .9rem 1.2rem;
    color: #c62828;
    font-size: .93rem;
    margin-bottom: 1rem;
    display: none;
}
.alerta-erro.ativo { display: block; }

/* ---- Footer ---- */
.site-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: .82rem;
    color: var(--marrom-claro);
}

/* ---- Decoração checkered no topo do form-card ---- */
.form-card-header {
    background: repeating-linear-gradient(
        45deg,
        #e53935 0px, #e53935 10px,
        #ffffff 10px, #ffffff 20px
    );
    height: 8px;
}
