@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;900&family=Inter:wght@300;400;500;600;700&display=swap');

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

:root {
    --gold: #c9a961;
    --gold-light: #e8d5a3;
    --gold-dark: #a68a4a;
    --dark: #1a1a1a;
    --dark-soft: #2a2a2a;
    --cream: #faf8f3;
    --white: #ffffff;
    --text: #2d2d2d;
    --text-muted: #777;
    --success: #4caf50;
    --danger: #e74c3c;
    --shadow-lg: 0 25px 80px rgba(0,0,0,0.15);
    --shadow-md: 0 10px 40px rgba(0,0,0,0.08);
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--cream);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ============ PÁGINA DE CONFIRMAÇÃO ============ */
.page-invite {
    background: linear-gradient(135deg, #f5f1e8 0%, #faf8f3 40%, #f0ebe0 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
}
.page-invite::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(201,169,97,0.12) 0%, transparent 70%);
    top: -300px; right: -300px;
    border-radius: 50%;
}
.page-invite::after {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(201,169,97,0.08) 0%, transparent 70%);
    bottom: -250px; left: -250px;
    border-radius: 50%;
}

.invite-card {
    background: var(--white);
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    max-width: 620px;
    width: 100%;
    padding: 3.5rem 3rem;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(201,169,97,0.15);
    animation: fadeUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.invite-header { text-align: center; margin-bottom: 2.5rem; }
.invite-ornament {
    width: 60px; height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 0 auto 1.5rem;
}
.invite-eyebrow {
    font-size: 0.75rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--gold-dark);
    font-weight: 600;
    margin-bottom: 0.75rem;
}
.invite-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.2;
    margin-bottom: 1rem;
}
.invite-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 440px;
    margin: 0 auto;
}
.invite-event-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    padding: 1.25rem;
    background: linear-gradient(135deg, #faf8f3, #f5f1e8);
    border-radius: 16px;
    border: 1px solid rgba(201,169,97,0.2);
}
.event-info-item { text-align: center; }
.event-info-item .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gold-dark);
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.event-info-item .value {
    font-family: 'Playfair Display', serif;
    font-size: 0.95rem;
    color: var(--dark);
    font-weight: 600;
}

/* ============ FORMULÁRIO ============ */
.form-group { margin-bottom: 1.5rem; }
.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
    letter-spacing: 0.3px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }

.form-input, .form-select {
    width: 100%;
    padding: 1rem 1.15rem;
    border: 1.5px solid #e5e0d5;
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--cream);
    color: var(--text);
    transition: all 0.25s ease;
    outline: none;
}
.form-input:focus, .form-select:focus {
    border-color: var(--gold);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(201,169,97,0.12);
}
.form-input::placeholder { color: #b5b0a5; }

.form-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

.btn-submit {
    width: 100%;
    padding: 1.1rem;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
    box-shadow: 0 8px 25px rgba(201,169,97,0.35);
}
.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(201,169,97,0.45);
}
.btn-submit:active { transform: translateY(0); }

/* ============ ALERTAS ============ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}
.alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* ============ SUCESSO ============ */
.success-icon {
    width: 80px; height: 80px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    color: white;
    animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
@keyframes popIn {
    0% { transform: scale(0); }
    80% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ============ DASHBOARD ============ */
.dashboard { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    background: var(--dark);
    color: var(--white);
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}
.sidebar-brand {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 0.25rem;
}
.sidebar-sub {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 2.5rem;
}
.sidebar-nav { list-style: none; }
.sidebar-nav li { margin-bottom: 0.5rem; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(201,169,97,0.15);
    color: var(--gold);
}

.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 2.5rem;
    min-height: 100vh;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--dark);
    font-weight: 700;
}
.page-title small {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 0.35rem;
}

/* ===== STATS CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--white);
    border-radius: 18px;
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(201,169,97,0.12);
    position: relative;
    overflow: hidden;
    transition: transform 0.25s;
}
.stat-card:hover { transform: translateY(-3px); }
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: linear-gradient(180deg, var(--gold), var(--gold-dark));
}
.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.75rem;
}
.stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1;
}
.stat-value.gold { color: var(--gold-dark); }
.stat-value.success { color: var(--success); }
.stat-value.danger { color: var(--danger); }

/* ===== TABELA ===== */
.table-card {
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid rgba(201,169,97,0.12);
}
.table-toolbar {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0ebe0;
    flex-wrap: wrap;
    gap: 1rem;
}
.table-toolbar h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    color: var(--dark);
}

.btn {
    padding: 0.65rem 1.25rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(201,169,97,0.3);
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(201,169,97,0.4); }

table { width: 100%; border-collapse: collapse; }
table thead { background: var(--cream); }
table th {
    text-align: left;
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid #f0ebe0;
}
table td {
    padding: 1.1rem 1.5rem;
    font-size: 0.9rem;
    border-bottom: 1px solid #f8f5ed;
    color: var(--text);
}
table tbody tr { transition: background 0.15s; }
table tbody tr:hover { background: var(--cream); }
table tbody tr:last-child td { border-bottom: none; }

.badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-gold { background: rgba(201,169,97,0.15); color: var(--gold-dark); }
.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-danger { background: #ffebee; color: #c62828; }
.badge-warning { background: #fff3d6; color: #a06f00; }

.empty-state {
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-muted);
}
.empty-state h3 {
    font-family: 'Playfair Display', serif;
    color: var(--dark);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

/* ===== LOGIN ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--dark) 0%, #2d2d2d 100%);
    padding: 1rem;
}
.login-card {
    background: var(--white);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

/* ============ CRONÓMETRO ============ */
.countdown {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-radius: 20px;
    padding: 1.75rem 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}
.countdown::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(201,169,97,0.15) 0%, transparent 60%);
    animation: rotate 20s linear infinite;
}
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.countdown-label {
    font-size: 0.7rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 600;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}
.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}
.countdown-box {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(201,169,97,0.3);
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    min-width: 65px;
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(10px);
}
.countdown-box span {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gold-light);
    line-height: 1;
}
.countdown-box small {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.5);
    margin-top: 0.35rem;
    font-weight: 500;
}
.countdown-date {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    position: relative;
    z-index: 1;
    font-style: italic;
}

/* ============ INPUT COM PREFIXO (telefone) ============ */
.input-prefix {
    display: flex;
    align-items: stretch;
    border: 1.5px solid #e5e0d5;
    border-radius: 12px;
    background: var(--cream);
    overflow: hidden;
    transition: all 0.25s ease;
}
.input-prefix:focus-within {
    border-color: var(--gold);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(201,169,97,0.12);
}
.input-prefix .prefix-flag {
    display: flex;
    align-items: center;
    padding: 0 0.9rem;
    background: rgba(201,169,97,0.1);
    border-right: 1.5px solid #e5e0d5;
    font-size: 1.15rem;
}
.input-prefix .form-input {
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 1rem 1.15rem;
    flex: 1;
    min-width: 0;
}
.input-prefix .form-input:focus {
    box-shadow: none;
    background: transparent;
}

/* ============ SELECT WRAPPER (dropdown compacto) ============ */
.select-wrapper {
    position: relative;
    width: 100%;
}
.select-wrapper .form-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 3rem;
    cursor: pointer;
    background: var(--cream);
    background-image: none;
}
.select-wrapper .form-select:focus {
    border-color: var(--gold);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(201,169,97,0.12);
}
.select-wrapper .select-arrow {
    position: absolute;
    right: 1.15rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--gold-dark);
    font-size: 1rem;
    transition: transform 0.2s;
}
.select-wrapper:focus-within .select-arrow {
    transform: translateY(-50%) rotate(180deg);
}
.select-wrapper .form-select option {
    color: var(--text);
    padding: 0.75rem;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 900px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 1.5rem; }
}
@media (max-width: 640px) {
    .invite-card { padding: 2.5rem 1.5rem; }
    .invite-title { font-size: 1.8rem; }
    .invite-event-info { flex-direction: column; gap: 1rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .table-card { overflow-x: auto; }
    table { min-width: 600px; }
}
@media (max-width: 480px) {
    .countdown-box { min-width: 55px; padding: 0.6rem 0.7rem; }
    .countdown-box span { font-size: 1.4rem; }
    .countdown-timer { gap: 0.5rem; }
}
/* ============ PÁGINA SMS ============ */
.sms-card {
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(201,169,97,0.12);
    padding: 2rem;
    margin-bottom: 2rem;
}

.sms-section {
    margin-bottom: 2rem;
}
.sms-section:last-child {
    margin-bottom: 0;
}
.sms-section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.sms-section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--gold), var(--gold-dark));
    border-radius: 2px;
}

/* ===== FILTROS ===== */
.filtros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}
.filtro-btn {
    padding: 0.75rem 1rem;
    border: 1.5px solid #e5e0d5;
    border-radius: 10px;
    background: var(--cream);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-align: center;
}
.filtro-btn:hover {
    border-color: var(--gold);
    background: var(--white);
}
.filtro-btn.active {
    border-color: var(--gold);
    background: linear-gradient(135deg, rgba(201,169,97,0.15), rgba(201,169,97,0.08));
    color: var(--gold-dark);
    font-weight: 600;
}

/* ===== LISTA DE CONTACTOS ===== */
.contactos-list {
    max-height: 340px;
    overflow-y: auto;
    border: 1.5px solid #e5e0d5;
    border-radius: 12px;
    background: var(--cream);
    padding: 0.5rem;
}
.contacto-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
    background: var(--white);
    margin-bottom: 0.4rem;
    border: 1px solid transparent;
}
.contacto-item:last-child {
    margin-bottom: 0;
}
.contacto-item:hover {
    background: #faf8f3;
    border-color: var(--gold-light);
}
.contacto-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--gold-dark);
    cursor: pointer;
    flex-shrink: 0;
}
.contacto-info {
    flex: 1;
    min-width: 0;
}
.contacto-nome {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.contacto-tel {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
}
.sms-counter {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--gold-dark);
    font-weight: 600;
    text-align: right;
}
.sms-counter span {
    background: rgba(201,169,97,0.15);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
}

/* ===== MENSAGEM ===== */
.sms-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}
#sms-counter-sms {
    font-weight: 600;
}

code {
    background: rgba(201,169,97,0.15);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--gold-dark);
    font-weight: 600;
}