/* ============================================================
   Reset e base
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body.vg-login-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #1a1a2e;
    background: #f0f4ff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto; /* permite scroll quando teclado virtual push a viewport */
    position: relative;
}

/* ============================================================
   Formas decorativas de fundo
   ============================================================ */

.vg-login-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.vg-login-shape {
    position: absolute;
    border-radius: 50%;
}

.vg-login-shape--blue {
    width: 520px;
    height: 520px;
    background: #2d4ef5;
    bottom: -120px;
    right: -80px;
    border-radius: 40% 60% 55% 45% / 45% 35% 65% 55%;
}

.vg-login-shape--teal {
    width: 380px;
    height: 380px;
    background: #4ecdc4;
    top: -100px;
    right: 80px;
    border-radius: 55% 45% 40% 60% / 60% 50% 50% 40%;
    opacity: .75;
}

.vg-login-shape--gold {
    width: 200px;
    height: 200px;
    border: 2px solid #f0c040;
    background: transparent;
    bottom: 60px;
    right: 300px;
    border-radius: 50%;
    opacity: .5;
}

/* ============================================================
   Card de login
   ============================================================ */

.vg-login-card {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(45, 78, 245, .12), 0 4px 16px rgba(0,0,0,.08);
    padding: 48px 40px 40px;
    width: 100%;
    max-width: 420px;
    margin: 24px;
}

/* ============================================================
   Logo / ícone do sistema
   ============================================================ */

.vg-login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.vg-login-logo__icon {
    width: 64px;
    height: 64px;
    background: #4ecdc4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    box-shadow: 0 4px 16px rgba(78, 205, 196, .4);
}

.vg-login-title {
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.5px;
    color: #1a1a2e;
    margin-bottom: 32px;
}

/* ============================================================
   Mensagem de erro
   ============================================================ */

.vg-login-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
}

/* ============================================================
   Formulário
   ============================================================ */

.vg-login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.vg-login-field {
    display: flex;
    align-items: center;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
    gap: 10px;
    transition: border-color .2s;
}

.vg-login-field:focus-within {
    border-color: #2d4ef5;
}

.vg-login-field__icon {
    font-size: 18px;
    color: #94a3b8;
    flex-shrink: 0;
    transition: color .2s;
    line-height: 1;
}

.vg-login-field:focus-within .vg-login-field__icon {
    color: #2d4ef5;
}

.vg-login-field input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    color: #1a1a2e;
    background: transparent;
    font-family: inherit;
    padding: 2px 0;
}

.vg-login-field input::placeholder {
    color: #94a3b8;
}

.vg-login-btn-submit {
    margin-top: 8px;
    height: 52px;
    background: #2d4ef5;
    color: #fff;
    border: none;
    border-radius: 26px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: .2px;
    transition: background .2s, transform .1s, box-shadow .2s;
    box-shadow: 0 4px 16px rgba(45, 78, 245, .35);
}

.vg-login-btn-submit:hover {
    background: #1d3de0;
    box-shadow: 0 6px 20px rgba(45, 78, 245, .45);
}

.vg-login-btn-submit:active {
    transform: scale(.98);
}

.vg-login-btn-submit:disabled {
    background: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
}

/* P3 — Focus-visible */
.vg-login-btn-submit:focus-visible,
.vg-perfil-btn:focus-visible {
    outline: 2px solid #2d4ef5;
    outline-offset: 2px;
}

/* P3 — Touch feedback */
.vg-perfil-btn:active { transform: scale(.97); }

/* ============================================================
   Seletor de perfil
   ============================================================ */

.vg-login-perfis {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #f1f5f9;
}

.vg-login-perfis__label {
    display: block;
    text-align: center;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    letter-spacing: .3px;
    margin-bottom: 14px;
    text-transform: uppercase;
}

.vg-login-perfis__btns {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.vg-perfil-btn {
    flex: 1;
    min-width: 90px;
    max-width: 130px;
    padding: 9px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: border-color .2s, color .2s, background .2s, box-shadow .2s;
    text-align: center;
    white-space: nowrap;
}

.vg-perfil-btn:hover {
    border-color: #2d4ef5;
    color: #2d4ef5;
    background: #eef1fd;
}

.vg-perfil-btn--active {
    border-color: #2d4ef5;
    background: #2d4ef5;
    color: #fff;
    box-shadow: 0 2px 10px rgba(45, 78, 245, .3);
}

/* ============================================================
   Páginas de boas-vindas (temporárias)
   ============================================================ */

body.vg-welcome-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f4ff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a2e;
}

.vg-welcome-card {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(45, 78, 245, .12);
    padding: 48px 40px;
    width: 100%;
    max-width: 480px;
    margin: 24px;
    text-align: center;
}

.vg-welcome-icon {
    width: 72px;
    height: 72px;
    background: #4ecdc4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 20px;
    box-shadow: 0 4px 16px rgba(78, 205, 196, .4);
}

.vg-welcome-title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.4px;
    margin-bottom: 8px;
}

.vg-welcome-role {
    display: inline-block;
    background: #eef1fd;
    color: #2d4ef5;
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
}

.vg-welcome-user {
    color: #64748b;
    font-size: 15px;
    margin-bottom: 32px;
}

.vg-welcome-notice {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13px;
    margin-bottom: 28px;
    line-height: 1.6;
}

.vg-welcome-logout {
    display: inline-block;
    padding: 12px 28px;
    background: #2d4ef5;
    color: #fff;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background .2s;
    box-shadow: 0 4px 12px rgba(45, 78, 245, .3);
}

.vg-welcome-logout:hover {
    background: #1d3de0;
    color: #fff;
}

/* ============================================================
   Responsivo
   ============================================================ */

@media (max-width: 480px) {
    .vg-login-card,
    .vg-welcome-card {
        padding: 36px 24px 32px;
        /* garante scroll se teclado virtual comprimir a viewport */
        margin: 16px;
    }

    /* P1 — Safari iOS auto-zoom: font-size ≥ 16px */
    .vg-login-field input {
        font-size: 16px;
    }

    /* P1 — tap targets ≥ 44px */
    .vg-perfil-btn {
        min-height: 44px;
    }

    .vg-login-btn-submit {
        min-height: 52px;
    }

    .vg-login-shape--blue {
        width: 320px;
        height: 320px;
        right: -60px;
        bottom: -80px;
    }

    .vg-login-shape--teal {
        width: 240px;
        height: 240px;
        right: 20px;
        top: -60px;
    }

    .vg-login-shape--gold {
        display: none;
    }
}
