/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f0f2f5;
    color: #1a1a2e;
    margin: 0;
    padding: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* === Header === */
.header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    padding: 18px 28px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.3px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid #0f3460;
}

.header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
    transition: background 0.2s;
}

.header-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* === Cards === */
.card {
    max-width: 560px;
    margin: 24px auto;
    padding: 28px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
}

/* === Loteria Info === */
.loteria-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.loteria-info .data {
    font-size: 16px;
    font-weight: 700;
    color: #0f3460;
}

.dia-semana {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    margin-top: 2px;
}

.loteria-info .extra {
    text-align: right;
}

.loteria-info .extra div {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

/* === Results Grid === */
.results-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: border-color 0.15s;
}

.result-item:focus-within {
    border-color: #0f3460;
    background: #fff;
}

.position {
    font-size: 13px;
    font-weight: 700;
    color: #0f3460;
    min-width: 28px;
    text-transform: uppercase;
}

.input-numero,
.input-grupo {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    text-align: center;
    color: #1a1a2e;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.input-numero:focus,
.input-grupo:focus {
    border-color: #0f3460;
    box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.1);
}

.input-numero::placeholder,
.input-grupo::placeholder {
    color: #94a3b8;
}

.input-grupo {
    margin-left: 10px;
    max-width: 100px;
}

.input-numero[readonly] {
    background: #f1f5f9;
    color: #64748b;
}

/* === Buttons === */
.btn-primary {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: #0f3460;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    margin-top: 24px;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: -0.2px;
}

.btn-primary:hover {
    background: #1a1a2e;
}

.btn-primary:active {
    transform: scale(0.98);
}

/* === Login === */
.login-card {
    max-width: 380px;
    margin: 80px auto;
    padding: 36px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
}

.login-card h2 {
    text-align: center;
    color: #1a1a2e;
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.login-card .subtitle {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    margin-bottom: 28px;
}

.login-card input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    text-align: center;
    margin-bottom: 16px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.login-card input[type="password"]:focus {
    border-color: #0f3460;
    box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.1);
}

.error-msg {
    text-align: center;
    margin-bottom: 16px;
    padding: 10px;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

/* === Logs === */
.page-header {
    max-width: 560px;
    margin: 24px auto 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
}

.page-header h1 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.page-header a {
    font-size: 13px;
    font-weight: 500;
    color: #0f3460;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    transition: background 0.15s;
}

.page-header a:hover {
    background: #f1f5f9;
}

.log-card {
    max-width: 560px;
    margin: 12px auto;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.log-data {
    font-weight: 700;
    color: #0f3460;
    font-size: 14px;
}

.log-update-time {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}

.log-row {
    display: flex;
    align-items: center;
    padding: 5px 0;
    font-size: 13px;
    gap: 8px;
}

.log-premio {
    font-weight: 700;
    color: #0f3460;
    min-width: 24px;
    font-size: 12px;
}

.log-de {
    color: #94a3b8;
    text-decoration: line-through;
}

.log-arrow {
    color: #0f3460;
    font-weight: 700;
}

.log-para {
    font-weight: 600;
    color: #1a1a2e;
}

/* === Responsive === */
@media (max-width: 600px) {
    .header {
        padding: 14px 18px;
        font-size: 16px;
    }

    .card,
    .login-card {
        margin: 16px;
        padding: 20px;
    }

    .login-card {
        margin-top: 40px;
    }

    .page-header {
        margin: 16px 16px 0;
    }

    .log-card {
        margin: 10px 16px;
    }

    .input-grupo {
        max-width: 80px;
    }
}
