:root {
    --color-primary: #1a5d3a;
    --color-primary-dark: #0f3d26;
    --color-accent: #d4a017;
    --color-bg: #f7f7f5;
    --color-text: #222;
    --color-danger: #b3261e;
    --color-success: #1a5d3a;
    --radius: 8px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.site-header {
    background: var(--color-primary-dark);
    color: #fff;
}

.site-header nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.25rem;
}

.brand {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    font-size: 1.1rem;
}

.nav-links a, .nav-links .link-button {
    color: #f0f0f0;
    text-decoration: none;
    margin-left: 1.2rem;
    font-size: 0.95rem;
}

.link-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font: inherit;
}

.inline-form { display: inline; }

main.container { padding-top: 1.5rem; padding-bottom: 3rem; min-height: 60vh; }

.flash-messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.flash { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 0.5rem; }
.flash-success { background: #e3f2e6; color: var(--color-success); }
.flash-danger { background: #fbe4e2; color: var(--color-danger); }
.flash-warning { background: #fff4dd; color: #8a5a00; }
.flash-info { background: #e6f0fb; color: #1a4a8a; }

.card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 1.25rem;
}

.raffle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }

.numbers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 0.4rem;
    margin: 1rem 0;
}

.ticket-number {
    padding: 0.5rem 0.2rem;
    text-align: center;
    border-radius: 4px;
    font-size: 0.85rem;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    user-select: none;
}
.ticket-number.status-available { background: #fff; }
.ticket-number.status-reserved, .ticket-number.status-pending { background: #fff4dd; color: #8a5a00; cursor: not-allowed; }
.ticket-number.status-paid { background: #e3f2e6; color: var(--color-success); cursor: not-allowed; }
.ticket-number.selected { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }

form.form-box { max-width: 480px; }
label { display: block; margin-top: 0.9rem; font-weight: 600; font-size: 0.9rem; }
input, select, textarea {
    width: 100%;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius);
    border: 1px solid #ccc;
    margin-top: 0.25rem;
    font: inherit;
}
.field-errors { color: var(--color-danger); font-size: 0.85rem; margin: 0.2rem 0 0; padding: 0; list-style: none; }

button, .btn {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    cursor: pointer;
    font: inherit;
    text-decoration: none;
    margin-top: 1rem;
}
button:hover, .btn:hover { background: var(--color-primary-dark); }
.btn-danger { background: var(--color-danger); }
.btn-secondary { background: #666; }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid #eee; }
th { background: #f0f0ee; }

.badge { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.78rem; }
.badge-draft { background: #eee; }
.badge-active { background: #e3f2e6; color: var(--color-success); }
.badge-finished { background: #e6f0fb; color: #1a4a8a; }
.badge-cancelled, .badge-paused { background: #fbe4e2; color: var(--color-danger); }

.site-footer { text-align: center; padding: 1.5rem; color: #777; font-size: 0.85rem; }

.error-page { text-align: center; padding: 3rem 1rem; }

.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 220px; background: var(--color-primary-dark); color: #fff; padding: 1.25rem 0; flex-shrink: 0; }
.admin-sidebar a { display: block; color: #f0f0f0; text-decoration: none; padding: 0.6rem 1.25rem; }
.admin-sidebar a:hover { background: rgba(255,255,255,0.08); }
.admin-content { flex: 1; padding: 1.5rem 2rem; }

/* --- Checkout / pagamento Pix --- */

.checkout-card {
    max-width: 480px;
    margin: 1rem auto;
    padding: 2rem 1.75rem;
    text-align: center;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 35px rgba(15, 61, 38, 0.12);
    animation: checkout-fade-in 0.4s ease-out;
}

.checkout-card--muted {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.checkout-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }

.checkout-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-accent);
    margin: 0 0 0.35rem;
}

.checkout-title {
    font-size: 1.35rem;
    margin: 0 0 1.25rem;
    color: var(--color-primary-dark);
}

.checkout-numbers, .success-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.success-number {
    display: inline-block;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.95rem;
}

.checkout-amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-primary-dark);
    margin: 0.25rem 0 1.25rem;
}

.checkout-timer {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    background: #fff7e6;
    border: 1px solid #f1d9a0;
    border-radius: 14px;
    padding: 0.6rem 1.5rem;
    margin: 0 auto 1.5rem;
}

.checkout-timer-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8a6a1a;
}

.checkout-timer-value {
    font-size: 1.6rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #8a6a1a;
}

.checkout-timer--urgent { background: #fdeceb; border-color: #f3b7b0; animation: checkout-pulse 1s infinite; }
.checkout-timer--urgent .checkout-timer-label,
.checkout-timer--urgent .checkout-timer-value { color: var(--color-danger); }
.checkout-timer--expired .checkout-timer-value { color: var(--color-danger); }

.checkout-qr {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 1rem;
    display: inline-block;
    margin-bottom: 1.25rem;
}
.checkout-qr img { width: 220px; max-width: 100%; display: block; border-radius: 8px; }

.checkout-copycode {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.checkout-copycode input {
    flex: 1;
    font-family: monospace;
    font-size: 0.78rem;
    background: #f7f7f5;
    margin-top: 0;
}
.checkout-copycode .btn { margin-top: 0; white-space: nowrap; }
.btn-copied { background: var(--color-success) !important; }

.checkout-hint {
    font-size: 0.85rem;
    color: #777;
    margin-top: 0.5rem;
}

/* --- Tela de parabens --- */

.success-screen {
    max-width: 480px;
    margin: 2rem auto;
    padding: 2.5rem 1.75rem;
    text-align: center;
    background: linear-gradient(160deg, #ffffff, #f3fbf5);
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(15, 61, 38, 0.16);
    animation: checkout-fade-in 0.5s ease-out;
}

.success-emoji {
    font-size: 4rem;
    animation: success-bounce 1.2s ease-in-out infinite;
}

.success-title {
    font-size: 2.2rem;
    margin: 0.25rem 0 0.25rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
}

.success-subtitle {
    color: #555;
    margin: 0 0 1.25rem;
    font-size: 1.05rem;
}

.success-message {
    color: #444;
    line-height: 1.6;
    margin: 1rem 0 1.5rem;
}

@keyframes checkout-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes checkout-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

@keyframes success-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
