@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,500&family=Great+Vibes&display=swap');

:root {
    --creme: #f3ecd9;
    --creme-escuro: #e7dcc0;
    --verde: #5c6b4f;
    --verde-escuro: #3f4a37;
    --texto: #3a3630;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

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

body {
    margin: 0;
    background: var(--creme);
    color: var(--texto);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 19px;
    line-height: 1.5;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px 16px 48px;
}

@media (min-width: 600px) {
    .container { padding: 32px 20px 60px; }
}

/* Página pública (convite): tudo cabe em uma tela, sem scroll. */
body.tela-convite {
    height: 100%;
    overflow: hidden;
}

body.tela-convite .container {
    height: 100dvh;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

@media (min-width: 600px) {
    body.tela-convite .container { padding: 20px; gap: 16px; }
}

.convite-img {
    flex: 1 1 auto;
    min-height: 0;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(63, 74, 55, 0.18);
    display: block;
}

.btn-confirmar {
    flex: 0 0 auto;
    width: 100%;
}

/* Popup de confirmação de presença */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(58, 54, 48, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
}

.modal-overlay.aberto {
    display: flex;
}

.modal-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 100%;
    overflow-y: auto;
}

.modal-fechar {
    position: absolute;
    top: 6px;
    right: 6px;
    width: auto;
    min-height: auto;
    margin: 0;
    padding: 4px 10px;
    background: transparent;
    color: var(--verde-escuro);
    font-size: 26px;
    line-height: 1;
}

.modal-fechar:hover {
    background: transparent;
    color: var(--verde);
}

h1.titulo {
    font-family: 'Great Vibes', cursive;
    text-align: center;
    font-size: 48px;
    color: var(--verde-escuro);
    margin: 28px 0 4px;
    font-weight: 400;
}

p.subtitulo {
    text-align: center;
    margin: 0 0 28px;
    font-size: 20px;
}

.card {
    flex: 0 0 auto;
    width: 100%;
    background: #fffdf8;
    border: 1px solid var(--creme-escuro);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 16px rgba(63, 74, 55, 0.08);
}

.card h2 {
    text-align: center;
    color: var(--verde-escuro);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 20px;
    margin: 0 0 4px;
}

label {
    display: block;
    font-weight: 600;
    margin: 10px 0 4px;
    color: var(--verde-escuro);
}

input[type="text"],
input[type="tel"],
input[type="password"] {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    font-size: 18px; /* >=16px evita zoom automático no iOS Safari */
    font-family: inherit;
    border: 1px solid #c9bfa0;
    border-radius: 8px;
    background: #fff;
    color: var(--texto);
}

input:focus {
    outline: none;
    border-color: var(--verde);
    box-shadow: 0 0 0 3px rgba(92, 107, 79, 0.15);
}

button, .btn {
    display: inline-block;
    width: 100%;
    min-height: 44px;
    margin-top: 14px;
    padding: 13px 18px;
    background: var(--verde);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

button:hover, .btn:hover { background: var(--verde-escuro); }

.honeypot { position: absolute; left: -9999px; top: -9999px; }

.linha-convidado {
    display: flex;
    gap: 8px;
    align-items: center;
}

.linha-convidado input { flex: 1 1 auto; }

.btn-remover-convidado {
    flex: 0 0 auto;
    width: auto;
    min-height: 48px;
    margin-top: 0;
    padding: 0 14px;
    background: transparent;
    border: 1px solid #c9bfa0;
    color: var(--verde-escuro);
    font-size: 22px;
    line-height: 1;
}

.btn-remover-convidado:hover { background: var(--creme-escuro); }

.btn-adicionar {
    background: transparent;
    border: 1px solid var(--verde);
    color: var(--verde-escuro);
}

.btn-adicionar:hover { background: var(--creme-escuro); }

.alerta {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 18px;
    text-align: center;
}

.alerta.sucesso { background: #e6ecdc; color: var(--verde-escuro); border: 1px solid #c3d3ad; }
.alerta.erro { background: #f6e3e0; color: #7a2e24; border: 1px solid #e3b6ae; }

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    background: #fffdf8;
}

th, td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--creme-escuro);
}

th {
    background: var(--creme-escuro);
    color: var(--verde-escuro);
    text-transform: uppercase;
    font-size: 15px;
    letter-spacing: 0.03em;
}

.topo-admin {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.topo-admin a { color: var(--verde-escuro); }

.contador {
    color: var(--texto);
    margin: 4px 0 20px;
}

.wide { max-width: 800px; }
