/* ================================================
   Rifa Online - Ajude a Cleusa
   Frontend CSS - Mobile First
   ================================================ */

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

:root {
    --primary-color: #d4574c;
    --secondary-color: #f5c947;
    --success-color: #4CAF50;
    --warning-color: #FFC107;
    --danger-color: #f44336;
    --neutral-light: #f5f5f5;
    --neutral-dark: #333;
    --text-color: #555;
    --border-color: #ddd;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

/* Títulos */
h1, h2, h3, h4, h5, h6 {
    color: var(--neutral-dark);
    margin-bottom: 1rem;
    font-weight: 600;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Seções */
section {
    padding: 1.5rem 0;
}

/* Screens */
.screen {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ================================================
   NAVEGAÇÃO & BOTÕES
   ================================================ */

button, .btn, .btn-link {
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #c24844;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--neutral-dark);
}

.btn-secondary:hover {
    background-color: #f0b942;
}

.btn-link {
    background: none;
    color: var(--primary-color);
    font-weight: 600;
    padding: 0.5rem 0;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-voltar {
    background: none;
    color: var(--text-color);
    font-weight: 600;
    padding: 0.5rem;
    font-size: 0.9rem;
}

.btn-voltar:hover {
    color: var(--primary-color);
}

/* ================================================
   HERO & APRESENTAÇÃO
   ================================================ */

.hero {
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--secondary-color);
    font-weight: 600;
}

/* ================================================
   PRÊMIO
   ================================================ */

.premio-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1rem 0;
}

.premio-foto {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 8px;
    margin: 0 auto;
    display: block;
}

.premio-info {
    text-align: center;
}

.premio-valor {
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-top: 0.5rem;
}

/* ================================================
   COMO FUNCIONA - PASSOS
   ================================================ */

.como-funciona {
    margin: 2rem 0;
}

.passos {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.passo {
    text-align: center;
    padding: 1rem;
    background: var(--neutral-light);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.passo:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.passo-numero {
    display: inline-block;
    width: 50px;
    height: 50px;
    line-height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.passo h3 {
    margin-bottom: 0.5rem;
}

.passo p {
    font-size: 0.95rem;
    color: var(--text-color);
}

/* ================================================
   RESULTADO DESTAQUE
   ================================================ */

.resultado-destaque {
    background: linear-gradient(135deg, #fff9e6 0%, #fff 100%);
    padding: 2rem;
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    text-align: center;
    margin: 2rem 0;
}

.numero-ganhador {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ================================================
   FORMULÁRIOS
   ================================================ */

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--neutral-dark);
}

input, textarea, select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(212, 87, 76, 0.1);
}

.form-error {
    display: block;
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

#form-dados input {
    margin-bottom: 0.5rem;
}

/* ================================================
   RESUMOS & CARTÕES
   ================================================ */

.resumo-dados, .resumo-pagamento {
    background: var(--neutral-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.resumo-dados h3, .resumo-pagamento h3 {
    margin-bottom: 1rem;
    color: var(--neutral-dark);
}

.resumo-dados p, .resumo-pagamento p {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.resumo-dados p:last-child, .resumo-pagamento p:last-child {
    border-bottom: none;
}

/* ================================================
   GRADE DE NÚMEROS
   ================================================ */

.grade-numeros {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.5rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--neutral-light);
    border-radius: 8px;
}

.numero-item {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.numero-item.livre {
    background: var(--success-color);
    color: white;
}

.numero-item.livre:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.numero-item.reservado {
    background: var(--warning-color);
    color: var(--neutral-dark);
    cursor: not-allowed;
    opacity: 0.7;
}

.numero-item.confirmado {
    background: #999;
    color: white;
    cursor: not-allowed;
    opacity: 0.6;
}

.numero-item.selecionado {
    background: var(--primary-color);
    color: white;
    border-color: white;
    border-width: 2px;
    box-shadow: 0 0 0 2px rgba(212, 87, 76, 0.3);
}

/* ================================================
   LEGENDA
   ================================================ */

.legenda {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--neutral-light);
    border-radius: 4px;
    font-size: 0.95rem;
}

.legenda-box {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* ================================================
   CONTADOR FLUTUANTE
   ================================================ */

.contador-flutuante {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    z-index: 100;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

/* ================================================
   PIX & PAGAMENTO
   ================================================ */

.pix-container {
    background: var(--neutral-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.qrcode-img {
    max-width: 280px;
    width: 100%;
    height: auto;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    background: white;
}

/* ================================================
   AVISOS & ALERTAS
   ================================================ */

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    border-left: 4px solid transparent;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left-color: #ffc107;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: #17a2b8;
}

.aviso {
    background: #fffacd;
    padding: 1rem;
    border-left: 4px solid var(--warning-color);
    border-radius: 4px;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.instrucoes {
    background: var(--neutral-light);
    padding: 1rem;
    border-radius: 4px;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

/* ================================================
   LOADING
   ================================================ */

.loading {
    text-align: center;
    padding: 2rem;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ================================================
   RESPONSIVO - TABLET
   ================================================ */

@media (min-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }

    .passos {
        grid-template-columns: repeat(3, 1fr);
    }

    .premio-container {
        flex-direction: row;
        align-items: center;
    }

    .premio-foto {
        max-width: 250px;
        margin: 0;
    }

    .premio-info {
        text-align: left;
    }

    .grade-numeros {
        grid-template-columns: repeat(10, 1fr);
    }

    .numero-item {
        font-size: 1rem;
    }
}

/* ================================================
   RESPONSIVO - DESKTOP
   ================================================ */

@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }

    .passos {
        grid-template-columns: repeat(3, 1fr);
    }

    .grade-numeros {
        grid-template-columns: repeat(10, 1fr);
        gap: 0.75rem;
        padding: 1.5rem;
    }

    .numero-item {
        font-size: 1.05rem;
    }
}

/* ================================================
   UTILITÁRIOS
   ================================================ */

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden {
    display: none !important;
}
