﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --auth-bg: #050807;
    --auth-surface: rgba(11, 15, 20, 0.65); /* #0B0F14 with opacity for glass */
    --auth-surface-2: #11161D;
    
    --auth-green: #22C55E;
    --auth-green-bright: #39FF88;
    
    --auth-text: #F5F7F6;
    --auth-text-secondary: #9CA3AF;
    --auth-text-muted: #6B7280;
    
    --auth-border: rgba(255, 255, 255, 0.08);
    --auth-border-green: rgba(34, 197, 94, 0.28);
}

html, body.direto-auth {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden; /* Fix scroll */
    font-family: 'Inter', sans-serif;
    color: var(--auth-text);
    background-color: var(--auth-bg);
}

/* Background com overlay */
.direto-auth-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        linear-gradient(rgba(1, 6, 5, 0.75), rgba(1, 7, 5, 0.85)),
        url('../img/login/fundo.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.direto-auth-wrapper { box-sizing: border-box;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: 40px;
}

/* Card Principal */
.direto-auth-card {
    position: relative;
    width: 400px;
    padding: 40px;
    background: var(--auth-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--auth-border-green);
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(34, 197, 94, 0.05);
    box-sizing: border-box;
}

/* Glow interno no topo do card */
.direto-auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 100px;
    background: radial-gradient(ellipse at top, rgba(34, 197, 94, 0.15), transparent 70%);
    pointer-events: none;
    border-radius: 20px 20px 0 0;
}

/* Logo */
.direto-auth-logo {
    display: block;
    margin: 0 auto 30px;
    width: 140px;
    height: auto;
}

/* Textos */
.direto-auth-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--auth-text);
    text-align: center;
    margin: 0 0 10px;
}

.direto-auth-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: var(--auth-text-secondary);
    line-height: 1.5;
    text-align: center;
    margin: 0 auto 30px;
    max-width: 280px;
}

.direto-auth-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #E5E7EB;
    margin-bottom: 8px;
}

/* Input WhatsApp */
.direto-auth-phone-container {
    display: flex;
    align-items: center;
    height: 50px;
    background: var(--auth-surface-2);
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.direto-auth-phone-container:focus-within {
    border-color: var(--auth-green);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.15);
}

.direto-auth-ddi {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    height: 100%;
    color: var(--auth-text);
    font-size: 14px;
    font-weight: 500;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.direto-auth-ddi svg {
    width: 18px;
    height: 14px;
    border-radius: 2px;
}

.direto-auth-input {
    flex: 1;
    height: 100%;
    background: transparent;
    border: none;
    padding: 0 14px;
    color: var(--auth-text);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    outline: none;
}
.direto-auth-input::placeholder {
    color: var(--auth-text-muted);
}

/* Botão Primário */
.direto-auth-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, var(--auth-green), var(--auth-green-bright));
    border: none;
    border-radius: 10px;
    color: #061108;
    font-size: 15px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    margin-top: 24px;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), 0 8px 20px rgba(34, 197, 94, 0.2);
}

.direto-auth-button:hover {
    filter: brightness(1.1);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 12px 25px rgba(34, 197, 94, 0.3);
}

/* Segurança */
.direto-auth-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    color: var(--auth-text-secondary);
    font-size: 12px;
}

.direto-auth-security .lucide {
    color: var(--auth-green);
    width: 14px;
    height: 14px;
}

/* Direx - Ajustado para ficar igual ao Visual Kit */
.direto-auth-direx-container {
    display: flex;
    align-items: flex-end;
    height: 400px;
}

.direto-auth-direx {
    width: 240px; /* Bem menor */
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(34, 197, 94, 0.15));
}

/* Rodapé na Viewport */
.direto-auth-footer {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
    color: var(--auth-text-muted);
    font-size: 12px;
    z-index: 1;
}

/* States */
.state-section { display: none; }
body.state-initial .section-initial { display: block; }
body.state-otp .section-otp { display: block; }
body.state-fallback .section-fallback { display: block; }

/* Grid OTP */
.direto-auth-otp-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.direto-auth-otp-input {
    width: 100%;
    height: 50px;
    background: var(--auth-surface-2);
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    color: var(--auth-text);
    font-size: 20px;
    font-weight: 500;
    text-align: center;
    outline: none;
    box-sizing: border-box;
}

.direto-auth-otp-input:focus {
    border-color: var(--auth-green);
    background: #0B0F14;
}

.direto-auth-action-text {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--auth-text-secondary);
    margin-bottom: 24px;
}

.direto-auth-action-text .lucide {
    width: 14px;
    height: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    html, body.direto-auth {
        overflow-y: auto;
        height: auto;
        min-height: 100dvh;
    }
    
    .direto-auth-wrapper { box-sizing: border-box;
        flex-direction: column;
        padding: 20px;
        height: auto;
        min-height: calc(100dvh - 60px);
    }
    
    .direto-auth-card {
        width: 100%;
        max-width: 400px;
        padding: 30px 20px;
    }
    
    .direto-auth-direx-container {
        display: none; /* Esconde o mascote no mobile */
    }
    
    .direto-auth-footer {
        position: relative;
        bottom: 0;
        margin-bottom: 20px;
    }
}




/* Alertas customizados */
.direto-alert-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.direto-alert-overlay.show {
    opacity: 1;
    pointer-events: all;
}
.direto-alert-box {
    background: var(--auth-surface);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 15px 50px rgba(0,0,0,0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}
.direto-alert-overlay.show .direto-alert-box {
    transform: translateY(0);
}
.direto-alert-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 15px;
    color: #ef4444; /* Vermelho erro */
}
.direto-alert-title {
    font-size: 18px;
    font-weight: 500;
    color: #fff;
    margin: 0 0 10px;
}
.direto-alert-msg {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    margin: 0 0 20px;
    line-height: 1.5;
}
.direto-alert-btn {
    background: var(--auth-border-green);
    color: #000;
    font-weight: 600;
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.direto-alert-btn:hover {
    opacity: 0.9;
}
