:root {
    --bg-gradient: linear-gradient(135deg, var(--bg, #f7fbfc) 0%, #e8f5f7 100%);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(45, 122, 133, 0.10);
    --login-text: var(--ink, #0d1f22);
    --login-sub: var(--muted, #5b7f8a);
    --shadow-color: rgba(15, 40, 50, 0.10);
    --logo-bg: #fff;
    --primary: var(--teal, #2d7a85);
    --primary-light: var(--teal-mid, #3a9aaa);
}

/* Suprimir aurora global do base.css no login */
body.login-body::before {
    display: none;
}

body.login-body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body, 'DM Sans'), system-ui, sans-serif;
    color: var(--login-text);
    background: var(--bg-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
}

/* ─── Fundo animado Visão Care (V6 sparks claros) ──────────────────── */
.login-bg {
    --azul-profundo: #0b5261;
    --azul-principal: #1f91a5;
    --azul-claro: #82d6e4;
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(circle at 78% 18%, rgba(31, 145, 165, 0.27), transparent 31%),
        radial-gradient(circle at 22% 22%, rgba(130, 214, 228, 0.20), transparent 30%),
        radial-gradient(circle at 18% 80%, rgba(11, 82, 97, 0.16), transparent 35%),
        radial-gradient(circle at 74% 78%, rgba(31, 145, 165, 0.18), transparent 34%),
        radial-gradient(circle at 50% 48%, rgba(130, 214, 228, 0.16), transparent 42%),
        linear-gradient(135deg, #f7fcfd 0%, #e8f6fa 36%, #dff2f7 62%, #f4fbfd 100%);
}

.login-bg .azul-difuso {
    position: absolute;
    inset: -10%;
    z-index: 0;
    opacity: 0.78;
    background:
        radial-gradient(circle at 30% 30%, rgba(130, 214, 228, 0.22), transparent 25%),
        radial-gradient(circle at 63% 26%, rgba(31, 145, 165, 0.17), transparent 29%),
        radial-gradient(circle at 42% 52%, rgba(130, 214, 228, 0.15), transparent 28%),
        radial-gradient(circle at 38% 74%, rgba(31, 145, 165, 0.14), transparent 26%),
        radial-gradient(circle at 82% 62%, rgba(130, 214, 228, 0.18), transparent 27%);
    filter: blur(8px);
    animation: loginAzulRespirando 18s ease-in-out infinite alternate;
    pointer-events: none;
}

.login-bg .centro-suave {
    position: absolute;
    inset: 0;
    z-index: 8;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.10) 18%, rgba(130, 214, 228, 0.07) 38%, transparent 56%);
    pointer-events: none;
}

.login-bg .pontos-digitais {
    position: absolute;
    inset: -4%;
    z-index: 1;
    opacity: 0.42;
    background-image: radial-gradient(circle, rgba(11, 82, 97, 0.24) 1px, transparent 1.7px);
    background-size: 20px 20px;
    mask-image:
        radial-gradient(circle at 80% 22%, black 0%, transparent 40%),
        radial-gradient(circle at 16% 82%, black 0%, transparent 36%),
        radial-gradient(circle at 50% 50%, rgba(0,0,0,0.48) 0%, rgba(0,0,0,0.34) 25%, black 62%, transparent 88%);
    -webkit-mask-image:
        radial-gradient(circle at 80% 22%, black 0%, transparent 40%),
        radial-gradient(circle at 16% 82%, black 0%, transparent 36%),
        radial-gradient(circle at 50% 50%, rgba(0,0,0,0.48) 0%, rgba(0,0,0,0.34) 25%, black 62%, transparent 88%);
    animation: loginMoverPontos 30s ease-in-out infinite alternate;
    pointer-events: none;
}

.login-bg .pontos-centrais {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0.17;
    background-image: radial-gradient(circle, rgba(31, 145, 165, 0.34) 0.75px, transparent 1.2px);
    background-size: 18px 18px;
    mask-image: radial-gradient(circle at 50% 50%, black 0%, rgba(0,0,0,0.72) 35%, transparent 68%);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, black 0%, rgba(0,0,0,0.72) 35%, transparent 68%);
    animation: loginRespirarTextura 14s ease-in-out infinite;
    pointer-events: none;
}

.login-bg .pontos-finissimos {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0.15;
    background-image: radial-gradient(circle, rgba(31, 145, 165, 0.32) 0.65px, transparent 1.1px);
    background-size: 8px 8px;
    animation: loginRespirarTextura 12s ease-in-out infinite;
    pointer-events: none;
}

.login-bg .sparks {
    position: absolute;
    inset: 0;
    z-index: 7;
    pointer-events: none;
    overflow: hidden;
}

.login-bg .spark {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--s);
    height: var(--s);
    border-radius: 999px;
    background: rgba(255, 255, 255, 1);
    box-shadow:
        0 0 4px rgba(255, 255, 255, 0.95),
        0 0 10px rgba(196, 244, 252, 0.95),
        0 0 22px rgba(31, 145, 165, 0.55),
        0 0 38px rgba(130, 214, 228, 0.32);
    transform: translate3d(0, 0, 0) scale(0.82);
    opacity: 0.30;
    animation:
        loginCintilar var(--d) ease-in-out infinite,
        loginFlutuarSpark calc(var(--d) * 1.5) ease-in-out infinite alternate;
    animation-delay: var(--delay);
}

.login-bg .spark::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(var(--s) * 6.5);
    height: 1px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.82), transparent);
    transform: translate(-50%, -50%) rotate(0deg) scaleX(0.4);
    opacity: 0;
    animation: loginBrilhoHorizontal var(--d) ease-in-out infinite;
    animation-delay: var(--delay);
}

.login-bg .spark::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(var(--s) * 8);
    height: 1px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(196, 244, 252, 0.86), transparent);
    transform: translate(-50%, -50%) rotate(35deg) scaleX(0.4);
    opacity: 0;
    animation: loginRiscoLuz var(--d) ease-in-out infinite;
    animation-delay: var(--delay);
}

.login-bg .halo {
    position: absolute;
    z-index: 0;
    border-radius: 999px;
    filter: blur(2px);
    pointer-events: none;
}

.login-bg .halo.superior {
    width: 48rem;
    height: 48rem;
    top: -22rem;
    right: -18rem;
    background: radial-gradient(circle, rgba(130, 214, 228, 0.30), rgba(31, 145, 165, 0.12) 42%, transparent 72%);
    animation: loginFlutuarSuperior 28s ease-in-out infinite alternate;
}

.login-bg .halo.inferior {
    width: 52rem;
    height: 52rem;
    left: -24rem;
    bottom: -25rem;
    background: radial-gradient(circle, rgba(11, 82, 97, 0.16), rgba(130, 214, 228, 0.11) 43%, transparent 72%);
    animation: loginFlutuarInferior 32s ease-in-out infinite alternate;
}

.login-bg .linhas-suaves {
    position: absolute;
    inset: 0;
    z-index: 3;
    opacity: 0.40;
    pointer-events: none;
}

.login-bg .linhas-suaves svg {
    width: 100%;
    height: 100%;
    display: block;
}

.login-bg .linha {
    fill: none;
    stroke: rgba(11, 82, 97, 0.13);
    stroke-width: 1;
    stroke-linecap: round;
    stroke-dasharray: 4 16;
    animation: loginDeslocarLinha 20s linear infinite;
}

.login-bg .linha-clara {
    fill: none;
    stroke: rgba(31, 145, 165, 0.20);
    stroke-width: 1;
    stroke-linecap: round;
    stroke-dasharray: 3 14;
    animation: loginDeslocarLinha 24s linear infinite reverse;
}

.login-bg .no {
    fill: rgba(31, 145, 165, 0.50);
    filter: drop-shadow(0 0 6px rgba(31, 145, 165, 0.30));
    animation: loginPulsoNo 6s ease-in-out infinite;
}

.login-bg .no-escuro {
    fill: rgba(11, 82, 97, 0.34);
    filter: drop-shadow(0 0 5px rgba(11, 82, 97, 0.18));
    animation: loginPulsoNo 7s ease-in-out infinite;
}

.login-bg .scanline {
    position: absolute;
    inset: 0;
    z-index: 5;
    opacity: 0.19;
    background: linear-gradient(110deg, transparent 0%, transparent 42%, rgba(31, 145, 165, 0.12) 50%, transparent 58%, transparent 100%);
    transform: translateX(-30%);
    animation: loginVarredura 20s ease-in-out infinite;
    pointer-events: none;
}

.login-bg .vinheta {
    position: absolute;
    inset: 0;
    z-index: 9;
    background: radial-gradient(circle at center, transparent 0%, transparent 60%, rgba(218, 235, 241, 0.46) 100%);
    pointer-events: none;
}

@keyframes loginAzulRespirando {
    0%   { transform: translate3d(-1rem, 0, 0) scale(1); opacity: 0.62; }
    100% { transform: translate3d(1rem, -0.8rem, 0) scale(1.035); opacity: 0.84; }
}

@keyframes loginMoverPontos {
    0%   { transform: translate3d(-8px, 6px, 0) scale(1); opacity: 0.34; }
    100% { transform: translate3d(16px, -12px, 0) scale(1.025); opacity: 0.48; }
}

@keyframes loginRespirarTextura {
    0%, 100% { opacity: 0.12; }
    50%      { opacity: 0.22; }
}

@keyframes loginCintilar {
    0%, 100% { opacity: 0.24; transform: scale(0.76); }
    40%      { opacity: 0.50; transform: scale(1.00); }
    50%      { opacity: 1;    transform: scale(1.55); }
    60%      { opacity: 0.48; transform: scale(1.04); }
}

@keyframes loginFlutuarSpark {
    0%   { translate: -10px 8px; }
    100% { translate: 14px -12px; }
}

@keyframes loginBrilhoHorizontal {
    0%, 43%, 100% { opacity: 0;    transform: translate(-50%, -50%) rotate(0deg) scaleX(0.3); }
    50%           { opacity: 0.55; transform: translate(-50%, -50%) rotate(0deg) scaleX(1); }
    60%           { opacity: 0;    transform: translate(-50%, -50%) rotate(0deg) scaleX(0.55); }
}

@keyframes loginRiscoLuz {
    0%, 43%, 100% { opacity: 0;    transform: translate(-50%, -50%) rotate(35deg) scaleX(0.4); }
    50%           { opacity: 0.70; transform: translate(-50%, -50%) rotate(35deg) scaleX(1); }
    60%           { opacity: 0;    transform: translate(-50%, -50%) rotate(35deg) scaleX(0.5); }
}

@keyframes loginFlutuarSuperior {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(-2.4rem, 1.8rem, 0) scale(1.06); }
}

@keyframes loginFlutuarInferior {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(2.8rem, -1.8rem, 0) scale(1.05); }
}

@keyframes loginDeslocarLinha {
    from { stroke-dashoffset: 0; }
    to   { stroke-dashoffset: -140; }
}

@keyframes loginPulsoNo {
    0%, 100% { opacity: 0.36; transform: scale(1); }
    50%      { opacity: 0.88; transform: scale(1.25); }
}

@keyframes loginVarredura {
    0%, 100% { transform: translateX(-42%); opacity: 0.09; }
    50%      { transform: translateX(42%);  opacity: 0.23; }
}

@media (prefers-reduced-motion: reduce) {
    .login-bg .azul-difuso,
    .login-bg .pontos-digitais,
    .login-bg .pontos-centrais,
    .login-bg .pontos-finissimos,
    .login-bg .spark,
    .login-bg .spark::before,
    .login-bg .spark::after,
    .login-bg .halo,
    .login-bg .linha,
    .login-bg .linha-clara,
    .login-bg .no,
    .login-bg .no-escuro,
    .login-bg .scanline {
        animation: none;
    }
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    position: relative;
    background: #ffffff;
    border: 1px solid var(--glass-border);
    border-radius: var(--r-xl, 26px);
    padding: 48px;
    box-shadow: 0 10px 40px -10px rgba(15, 40, 50, 0.12);
    display: flex;
    flex-direction: column;
    justify-content: center;
    animation: fadeIn 0.8s ease-out;
}

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

.logo-circle {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
}

.login-header h1 {
    font-family: var(--font-display, 'DM Serif Display'), Georgia, serif;
    font-size: 2.2rem;
    font-weight: 400;
    color: var(--login-text);
    margin: 0;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.login-header p {
    color: var(--login-sub);
    font-size: 0.875rem;
}

.status-msg {
    padding: 12px;
    border-radius: 12px;
    font-size: 0.8125rem;
    margin-bottom: 24px;
    text-align: center;
    font-weight: 500;
}

.msg-err {
    background-color: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.msg-info {
    background-color: rgba(56, 189, 248, 0.15);
    color: #7dd3fc;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.field {
    margin-bottom: 24px;
}

.lbl {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--login-sub);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    display: block;
}

.input-wrapper {
    position: relative;
}

input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #1e293b;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

/* Chrome autofill styling */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--login-text);
    -webkit-box-shadow: 0 0 0px 1000px #fff inset;
    transition: background-color 5000s ease-in-out 0s;
}

input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(45, 122, 133, 0.15);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    background: linear-gradient(to right, var(--primary), var(--primary-light));
    border: none;
    border-radius: var(--r-full, 9999px);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(45, 122, 133, 0.35);
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(45, 122, 133, 0.35);
    filter: brightness(1.1);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ─── Variantes para fluxos de auth (recuperação/redefinição) ────────── */
.login-card.login-card--auth {
    aspect-ratio: auto;
    padding: 40px 40px 28px;
}

.field--auth {
    margin-bottom: 16px;
}

.field--auth + .field--auth {
    margin-bottom: 10px;
}

.login-header.login-header--stacked {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    margin-bottom: 28px;
}

.login-header--stacked .logo-circle {
    width: 56px;
    height: 56px;
}

.login-header--stacked h1 {
    font-size: 1.55rem;
    line-height: 1.15;
    white-space: normal;
    max-width: 22ch;
}

.login-header--stacked p {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--login-sub);
    margin: 0;
    max-width: 32ch;
}

/* Label mais suave nas telas de auth (sem caixa alta) */
.field--auth .lbl {
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--login-text);
    opacity: 0.78;
}

/* Toggle de mostrar/ocultar senha */
.field--auth .input-wrapper {
    position: relative;
}

.field--auth input[type="password"],
.field--auth input[type="text"] {
    padding-right: 46px;
}

.pwd-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--login-sub);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.pwd-toggle:hover {
    color: var(--primary);
    background: rgba(45, 122, 133, 0.08);
}

.pwd-toggle.is-revealed {
    color: var(--primary);
}

.pwd-toggle__icon {
    display: block;
}

.pwd-toggle .pwd-toggle__icon--open { display: none; }
.pwd-toggle.is-revealed .pwd-toggle__icon--closed { display: none; }
.pwd-toggle.is-revealed .pwd-toggle__icon--open { display: block; }

/* Dica única e discreta, com checks inline por requisito */
.pwd-hint {
    position: relative;
    margin: 6px 2px 14px;
    padding: 0;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--login-sub);
    max-height: 120px;
    overflow: hidden;
    transition: color 0.25s ease, max-height 0.35s ease;
}

.pwd-hint.is-valid {
    max-height: 24px;
}

.pwd-hint__rules {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.pwd-hint__shield {
    flex-shrink: 0;
    margin-top: 3px;
    opacity: 0.6;
    transition: opacity 0.25s ease, color 0.25s ease;
}

.pwd-hint__success {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.875rem;
    opacity: 0;
    transform: scale(0.96);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.pwd-hint__success svg {
    flex-shrink: 0;
}

.pwd-hint.is-valid .pwd-hint__rules {
    opacity: 0;
    transform: scale(0.98);
    pointer-events: none;
}

.pwd-hint.is-valid .pwd-hint__success {
    opacity: 1;
    transform: scale(1);
}

.pwd-req {
    position: relative;
    color: inherit;
    transition: color 0.25s ease, font-weight 0.25s ease;
    white-space: nowrap;
}

.pwd-req::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 0;
    vertical-align: -1px;
    background-color: currentColor;
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'><path d='m3.5 8.5 3 3 6-7'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'><path d='m3.5 8.5 3 3 6-7'/></svg>");
    -webkit-mask-size: contain;
            mask-size: contain;
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
    -webkit-mask-position: center;
            mask-position: center;
    max-width: 0;
    opacity: 0;
    transform: scale(0.4);
    transition: margin-left 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                max-width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease,
                transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pwd-req.is-valid {
    color: var(--primary);
    font-weight: 600;
}

.pwd-req.is-valid::after {
    margin-left: 5px;
    max-width: 12px;
    opacity: 1;
    transform: scale(1);
}

/* Divisor "ou" entre o submit e o link de voltar */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0 2px;
    color: var(--login-sub);
    font-size: 0.75rem;
    text-transform: lowercase;
    letter-spacing: 0.04em;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(91, 127, 138, 0.25), transparent);
}

.auth-divider span {
    opacity: 0.7;
}

.login-footer-link {
    text-align: center;
    margin: 20px 0 0;
    font-size: 0.8125rem;
}

.login-footer-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.login-footer-link a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* Footer removal if needed, but keeping for now if used */
.login-footer {
    text-align: center;
    font-size: 0.6875rem;
    color: var(--login-sub);
    margin-top: 24px;
    opacity: 0.6;
}

/* ─── Dev Role Selector ─────────────────────────────────────────────── */

.dev-role-selector {
    margin-bottom: 24px;
}

.dev-role-label {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    text-align: center;
    padding: 6px 12px;
    background: rgba(45, 122, 133, 0.08);
    border-radius: 8px;
}

.dev-role-buttons {
    display: flex;
    gap: 10px;
}

.dev-role-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.25s ease;
}

.dev-role-btn:hover {
    border-color: var(--primary);
    background: rgba(45, 122, 133, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(45, 122, 133, 0.15);
}

.dev-role-btn:active {
    transform: scale(0.97);
}

.dev-role-icon {
    font-size: 1.75rem;
    line-height: 1;
}

.dev-role-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--login-text);
    letter-spacing: 0.01em;
}

