/* Estilos da tela de cadastro/perfil (atualiza.php).
   Estavam inline no proprio PHP: ~22KB rebaixados a cada visita, sem cache.
   O <link> em atualiza.php usa ?v=filemtime para invalidar o cache no deploy. */

    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
        font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    }

    body.ef-auth-page-bg {
        background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 50%, #f0f4f8 100%);
        min-height: 100vh;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 20px;
    }

    .ef-auth-container-page {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    /* --- CARD PRINCIPAL --- */
    .ef-auth-modal-body {
        background: #ffffff;
        border-radius: 24px;
        width: 100%;
        max-width: 460px;
        padding: 44px 38px 36px;
        position: relative;
        box-shadow:
            0 4px 6px -1px rgba(0, 0, 0, 0.04),
            0 20px 50px -12px rgba(0, 0, 0, 0.12),
            0 0 0 1px rgba(0, 0, 0, 0.02);
        overflow: hidden;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .ef-auth-modal-body:hover {
        box-shadow:
            0 4px 6px -1px rgba(0, 0, 0, 0.04),
            0 25px 60px -12px rgba(0, 0, 0, 0.16),
            0 0 0 1px rgba(0, 0, 0, 0.02);
    }

    /* Barra superior gradiente mais refinada */
    .ef-auth-modal-body::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 6px;
        background: linear-gradient(90deg, #003366 0%, #2563eb 50%, #4a90e2 100%);
        background-size: 200% 100%;
        animation: efShimmerBar 4s ease-in-out infinite;
    }

    @keyframes efShimmerBar {
        0%, 100% { background-position: 0% 50%; }
        50% { background-position: 100% 50%; }
    }

    /* Brilho sutil no canto */
    .ef-auth-modal-body::after {
        content: '';
        position: absolute;
        top: -80px;
        right: -80px;
        width: 200px;
        height: 200px;
        background: radial-gradient(circle, rgba(74, 144, 226, 0.06) 0%, transparent 70%);
        pointer-events: none;
    }

    @media (min-width: 850px) {
        .ef-signup-container {
            max-width: 860px;
        }
        .ef-signup-layout {
            display: grid;
            grid-template-columns: 240px 1fr;
            gap: 44px;
        }
    }

    /* --- CABEÇALHO --- */
    .ef-auth-header {
        margin-bottom: 30px;
    }

    .ef-header-flex-container {
        display: flex;
        align-items: center;
        gap: 18px;
    }

    .ef-site-icon {
        width: 80px;
        height: 80px;
        object-fit: contain;
        border-radius: 16px;
        padding: 4px;
        transition: transform 0.3s ease;
        filter: drop-shadow(0 4px 8px rgba(0, 51, 102, 0.1));
    }

    .ef-site-icon:hover {
        transform: scale(1.05) rotate(-2deg);
    }

    .ef-header-right-stack {
        display: flex;
        flex-direction: column;
        gap: 2px;
        flex: 1;
    }

    #ef-authTitle {
        color: #0a2540;
        font-size: 24px;
        font-weight: 800;
        letter-spacing: -0.5px;
        line-height: 1.2;
    }

    .ef-auth-divider-hr {
        border: none;
        border-top: 1px solid #e8ecf1;
        margin: 5px 0;
    }

    #ef-authSubtitle {
        color: #6b7a90;
        font-size: 14px;
        font-weight: 400;
    }


    /* =========================================
       STEPPER PREMIUM
       ========================================= */
    .ef-signup-stepper {
        display: flex;
        flex-direction: column;
        gap: 16px;
        border-right: 1px solid #eef2f7;
        padding: 15px 24px 15px 0;
        position: relative;
    }

    .ef-step {
        display: flex;
        align-items: center;
        gap: 16px;
        padding: 14px 18px;
        border-radius: 16px;
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        cursor: pointer;
        position: relative;
        background: transparent;
        border: 1px solid transparent;
    }

    /* Efeito de Hover para passos habilitados e não ativos */
    .ef-step:not(.active):not(.disabled):hover {
        background: #f8fafc;
        border-color: #f1f5f9;
        transform: translateX(4px);
    }

    /* Estado Ativo (Focado atualmente) */
    .ef-step.active {
        background: linear-gradient(135deg, rgba(0, 51, 102, 0.03), rgba(74, 144, 226, 0.05));
        border-color: rgba(74, 144, 226, 0.15);
    }

    /* Estado Completado */
    .ef-step.completed {
        opacity: 0.95;
    }

    /* Estado Desativado */
    .ef-step.disabled {
        opacity: 0.35;
        pointer-events: none;
        cursor: not-allowed;
    }

    /* Wrapper do Ícone */
    .ef-step-icon-wrapper {
        position: relative;
        z-index: 2;
    }

    .ef-step-icon {
        width: 42px;
        height: 42px;
        background: #f1f5f9;
        border-radius: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        flex-shrink: 0;
        color: #94a3b8;
    }

    .ef-step-icon svg {
        width: 20px;
        height: 20px;
        transition: transform 0.3s ease;
    }

    /* Hover suave no ícone */
    .ef-step:not(.disabled):hover .ef-step-icon svg {
        transform: scale(1.1);
    }

    /* Cores por Estado - Ícone Ativo */
    .ef-step.active .ef-step-icon {
        background: linear-gradient(135deg, #003366, #4a90e2);
        border-color: transparent;
        color: #ffffff;
        box-shadow: 0 6px 16px rgba(0, 51, 102, 0.2);
    }

    /* Cores por Estado - Ícone Completo (Verde de Sucesso) */
    .ef-step.completed .ef-step-icon {
        background: #10b981;
        border-color: transparent;
        color: #ffffff;
        box-shadow: 0 6px 16px rgba(16, 185, 129, 0.25);
    }

    /* Textos */
    .ef-step-info {
        display: flex;
        flex-direction: column;
        gap: 3px;
        text-align: left;
    }

    .ef-step-title {
        font-size: 14px;
        font-weight: 700;
        color: #1e293b;
        transition: color 0.3s ease;
    }

    .ef-step.active .ef-step-title {
        color: #003366;
    }

    .ef-step-desc {
        font-size: 11px;
        color: #64748b;
        font-weight: 500;
    }

    /* Linha Conectora Vertical (Desktop) */
    .ef-step:not(:last-child)::after {
        content: '';
        position: absolute;
        top: 56px;
        left: 38px;
        width: 2px;
        height: calc(100% - 24px);
        background: #e2e8f0;
        z-index: 1;
        transition: background 0.4s ease;
    }

    /* Estiliza linha conectora se o passo seguinte estiver ativo ou completo */
    .ef-step.completed:not(:last-child)::after {
        background: #10b981;
    }

    /* =========================================
       NOVA VERSÃO MOBILE CORRIGIDA (Max 849px)
       ========================================= */
    @media (max-width: 849px) {
        .ef-signup-stepper {
            flex-direction: row;
            border-right: none;
            border-bottom: 1px solid #f1f5f9;
            padding: 10px 10px 24px 10px;
            margin-bottom: 32px;
            justify-content: space-between;
            gap: 0;
        }

        /* Linha de progresso cinza ao fundo passando por trás dos passos */
        .ef-signup-stepper::before {
            content: '';
            position: absolute;
            top: 32px;
            left: 40px;
            right: 40px;
            height: 2px;
            background: #e2e8f0;
            z-index: 0;
        }

        .ef-step {
            flex-direction: column;
            gap: 8px;
            padding: 0;
            background: transparent !important;
            border-color: transparent !important;
            flex: 1;
            justify-content: center;
            align-items: center;
        }

        .ef-step:not(.disabled):hover {
            transform: none;
        }

        /* Remove conectores verticais */
        .ef-step:not(:last-child)::after {
            display: none !important;
        }

        /* Ajuste fino nos ícones no mobile */
        .ef-step-icon {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            background: #ffffff;
            border-width: 2px;
            z-index: 2;
        }

        /* Esconde apenas as descrições no mobile para não ocupar tela */
        .ef-step-desc {
            display: none;
        }

        /* Títulos exibidos de maneira elegante debaixo do ícone */
        .ef-step-info {
            text-align: center;
            max-width: 90px;
        }

        .ef-step-title {
            font-size: 11px;
            font-weight: 600;
            color: #64748b;
            white-space: normal;
            line-height: 1.2;
        }

        .ef-step.active .ef-step-title {
            color: #003366;
            font-weight: 700;
        }
    }


    /* --- TOOLTIPS (CORRIGIDO) --- */
    .ef-tooltip-trigger {
        position: absolute;
        top: 50%;
        right: 20px;
        transform: translateY(-50%);
        width: 18px;
        height: 18px;
        background: #e8ecf1;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: help;
        transition: all 0.25s ease;
        z-index: 5;
    }

    .ef-tooltip-trigger::after {
        content: '?';
        font-size: 10px;
        font-weight: 800;
        color: #8896a6;
    }

    .ef-tooltip-trigger:hover {
        background: #4a90e2;
    }

    .ef-tooltip-trigger:hover::after {
        color: white;
    }

    .ef-tooltip-box {
        position: absolute;
        top: 50%;
        right: calc(100% + 12px);
        transform: translateY(-50%);
        background: #1a202c;
        color: white;
        font-size: 12px;
        font-weight: 500;
        line-height: 1.5;
        padding: 10px 14px;
        border-radius: 10px;
        width: 220px;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 10;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    }

    .ef-tooltip-box::after {
        content: '';
        position: absolute;
        top: 50%;
        right: -6px;
        transform: translateY(-50%) rotate(45deg);
        width: 12px;
        height: 12px;
        background: #1a202c;
    }

    .ef-tooltip-trigger:hover .ef-tooltip-box {
        opacity: 1;
        visibility: visible;
        transform: translateY(-50%) translateX(-4px);
    }

    /* TOOLTIP MOBILE: aparece ACIMA em vez de na lateral */
    @media (max-width: 600px) {
        .ef-tooltip-trigger {
            position: relative;
            top: auto;
            right: auto;
            transform: none;
            margin-left: 8px;
            display: inline-flex;
        }
        
        .ef-tooltip-box {
            right: auto;
            left: 50%;
            top: auto;
            bottom: calc(100% + 10px);
            transform: translateX(-50%);
            width: 200px;
        }
        
        .ef-tooltip-box::after {
            right: auto;
            left: 50%;
            top: auto;
            bottom: -6px;
            transform: translateX(-50%) rotate(45deg);
        }
        
        .ef-tooltip-trigger:hover .ef-tooltip-box {
            opacity: 1;
            visibility: visible;
            transform: translateX(-50%) translateY(-4px);
        }
    }

    /* --- INPUTS E FORMULÁRIO --- */
    .ef-auth-field {
        margin-bottom: 20px;
        position: relative;
    }

    .ef-auth-input-wrapper {
        position: relative;
    }

    .ef-auth-input {
        width: 100%;
        padding: 16px 18px;
        border: 1.5px solid #e2e8f0;
        border-radius: 12px;
        font-size: 14.5px;
        font-weight: 500;
        color: #1a202c;
        outline: none;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        background: #fafbfc;
        appearance: none;
        -webkit-appearance: none;
    }

    .ef-auth-input:hover {
        border-color: #cbd5e0;
        background: #ffffff;
    }

    .ef-auth-input:focus {
        border-color: #4a90e2;
        background: #ffffff;
        box-shadow:
            0 0 0 3px rgba(74, 144, 226, 0.1),
            0 1px 2px rgba(0, 0, 0, 0.04);
    }

    /* Seta custom para selects */
    select.ef-auth-input {
        cursor: pointer;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238896a6' d='M6 8.825L1.175 4 2.238 2.938 6 6.7l3.763-3.763L10.825 4z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 16px center;
        padding-right: 42px;
    }

    /* Enquanto nenhum pais foi escolhido (select required com value="" = :invalid),
       o texto da opcao placeholder fica na cor do label flutuante. */
    select.ef-auth-input:required:invalid {
        color: #a0aec0;
    }
    select.ef-auth-input option {
        color: #1a202c;
    }

    /* Placeholder label flutuante */
    .ef-auth-input-wrapper label {
        position: absolute;
        top: 50%;
        left: 18px;
        transform: translateY(-50%);
        font-size: 14.5px;
        font-weight: 500;
        color: #a0aec0;
        pointer-events: none;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        background: transparent;
    }

    .ef-auth-input:focus + label,
    .ef-auth-input:not(:placeholder-shown) + label,
    .ef-auth-input.has-value + label {
        top: -1px;
        left: 14px;
        font-size: 11.5px;
        font-weight: 700;
        color: #4a90e2;
        background: #ffffff;
        padding: 0 8px;
        z-index: 2;
        letter-spacing: 0.3px;
        text-transform: uppercase;
    }

    /* Ícone à esquerda (NOVO) */
    .ef-input-icon {
        position: absolute;
        top: 50%;
        left: 16px;
        transform: translateY(-50%);
        color: #a0aec0;
        transition: color 0.3s ease;
        pointer-events: none;
        z-index: 3;
    }

    .ef-input-icon + .ef-auth-input {
        padding-left: 44px;
    }

    .ef-input-icon + .ef-auth-input + label {
        left: 44px;
    }

    .ef-input-icon + .ef-auth-input:focus + label,
    .ef-input-icon + .ef-auth-input:not(:placeholder-shown) + label {
        left: 38px;
    }

    .ef-input-icon.active {
        color: #4a90e2;
    }

    /* Toggle visibilidade senha */
    .ef-toggle-password {
        position: absolute;
        top: 50%;
        right: 14px;
        transform: translateY(-50%);
        background: none;
        border: none;
        cursor: pointer;
        color: #a0aec0;
        font-size: 16px;
        padding: 4px;
        transition: color 0.25s ease;
        z-index: 3;
    }

    .ef-toggle-password:hover {
        color: #4a90e2;
    }

    /* --- SISTEMA DE ERROS --- */
    .ef-auth-message.error {
        padding: 14px 18px;
        border-radius: 12px;
        margin-bottom: 24px;
        text-align: center;
        font-size: 13.5px;
        font-weight: 500;
        background: linear-gradient(135deg, #fff5f5, #fff0f0);
        color: #c53030;
        border: 1px solid #fed7d7;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        animation: efShakeIn 0.4s ease;
    }

    @keyframes efShakeIn {
        0%, 100% { transform: translateX(0); }
        20% { transform: translateX(-6px); }
        40% { transform: translateX(6px); }
        60% { transform: translateX(-3px); }
        80% { transform: translateX(3px); }
    }

    .ef-field-error-msg {
        display: none;
        color: #e53e3e;
        font-size: 12px;
        font-weight: 500;
        margin-top: 6px;
        padding-left: 4px;
        align-items: center;
        gap: 5px;
    }

    .ef-field-error-msg::before {
        content: '!';
        width: 15px;
        height: 15px;
        background: #fed7d7;
        color: #c53030;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        font-weight: 800;
        flex-shrink: 0;
    }

    .ef-auth-field.has-error .ef-auth-input {
        border-color: #fc8181;
        background: #fff5f5;
        box-shadow: 0 0 0 3px rgba(252, 129, 129, 0.12);
    }

    .ef-auth-field.has-error label {
        color: #e53e3e !important;
    }

    .ef-auth-field.has-error .ef-field-error-msg {
        display: flex;
    }

    /* Sucesso no campo.
       A classe e 'is-valid', que e o que o validate.js aplica (setFieldSuccess).
       O CSS dizia '.has-success', classe que nenhum JS adiciona — o estado verde
       de campo validado nunca chegava a aparecer. */
    .ef-auth-field.is-valid .ef-auth-input {
        border-color: #68d391;
        background: #f0fff4;
    }

    .ef-auth-field.is-valid label {
        color: #38a169 !important;
    }

    /* --- TELAS E ANIMAÇÃO --- */
    .ef-auth-screen {
        display: none;
    }

    .ef-auth-screen.active {
        display: block;
        animation: efFadeSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    @keyframes efFadeSlideIn {
        from {
            opacity: 0;
            transform: translateY(12px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* --- BOTÕES --- */
    .ef-auth-btn {
        width: 100%;
        padding: 15px 20px;
        border: none;
        border-radius: 12px;
        font-size: 14.5px;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        letter-spacing: 0.2px;
    }

    .ef-auth-btn-primary {
        background: linear-gradient(135deg, #003366 0%, #2563eb 60%, #4a90e2 100%);
        background-size: 200% 200%;
        color: white;
        box-shadow: 0 4px 14px rgba(0, 51, 102, 0.25);
    }

    .ef-auth-btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 22px rgba(0, 51, 102, 0.3);
        background-position: right center;
    }

    .ef-auth-btn-primary:active {
        transform: translateY(0);
        box-shadow: 0 2px 8px rgba(0, 51, 102, 0.2);
    }

    .ef-auth-btn-outline {
        background: #ffffff;
        color: #4a90e2;
        border: 1.5px solid #d6e4f5;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    }

    .ef-auth-btn-outline:hover {
        background: #f0f6ff;
        border-color: #4a90e2;
        transform: translateY(-1px);
        box-shadow: 0 4px 10px rgba(74, 144, 226, 0.12);
    }

    /* --- LOADING NO BOTÃO --- */
    .ef-spinner {
        width: 20px;
        height: 20px;
        border: 2.5px solid rgba(255, 255, 255, 0.25);
        border-top-color: white;
        border-radius: 50%;
        animation: efSpin 0.75s linear infinite;
        position: absolute;
        opacity: 0;
    }

    @keyframes efSpin {
        to { transform: rotate(360deg); }
    }

    .loading .ef-btn-text { opacity: 0; }
    .loading .ef-spinner { opacity: 1; }
    .loading {
        pointer-events: none;
        opacity: 0.85;
    }

    /* --- CHECKBOX PERSONALIZADO --- */
    .ef-custom-checkbox {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        margin: 20px 0;
        cursor: pointer;
    }

    .ef-custom-checkbox input[type="checkbox"] {
        display: none;
    }

    .ef-checkbox-mark {
        width: 20px;
        height: 20px;
        border: 2px solid #d6e4f5;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.25s ease;
        flex-shrink: 0;
        margin-top: 1px;
    }

    .ef-custom-checkbox input:checked + .ef-checkbox-mark {
        background: linear-gradient(135deg, #003366, #4a90e2);
        border-color: #4a90e2;
    }

    .ef-checkbox-mark::after {
        content: '';
        width: 6px;
        height: 10px;
        border: 2px solid white;
        border-top: none;
        border-left: none;
        transform: rotate(45deg) scale(0);
        transition: transform 0.2s ease;
        margin-bottom: 2px;
    }

    .ef-custom-checkbox input:checked + .ef-checkbox-mark::after {
        transform: rotate(45deg) scale(1);
    }

    .ef-checkbox-label {
        font-size: 13px;
        color: #718096;
        line-height: 1.5;
    }

    .ef-checkbox-label a {
        color: #4a90e2;
        text-decoration: none;
        font-weight: 600;
    }

    .ef-checkbox-label a:hover {
        text-decoration: underline;
    }

    /* --- FOOTER --- */
    .ef-auth-footer {
        text-align: center;
        color: #8896a6;
        font-size: 13.5px;
    }

    .ef-auth-footer a {
        color: #4a90e2;
        text-decoration: none;
        font-weight: 700;
        transition: color 0.2s ease;
    }

    .ef-auth-footer a:hover {
        color: #003366;
        text-decoration: underline;
    }

    /* --- DIVIDER "OU" --- */
    .ef-divider-text {
        display: flex;
        align-items: center;
        gap: 16px;
        margin: 22px 0;
        color: #a0aec0;
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .ef-divider-text::before,
    .ef-divider-text::after {
        content: '';
        flex: 1;
        height: 1px;
        background: #eef2f7;
    }


    /* --- UTILITÁRIOS --- */
    .ef-step-content-section-title {
        font-size: 17px;
        font-weight: 700;
        color: #1a202c;
        margin-bottom: 4px;
    }

    .ef-step-content-section-desc {
        font-size: 13px;
        color: #8896a6;
        margin-bottom: 24px;
    }

    /* --- MOBILE COMPLETO --- */
    @media (max-width: 500px) {
        body.ef-auth-page-bg {
            padding: 15px;
        }
        
        .ef-auth-modal-body {
            padding: 30px 20px 26px;
            border-radius: 20px;
        }
        
        .ef-header-flex-container {
            gap: 12px;
        }
        
        .ef-site-icon {
            width: 56px;
            height: 56px;
        }
        
        #ef-authTitle {
            font-size: 21px;
        }
        
        #ef-authSubtitle {
            font-size: 13px;
        }
        
        .ef-auth-input {
            padding: 14px 16px;
            font-size: 14px;
        }
        
        .ef-auth-input-wrapper label {
            font-size: 14px;
            left: 16px;
        }
        
        .ef-auth-input:focus + label,
        .ef-auth-input:not(:placeholder-shown) + label,
        .ef-auth-input.has-value + label {
            font-size: 11px;
            left: 12px;
        }
        
        .ef-auth-btn {
            padding: 14px 18px;
            font-size: 14px;
        }
        
        .ef-tooltip-trigger {
            display: none;
        }
        
        .ef-step-title {
            font-size: 9px;
        }
    }
