/* ============================================
   RESET E BASE
   ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --cor-primaria: #4CAF50;
    --cor-hover:    #388E3C;
    --cor-perigo:   #dc3545;
    --cor-aviso:    #ff9800;
    --cor-info:     #007bff;
    --raio:         10px;
    --sombra:       0 4px 12px rgba(0,0,0,0.1);
}

body {
    font-family: Arial, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

/* ============================================
   CONTAINERS
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--sombra);
}

.container-small {
    max-width: 640px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--sombra);
}

/* ============================================
   HEADER
   ============================================ */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

/* ============================================
   BOTÕES
   ============================================ */
button, .btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--cor-primaria);
    color: white;
    border: none;
    border-radius: var(--raio);
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: center;
}

button:hover, .btn:hover { filter: brightness(0.9); transform: translateY(-1px); }
.btn-perigo  { background: var(--cor-perigo)  !important; }
.btn-aviso   { background: var(--cor-aviso)   !important; }
.btn-info    { background: var(--cor-info)    !important; }
.btn-sm      { padding: 5px 12px; font-size: 12px; }
.btn-block   { width: 100%; }
.refresh     { background: #607d8b; padding: 8px 16px; border-radius: var(--raio); }

/* ============================================
   FORMULÁRIOS
   ============================================ */
.form-group { margin-bottom: 18px; }

label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
    color: #444;
    font-size: 14px;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="tel"],
select, textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #ddd;
    border-radius: var(--raio);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #fafafa;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--cor-primaria);
    box-shadow: 0 0 0 3px rgba(76,175,80,0.12);
    background: white;
}

input[type="color"] {
    width: 60px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: var(--raio);
    cursor: pointer;
    padding: 2px;
}

.cor-preview {
    display: inline-block;
    margin-left: 10px;
    font-size: 14px;
    font-family: monospace;
    background: #f5f5f5;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

small { display: block; margin-top: 5px; color: #888; font-size: 12px; }

/* ============================================
   MENSAGENS
   ============================================ */
.mensagem-topo {
    padding: 12px 16px;
    border-radius: var(--raio);
    margin-bottom: 20px;
    font-size: 14px;
}
.mensagem-topo.sucesso { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.mensagem-topo.erro    { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

.mensagem-float {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 20px;
    border-radius: var(--raio);
    display: none;
    z-index: 1000;
    font-weight: bold;
    box-shadow: var(--sombra);
    max-width: 320px;
}
.mensagem-float.sucesso { background: #4CAF50; color: white; }
.mensagem-float.erro    { background: #f44336; color: white; }

/* ============================================
   INFO DA RIFA
   ============================================ */
.info {
    background: #e8f5e9;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}
.info-texto p { margin: 8px 0; }
.info-imagem { max-width: 200px; }
.info-imagem img { max-width: 100%; border-radius: 10px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

/* ============================================
   BARRA DE PROGRESSO
   ============================================ */
.progresso {
    background: #eee;
    border-radius: 20px;
    margin: 15px 0;
    overflow: hidden;
    position: relative;
    height: 28px;
}
.progresso-bar { height: 100%; width: 0%; background: var(--cor-primaria); transition: width 0.5s ease; }
.progresso span {
    position: absolute;
    top: 0; left: 0; right: 0;
    text-align: center;
    font-size: 12px;
    line-height: 28px;
    font-weight: bold;
    color: #333;
    text-shadow: 0 0 2px white;
}

/* ============================================
   CONTADOR
   ============================================ */
.contador {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    background: #f0f0f0;
    padding: 8px;
    border-radius: 30px;
    margin: 10px 0;
}

/* ============================================
   GRADE DE NÚMEROS
   ============================================ */
.numeros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
    gap: 10px;
    margin: 24px 0;
}

.numero {
    background: var(--cor-primaria);
    color: white;
    text-align: center;
    padding: 14px 8px;
    border-radius: var(--raio);
    cursor: pointer;
    font-weight: bold;
    font-size: 15px;
    transition: all 0.2s ease;
    user-select: none;
}
.numero:hover     { filter: brightness(0.92); transform: scale(1.04); }
.numero.ocupado   { background: #9e9e9e !important; cursor: not-allowed; opacity: 0.65; }
.numero.pago      { background: #2196F3 !important; cursor: not-allowed; }
.numero.selecionado {
    background: var(--cor-aviso) !important;
    box-shadow: 0 0 14px rgba(255,152,0,0.6);
    transform: scale(1.06);
}

/* ============================================
   LEGENDA
   ============================================ */
.legenda { display: flex; gap: 16px; flex-wrap: wrap; margin: 12px 0 20px; font-size: 13px; }
.legenda-item { display: flex; align-items: center; gap: 6px; }
.legenda-cor { width: 18px; height: 18px; border-radius: 4px; }

/* ============================================
   FORMULÁRIO DE RESERVA
   ============================================ */
.form-container {
    display: none;
    margin-top: 24px;
    padding: 24px;
    background: #f9f9f9;
    border-radius: 12px;
    border: 2px solid var(--cor-aviso);
}
.form-container h3 { margin-bottom: 18px; }
.form-container input { margin-bottom: 12px; }

/* ============================================
   TABELA
   ============================================ */
table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
th { background: var(--cor-primaria); color: white; padding: 12px 10px; text-align: center; }
td { border-bottom: 1px solid #eee; padding: 10px; text-align: center; color: #333; }
tr:hover td { background: #f5f5f5; }

.status-pendente  { color: #ff9800; font-weight: bold; }
.status-pago      { color: #4CAF50; font-weight: bold; }
.status-cancelado { color: #9e9e9e; text-decoration: line-through; }

.total { text-align: right; font-weight: bold; margin-top: 10px; padding: 10px; background: #f0f0f0; border-radius: var(--raio); }

/* ============================================
   STATS CARDS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--sombra);
    border-top: 4px solid var(--cor-primaria);
}
.stat-card .numero-stat { font-size: 2rem; font-weight: 800; color: var(--cor-primaria); line-height: 1; }
.stat-card .label-stat  { font-size: 0.78rem; color: #888; margin-top: 6px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ============================================
   INFO CARD
   ============================================ */
.info-card {
    background: #f8f9fa;
    border-left: 4px solid var(--cor-primaria);
    padding: 16px 20px;
    border-radius: var(--raio);
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.8;
}

/* ============================================
   LOGIN
   ============================================ */
body.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 380px;
    padding: 40px 30px;
    text-align: center;
}
.login-card h2       { color: #333; margin-bottom: 28px; font-size: 26px; }
.login-card .input-group { margin-bottom: 18px; text-align: left; }
.login-card .input-group label { font-size: 13px; color: #555; margin-bottom: 5px; }
.login-card button   { width: 100%; padding: 13px; background: #667eea; border-radius: 10px; font-size: 17px; margin-top: 8px; }
.login-card button:hover { background: #5a67d8; }
.login-card footer   { margin-top: 24px; font-size: 12px; color: #aaa; }

/* ============================================
   IMAGEM PREVIEW
   ============================================ */
.img-preview { max-width: 200px; max-height: 200px; margin-top: 10px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.btn-remover-img { display: inline-block; margin-top: 8px; background: var(--cor-perigo); color: white; padding: 4px 12px; border-radius: 6px; font-size: 12px; text-decoration: none; cursor: pointer; border: none; }

/* ============================================
   RESPONSIVO
   ============================================ */
@media (max-width: 768px) {
    body { padding: 12px; }
    .container, .container-small { padding: 18px; border-radius: 10px; }
    .numeros-grid { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 7px; }
    .numero { padding: 10px 6px; font-size: 13px; }
    .info { flex-direction: column; text-align: center; }
    .header { flex-direction: column; align-items: flex-start; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .legenda { gap: 10px; font-size: 12px; }
}

/* ── CTA ── */
.cta-container {
    text-align: center;
    margin: 20px 0 10px;
}

.btn-cta {
    display: inline-block;
    background: var(--cor-primaria);
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 16px 36px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    animation: pulse 2s infinite;
    transition: transform .2s, box-shadow .2s;
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.2);
}

.cta-sub {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(0,0,0,0.2); }
    70%  { box-shadow: 0 0 0 10px rgba(0,0,0,0); }
    100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}