/* Estilos gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px 0;
    color: #333;

    /* Propriedades para a imagem de fundo funcionar corretamente em todas as telas */
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Container principal (usado em login e cadastro) */
.form-container {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.form-container h2 {
    margin-bottom: 25px;
    color: #333;
    font-size: 28px;
    font-weight: 600;
}

/* Grupo de input com ícone */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.input-group input {
    width: 100%;
    padding: 14px 15px 14px 45px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Opções (Lembrar-me) */
.options {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 25px;
    font-size: 14px;
    color: #555;
}

.options label {
    cursor: pointer;
}

/* Botão de Ação */
button {
    width: 100%;
    padding: 14px;
    border: none;
    background-color: #007bff;
    color: white;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

button:hover {
    background-color: #0056b3;
}

button:active {
    transform: scale(0.98);
}

/* Mensagens de feedback */
.message {
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 14px;
}
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Links para trocar de formulário */
.switch-form {
    margin-top: 20px;
    font-size: 14px;
}

.switch-form a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}

.switch-form a:hover {
    text-decoration: underline;
}

/* --- ESTILOS DA TELA ATM (DASHBOARD) --- */

.atm-container {
    background-color: #005ca9;
    width: 100%;
    max-width: 800px;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 3px solid #004a8f;
}

.atm-header {
    color: white;
    text-align: center;
    margin-bottom: 20px;
}

.atm-header h2 {
    font-size: 2rem;
    font-weight: 700;
}

.atm-header p {
    font-size: 1rem;
    opacity: 0.9;
}

.atm-screen {
    background-color: white;
    color: #005ca9;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 30px;
}

.atm-screen h3 {
    margin: 10px 0 5px 0;
}

.prize-value {
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 10px;
}

.contest-info {
    border-top: 1px dashed #ccc;
    margin-top: 15px;
    padding-top: 15px;
    display: flex;
    justify-content: space-around;
    align-items: center; /* Alinha verticalmente no desktop */
    font-size: 0.9rem;
    color: #555;
}

.atm-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.atm-button {
    display: flex;
    align-items: center;
    padding: 15px;
    background: linear-gradient(to bottom, #ffc83d, #ff9e00);
    color: #003c71;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    border-radius: 8px;
    border-bottom: 4px solid #d98600;
    transition: all 0.2s ease;
}

.atm-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.atm-button:active {
    transform: translateY(1px);
    border-bottom-width: 2px;
}

.atm-button i:first-child {
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

.atm-button span {
    flex-grow: 1;
    text-align: left;
}

.logout-container {
    text-align: center;
    margin-top: 25px;
}

.logout-link {
    color: white;
    background-color: transparent;
    padding: 10px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    border: 2px solid white;
    display: inline-block;
    transition: all 0.3s;
}

.logout-link:hover {
    background-color: white;
    color: #005ca9;
}

/* --- ESTILOS DA TELA DE APOSTA --- */

.betting-container {
    background-color: #f0f2f5;
    color: #333;
    width: 100%;
    max-width: 800px; 
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.betting-container h2 {
    color: #005ca9;
    margin-bottom: 5px;
}

.contest-info-betting {
    font-size: 1rem;
    color: #555;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.betting-container p {
    margin-bottom: 25px;
    color: #555;
}

.bet-slip {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.bet-slip h4 {
    text-align: left;
    margin: 0 0 10px 0;
    color: #333;
}

.slip-counter {
    font-weight: normal;
    color: #555;
}

.loto-grid-small {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
    gap: 8px;
}

.loto-number-small {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background-color: #f8f9fa;
    border: 1px solid #ccc;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    user-select: none;
}

.loto-number-small:hover {
    border-color: #007bff;
}

.loto-number-small.selected {
    background: linear-gradient(to bottom, #ffc83d, #ff9e00);
    color: #003c71;
    border-color: #d98600;
}

.bet-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

#confirm-bet-btn {
    background-color: #28a745;
    border: none;
    width: auto;
    padding: 12px 25px;
}

#confirm-bet-btn:hover {
    background-color: #218838;
}

#confirm-bet-btn:disabled {
    background-color: #aaa;
    cursor: not-allowed;
}

.back-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}

/* --- ESTILOS DA TELA MINHAS APOSTAS --- */

.bets-list {
    width: 100%;
    margin-top: 20px;
}

.bet-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: left;
}

.bet-card-header {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bet-numbers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 10px;
}

.bet-number-item {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    background-color: #e9ecef;
    border-radius: 50%;
    font-weight: bold;
    color: #495057;
}

.no-bets-message {
    background-color: #fff;
    padding: 40px 20px;
    border-radius: 8px;
    text-align: center;
}

.no-bets-message p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 20px;
}

/* --- ESTILOS DA TELA TODAS APOSTAS --- */

.user-bets-section {
    margin-bottom: 30px;
}

.user-bets-header {
    background-color: #005ca9;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- ESTILOS DA TELA PAGAR --- */

.pix-info-box {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 25px;
    margin: 25px 0;
    text-align: left;
}

.pix-info-item {
    margin-bottom: 20px;
}

.pix-info-item:last-child {
    margin-bottom: 0;
}

.pix-info-item strong {
    display: block;
    color: #555;
    font-size: 1rem;
    margin-bottom: 5px;
}

.pix-info-item span {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

.pix-key-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
    border-radius: 5px;
    padding: 10px;
}

#pix-key {
    font-family: monospace;
    font-size: 1.3rem;
}

#copy-btn {
    background-color: #6c757d;
    border: none;
    border-radius: 5px;
    color: white;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    width: auto;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.2s;
}

#copy-btn:hover {
    background-color: #5a6268;
}

.confirmation-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #ddd;
}

.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #25d366;
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    transition: transform 0.2s, background-color 0.2s;
}

.whatsapp-btn:hover {
    background-color: #1ebe57;
    transform: scale(1.05);
}

/* --- ESTILOS DA TELA QUEM PAGOU --- */

.payment-list ul {
    list-style-type: none;
    padding: 0;
}

.payment-list-item {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.2s;
}

.payment-list-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.payment-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
    font-size: 1.1rem;
}

.payment-info i {
    color: #28a745;
}

.payment-list-item.pending .payment-info i {
    color: #ffc107;
}

.payment-date {
    font-size: 0.9rem;
    color: #6c757d;
    font-family: monospace;
}

/* Estilos para as etiquetas de Status */
.status {
    padding: 5px 12px;
    border-radius: 20px;
    color: white;
    font-size: 0.8em;
    font-weight: bold;
    text-align: center;
}
.status-pago { background-color: #28a745; }
.status-pendente { background-color: #ffc107; color: #212529; }
.status-anterior { background-color: #6c757d; }


/* --- ESTILOS DO COMPROVANTE --- */
.print-bet-btn {
    color: #6c757d;
    text-decoration: none;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.print-bet-btn:hover {
    color: #007bff;
}

/* --- ESTILOS DA TELA VALORES DAS APOSTAS --- */

.value-card-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.value-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.value-card i {
    font-size: 2rem;
    color: #007bff;
}

.value-card-content h3 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    color: #555;
}

.value-card-content p {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.value-card.total-bet i {
    color: #ffc107;
}

.value-card.total-paid i {
    color: #28a745;
}


/* Media Query para telas menores (celulares) */
@media (max-width: 600px) {
    body {
        padding: 0 10px; 
    }
    .atm-buttons, .value-card-container {
        grid-template-columns: 1fr;
    }
    .atm-container, .betting-container, .form-container {
        padding: 20px;
    }
    .atm-header h2 {
        font-size: 1.5rem;
    }
    .loto-grid-small {
        gap: 5px;
    }
    .loto-number-small {
        width: 100%;
        padding-bottom: 100%;
        height: 0;
        position: relative;
        font-size: 0.9rem;
        border-width: 1px;
    }
    .loto-number-small span {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .bet-actions {
        flex-direction: column;
        gap: 15px;
    }
    .payment-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    /* --- CORREÇÃO PARA CELULAR --- */
    .contest-info {
        flex-direction: column;
        gap: 15px;
    }
    .contest-info span {
        justify-content: center;
        width: 100%;
    }
    /* --- FIM DA CORREÇÃO --- */
}


/* =====================================================================
    NOVOS ESTILOS PARA TELA DE LOGIN/CADASTRO (INÍCIO)
=====================================================================
*/

body.login-page {
    background: linear-gradient(135deg, #005ca9, #0073b6);
}

body.login-page .form-container {
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
    border: none;
    width: 100%;
    max-width: 400px;
    text-align: center;
    color: white;
}

body.login-page .login-logo {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
}

body.login-page .form-container h2 {
    font-size: 2.2em;
    font-weight: 700;
    margin-bottom: 5px;
    color: white;
}

body.login-page .form-container .subtitle {
    margin-bottom: 30px;
    font-size: 1em;
    opacity: 0.9;
    color: white;
}

body.login-page .input-group input {
    padding: 18px 20px 18px 50px;
    border: none;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 50px;
    font-size: 16px;
    color: #333;
}

body.login-page .input-group input::placeholder {
    color: #999;
}

body.login-page .input-group input:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
}

body.login-page .options {
    margin: -10px 0 25px 15px;
    color: white;
}

body.login-page button[type="submit"] {
    background: #ffffff;
    color: #005ca9;
    font-size: 18px;
    border-radius: 50px;
}

body.login-page button[type="submit"]:hover {
    transform: scale(1.03);
}

body.login-page .message {
    margin: -10px 0 15px 0;
    color: #fff;
    font-weight: bold;
}
body.login-page .error-message {
    background-color: rgba(255, 82, 82, 0.7);
}
body.login-page .success-message {
    background-color: rgba(76, 175, 80, 0.7);
}

body.login-page .switch-form {
    margin-top: 30px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
}

body.login-page .switch-form a {
    color: #fff;
}

/* =====================================================================
    OUTROS ESTILOS
=====================================================================
*/

.timer-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: transparent;
    border-radius: 8px;
    margin-top: 20px;
}
.timer-text {
    color: #005ca9;
    font-weight: bold;
    font-size: 0.9rem;
}
.timer-container-final {
    display: flex;
    justify-content: center;
    gap: 8px;
}
.timer-box {
    text-align: center;
    color: white;
    background-color: #005ca9;
    padding: 8px;
    border-radius: 5px;
    min-width: 55px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}
.timer-value {
    font-size: 1.6rem;
    font-weight: bold;
    color: #ffc83d;
    line-height: 1;
}
.timer-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    opacity: 0.8;
    display: block;
}
@media (max-width: 600px) {
    .timer-wrapper {
        flex-direction: column;
        gap: 8px;
    }
}

.contest-info span strong {
    background-color: #ffc83d;
    color: #003c71;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 1.1rem;
    min-width: 50px;
    text-align: center;
}

.bet-card-footer {
    border-top: 1px solid #eee;
    margin-top: 15px;
    padding-top: 15px;
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.status-premiada {
    color: #28a745;
}
.status-nao-premiada {
    color: #dc3545;
}
.status-aguardando {
    color: #6c757d;
}

.bet-number-item.acerto,
.bet-number-item.sorteado {
    background-color: #28a745;
    color: white;
    border: 2px solid rgba(0,0,0,0.2);
    transform: scale(1.1);
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.visible {
    display: flex;
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.modal-content h4 {
    color: #005ca9;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.modal-content p {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 25px;
}

.modal-content button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
}

.modal-content button:hover {
    background-color: #0056b3;
}

.disabled-button {
    background: #aaa !important;
    border-bottom-color: #777 !important;
    color: #f8f9fa !important;
    cursor: not-allowed;
    opacity: 0.8;
}

.disabled-button:hover {
    transform: none;
    box-shadow: none;
}

.extra-bet-button {
    background: #28a745 !important;
    border-bottom: 4px solid rgba(0,0,0,0.2) !important;
    color: white !important;
}

.extra-bet-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.modal-actions button,
.modal-actions .modal-confirm-btn {
    border: none;
    padding: 10px 25px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    display: inline-block;
}

#extra-bet-cancel-btn {
    background-color: #6c757d;
    color: white;
}

#extra-bet-cancel-btn:hover {
    background-color: #5a6268;
}

.modal-confirm-btn {
    background-color: #007bff;
    color: white;
}

.modal-confirm-btn:hover {
    background-color: #0056b3;
}

.highlight-link {
    background-color: #fff;
    color: #005ca9 !important;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: bold;
    text-decoration: none;
    transition: transform 0.2s, background-color 0.2s;
    display: inline-block;
}

.highlight-link:hover {
    background-color: #eee;
    transform: scale(1.05);
}