/*
 * ============================================================
 * modal.css — DmHub — Modal de autenticação
 * Login | Cadastro | Recuperar Senha | OTP | Nova Senha | Magic Link
 * Visual idêntico ao e81.uk
 * ============================================================
 */

/* === OVERLAY === */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9990;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

/* Estado ativo do overlay */
.modal-overlay.ativo {
    opacity: 1;
    visibility: visible;
}

/* === CARTÃO === */
.modal-card {
    background: #f8f9fb;
    border-radius: 24px;
    padding: 36px 32px 32px;
    width: 100%;
    max-width: 440px;
    position: relative;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Animação de entrada do cartão */
.modal-overlay.ativo .modal-card {
    transform: translateY(0) scale(1);
}

/* === BOTÃO FECHAR === */
.modal-fechar {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #e8eaf0;
    color: #4a5568;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
    line-height: 1;
}
.modal-fechar:hover {
    background: #d1d5df;
    color: #1a202c;
}

/* === ÍCONE DO PAINEL === */
.modal-icone {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    font-size: 1.5rem;
    color: #2d3748;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* === TÍTULO E SUBTÍTULO === */
.modal-titulo {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: #1a202c;
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}
.modal-subtitulo {
    font-size: 0.875rem;
    color: #718096;
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* === CAMPOS === */
.modal-campo {
    position: relative;
    margin-bottom: 12px;
}
.modal-campo .campo-icone {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 0.875rem;
    pointer-events: none;
}
.modal-campo input {
    width: 100%;
    padding: 13px 14px 13px 40px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background: #eef1f7;
    color: #2d3748;
    font-size: 0.9375rem;
    font-family: 'Inter', system-ui, sans-serif;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}
.modal-campo input::placeholder {
    color: #b0bec5;
}
.modal-campo input:focus {
    border-color: #5e5ce6;
    background: #f0f0ff;
    box-shadow: 0 0 0 3px rgba(94, 92, 230, 0.12);
}

/* Ícone olho (mostrar senha) */
.modal-campo .campo-olho {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #a0aec0;
    font-size: 0.9rem;
    transition: color 0.2s ease;
    border: none;
    background: none;
    padding: 4px;
    display: flex;
    align-items: center;
}
.modal-campo .campo-olho:hover {
    color: #4a5568;
}

/* === LINK ESQUECEU SENHA === */
.modal-link-senha {
    display: block;
    text-align: right;
    font-size: 0.8125rem;
    color: #5e5ce6;
    font-weight: 600;
    margin-top: -4px;
    margin-bottom: 18px;
    cursor: pointer;
    transition: color 0.2s ease;
}
.modal-link-senha:hover {
    color: #4441b2;
    text-decoration: underline;
}

/* === BOTÃO PRINCIPAL === */
.modal-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: #2d3d57;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: 'Inter', system-ui, sans-serif;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    letter-spacing: 0.01em;
}
.modal-btn:hover {
    background: #1a2a3f;
    box-shadow: 0 4px 16px rgba(45, 61, 87, 0.3);
    transform: translateY(-1px);
}
.modal-btn:active {
    transform: translateY(0);
}
.modal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* === DIVISOR === */
.modal-divisor {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: #a0aec0;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.modal-divisor::before,
.modal-divisor::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* === BOTÕES SOCIAIS === */
.modal-sociais {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}
.modal-social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 8px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #2d3748;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: 'Inter', system-ui, sans-serif;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}
.modal-social-btn:hover {
    border-color: #c0c8d8;
    background: #f7f9fc;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Ícone Google SVG inline */
.ico-google {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
/* Ícone Facebook */
.ico-facebook {
    width: 18px;
    height: 18px;
    color: #1877f2;
    font-size: 1rem;
    flex-shrink: 0;
}
/* Ícone Magic Link */
.ico-magic {
    font-size: 0.9rem;
    color: #4a5568;
    flex-shrink: 0;
}

/* === TERMOS === */
.modal-termos {
    font-size: 0.75rem;
    color: #a0aec0;
    text-align: center;
    line-height: 1.6;
    margin-bottom: 16px;
}
.modal-termos a {
    color: #5e5ce6;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}
.modal-termos a:hover {
    color: #4441b2;
    text-decoration: underline;
}

/* === RODAPÉ DO MODAL === */
.modal-rodape {
    text-align: center;
    font-size: 0.875rem;
    color: #718096;
}
.modal-rodape a,
.modal-rodape span[role="button"] {
    color: #5e5ce6;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
}
.modal-rodape a:hover,
.modal-rodape span[role="button"]:hover {
    color: #4441b2;
    text-decoration: underline;
}

/* === PAINÉIS (visibilidade) === */
.modal-painel {
    display: none;
}
.modal-painel.ativo {
    display: block;
}

/* === MENSAGEM DE FEEDBACK === */
.modal-feedback {
    font-size: 0.8125rem;
    text-align: center;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
    display: none;
    font-weight: 500;
}
.modal-feedback.erro {
    display: block;
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #fed7d7;
}
.modal-feedback.sucesso {
    display: block;
    background: #f0fff4;
    color: #276749;
    border: 1px solid #c6f6d5;
}

/* === NOTA DO CADASTRO === */
.modal-nota {
    font-size: 0.75rem;
    color: #a0aec0;
    text-align: center;
    margin: 10px 0 16px;
    line-height: 1.5;
}

/* === BOTÃO "Entrar" NO HEADER === */
.btn-abrir-login {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    border-radius: 10px;
    border: 1.5px solid rgba(94, 92, 230, 0.4);
    background: rgba(94, 92, 230, 0.08);
    color: #5e5ce6;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'Inter', system-ui, sans-serif;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}
.btn-abrir-login:hover {
    background: rgba(94, 92, 230, 0.15);
    border-color: rgba(94, 92, 230, 0.7);
    color: #7c7ae8;
    box-shadow: 0 0 18px rgba(94, 92, 230, 0.15);
}

/* === RESPONSIVIDADE === */
@media (max-width: 480px) {
    .modal-card {
        padding: 28px 20px 24px;
        border-radius: 20px;
    }
    .modal-sociais {
        flex-direction: column;
    }
    .modal-social-btn {
        justify-content: center;
        padding: 12px;
    }
    .btn-abrir-login span {
        display: none;
    }
    .btn-abrir-login {
        padding: 9px 12px;
    }
}

/* === INPUTS OTP (código 4 dígitos) === */
.otp-wrap {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
}
.otp-input {
    width: 58px;
    height: 64px;
    border-radius: 14px;
    border: 2px solid #e2e8f0;
    background: #eef1f7;
    color: #1a202c;
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    caret-color: #5e5ce6;
    font-family: 'Inter', system-ui, sans-serif;
    -moz-appearance: textfield;
}
.otp-input:focus {
    border-color: #5e5ce6;
    background: #f0f0ff;
    box-shadow: 0 0 0 3px rgba(94,92,230,0.15);
}
.otp-input::-webkit-outer-spin-button,
.otp-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.modal-email-hint {
    font-size: 0.8125rem;
    color: #718096;
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.5;
}
.modal-email-hint strong { color: #2d3748; font-weight: 600; }
.modal-reenviar {
    text-align: center;
    font-size: 0.8rem;
    color: #a0aec0;
    margin-top: 14px;
}
.modal-reenviar span {
    color: #5e5ce6;
    font-weight: 600;
    cursor: pointer;
}
.modal-reenviar span:hover { color: #4441b2; text-decoration: underline; }

@media (max-width: 380px) {
    .otp-input { width: 48px; height: 54px; font-size: 1.4rem; }
    .otp-wrap  { gap: 8px; }
}
