/* Eurofarma login v2 - escopado em .login-v2 para não vazar para outras telas */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&family=Outfit:wght@400;700;800&display=swap');

.login-v2 {
    --bg-panel: #222625;
    --primary: #63C0AD;
    --primary-light: #9ADECC;
    --text-main: #ffffff;
    --text-muted: #959F9C;
    --input-bg: #3c403e;
    --input-border: #4d5250;
    --btn-dark: #454C4A;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Open Sans', sans-serif;

    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--text-main);
    background: url('../img/bg-healthcare.png') center/cover no-repeat;
    background-color: #3b7b6b;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 16px;
    z-index: 1;
}

.login-v2,
.login-v2 *,
.login-v2 *::before,
.login-v2 *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: inherit;
}

/* Escala dinâmica baseada em altura — evita scroll em telas pequenas */
@media (max-height: 900px) { .login-v2 { font-size: 14px; } }
@media (max-height: 750px) { .login-v2 { font-size: 12px; } }
@media (max-height: 650px) { .login-v2 { font-size: 11px; } }

/* Overlay verde */
.login-v2::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #478D77 0%, #63C0AD 100%);
    opacity: 0.52;
    z-index: 1;
    pointer-events: none;
}

/* Overlay escuro lateral */
.login-v2::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(89deg, black 0%, rgba(0, 0, 0, 0) 100%);
    opacity: 0.79;
    z-index: 2;
    pointer-events: none;
}

.login-v2 .login-wrapper {
    display: flex;
    width: 100%;
    height: 100vh;
    padding: 2em 4em;
    position: relative;
    z-index: 3;
    gap: 2em;
    max-width: 1600px;
    margin: 0 auto;
}

/* ============================ */
/* LADO ESQUERDO (apresentação) */
/* ============================ */
.login-v2 .login-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.login-v2 .logo-top {
    max-width: 280px;
    margin-top: 1em;
}

.login-v2 .left-bottom {
    margin-bottom: 3em;
}

.login-v2 .badge {
    display: inline-block;
    border: 1px solid var(--primary-light);
    border-radius: 41px;
    padding: 0.4em 1.2em;
    font-family: var(--font-heading);
    font-size: 1.1em;
    margin-bottom: 1em;
    background: rgba(0, 0, 0, 0.2);
}

.login-v2 .left-bottom h1 {
    font-family: var(--font-heading);
    font-size: 2.6em;
    font-weight: 400;
    line-height: 1.2;
    max-width: 600px;
    text-align: left;
    text-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
    margin: 0;
}

.login-v2 .left-bottom h1 strong {
    font-weight: 800;
}

/* ============================ */
/* LADO DIREITO (painel)        */
/* ============================ */
.login-v2 .login-right {
    position: relative;
    width: 100%;
    max-width: 680px;
    background: var(--bg-panel);
    border-radius: 24px;
    padding: 3em 2.5em;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0px 10px 40px rgba(0, 0, 0, 0.5);
    margin: auto 0;
    max-height: 94vh;
    overflow-y: auto;
}

.login-v2 .login-right::-webkit-scrollbar { width: 6px; }
.login-v2 .login-right::-webkit-scrollbar-track { background: transparent; }
.login-v2 .login-right::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 10px; }

.login-v2 .header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
    margin-bottom: 0.2em;
}

.login-v2 .header-top h2 {
    font-family: var(--font-heading);
    font-size: 1.8em;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap !important;
    word-break: keep-all;
    overflow-wrap: normal;
    flex-shrink: 0;
}

.login-v2 .subtitle {
    font-size: 1em;
    font-weight: 400;
    margin-bottom: 1.5em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 1em;
}

/* Mensagens de erro */
.login-v2 .alert-message {
    color: #ffd1d1;
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.35);
    border-radius: 8px;
    padding: 0.8em 1em;
    font-size: 0.9em;
    margin-bottom: 1em;
}

/* Anula o `#kc-form-login { width: 80% }` herdado de login.css — força o form a ocupar
   100% do card, alinhando inputs / botão Entrar / "esqueci minha senha" com os botões
   sociais e a linha divisória. */
.login-v2 #kc-form-login {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Formulário */
.login-v2 .input-group {
    margin-bottom: 1em;
    display: flex;
    flex-direction: column;
    gap: 0.4em;
}

.login-v2 .input-group label {
    font-size: 0.9em;
}

.login-v2 .input-group input {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    padding: 1em 1.2em;
    color: #fff;
    font-size: 1em;
    outline: none;
    transition: all 0.3s;
    width: 100%;
    height: auto;
}

.login-v2 .input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.login-v2 .input-group input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.login-v2 .input-group input[aria-invalid="true"] {
    border-color: #ff6b6b;
}

/* Autofill: navegadores (Chrome/Edge) pintam o input com fundo amarelo/branco quando
   há credenciais salvas. Estes overrides forçam o input escuro com texto branco
   mesmo durante o autofill. */
.login-v2 .input-group input:-webkit-autofill,
.login-v2 .input-group input:-webkit-autofill:hover,
.login-v2 .input-group input:-webkit-autofill:focus,
.login-v2 .input-group input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset !important;
    -webkit-text-fill-color: #fff !important;
    caret-color: #fff;
    border: 1px solid var(--input-border) !important;
    transition: background-color 9999s ease-out, color 9999s ease-out;
}

.login-v2 .forgot-pass {
    text-align: right;
    margin-bottom: 1.2em;
    margin-top: 0.2em;
}

.login-v2 .forgot-pass a {
    color: #fff;
    text-decoration: none;
    font-size: 0.85em;
    transition: color 0.3s;
}
.login-v2 .forgot-pass a:hover { color: var(--primary-light); }

/* Botão Entrar */
.login-v2 .btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    /* padding: 1em; */
    font-size: 1.2em;
    font-family: var(--font-heading);
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
}

.login-v2 .btn-primary:hover {
    background: #50a896;
    transform: translateY(-2px);
}

/* Divisor */
.login-v2 .divider {
    display: flex;
    align-items: center;
    margin: 1.5em 0;
}
.login-v2 .divider::before,
.login-v2 .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.login-v2 .divider span {
    padding: 0 1em;
    font-size: 0.8em;
    color: var(--text-muted);
}

/* Botões sociais */
.login-v2 .social-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.8em;
}

.login-v2 .btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1em;
    width: 100%;
    padding: 0.9em;
    border-radius: 10px;
    font-size: 1em;
    font-family: var(--font-body);
    cursor: pointer;
    background: transparent;
    transition: all 0.3s;
    text-decoration: none;
    color: #fff;
}

.login-v2 .btn-google {
    background: var(--btn-dark);
    border: 1px solid #fff;
    color: #fff;
}
.login-v2 .btn-google:hover {
    background: #525a58;
    transform: translateY(-1px);
}

.login-v2 .btn-eurofarma {
    border: 1px solid var(--primary-light);
    color: #fff;
    justify-content: center;
    padding-left: 1.5em;
    padding-right: 1.5em;
}
.login-v2 .btn-eurofarma:hover {
    background: rgba(154, 222, 204, 0.05);
    transform: translateY(-1px);
}

.login-v2 .btn-eurofarma .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.login-v2 .btn-eurofarma .text-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    flex: 1;
}

.login-v2 .btn-eurofarma .text-group .title {
    color: var(--primary-light);
    font-size: 0.95em;
    font-weight: 600;
    line-height: 1.2;
}

.login-v2 .btn-eurofarma .text-group .sub {
    font-size: 0.75em;
    color: #fff;
}

/* Cadastro */
.login-v2 .register {
    text-align: center;
    margin-top: 1.5em;
    font-size: 0.95em;
}
.login-v2 .register a {
    color: var(--primary-light);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.3s;
}
.login-v2 .register a:hover { color: #fff; text-decoration: underline; }

/* Seletor de idioma — fica no flex do .header-top à direita do h2, mesma linha. */
.login-v2 #kc-locale {
    position: relative;
    flex-shrink: 1;
    min-width: 0;
}
.login-v2 #kc-current-locale-link {
    background: transparent;
    border: 1px solid #fff;
    border-radius: 6px;
    color: #fff;
    padding: 0.25em 0.6em;
    font-size: 0.7em;
    font-family: var(--font-body);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s;
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 0.02em;
}
.login-v2 #kc-current-locale-link:hover { background: rgba(255, 255, 255, 0.1); }

.login-v2 #language-switch1 {
    position: absolute;
    right: 0;
    top: calc(100% + 0.3em);
    list-style: none;
    margin: 0;
    padding: 0.4em 0;
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    min-width: 140px;
    z-index: 10;
    display: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.login-v2 #kc-locale[aria-expanded="true"] #language-switch1,
.login-v2 #kc-locale-dropdown.expanded #language-switch1,
.login-v2 #kc-current-locale-link[aria-expanded="true"] + #language-switch1 {
    display: block;
}
.login-v2 #language-switch1 li { list-style: none; }
.login-v2 #language-switch1 a {
    display: block;
    padding: 0.5em 1em;
    color: #fff;
    text-decoration: none;
    font-size: 0.9em;
    transition: background 0.2s;
}
.login-v2 #language-switch1 a:hover { background: rgba(255, 255, 255, 0.08); }

/* RESPONSIVIDADE */
@media (max-width: 1024px) {
    .login-v2 .login-wrapper { padding: 2em; }
}

@media (max-width: 850px) {
    .login-v2 {
        position: relative;
        overflow-y: auto;
        height: auto;
        min-height: 100vh;
    }
    .login-v2 .login-wrapper {
        flex-direction: column;
        align-items: center;
        height: auto;
        min-height: 100vh;
    }
    .login-v2 .login-left {
        width: 100%;
        max-width: 500px;
        flex: none;
        margin-bottom: 1em;
        align-items: center;
        text-align: center;
    }
    .login-v2 .logo-top {
        margin: 0 auto 1.5em auto;
    }
    .login-v2 .left-bottom {
        display: none;
    }
    .login-v2 .left-bottom h1 {
        margin: 0 auto;
    }
    .login-v2 .login-right {
        max-height: none;
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    .login-v2 .login-wrapper { padding: 1em; }
    .login-v2 .login-right { padding: 1.5em; border-radius: 16px; }
    .login-v2 .header-top h2 { font-size: 1.5em; }
    .login-v2 .btn-eurofarma { padding-left: 0.5em; padding-right: 0.5em; }
}
