/* =========================================================================
   auth.css  —  Novo layout do fluxo de login/senha (marca Cartão de Todos)
   Opção 3: faixa verde curva no topo, card centralizado, medalhão do logo.
   Tudo escopado sob body.auth-page para sobrepor os temas (ctn.css/cvf.css)
   apenas nas telas de _LoginLayout, sem afetar a área logada.
   ========================================================================= */

:root {
    --auth-off: #EEF4F1;          /* fundo da página */
    --auth-pine: #0E3B2C;         /* verde escuro (faixa/menu) */
    --auth-pine-2: #0A2E22;
    --auth-neon: #3DF07E;         /* acento */
    --auth-primary: #12805C;      /* CTA */
    --auth-primary-2: #14A06E;
    --auth-primary-hover: #0F6E4E;
    --auth-text: #123B2C;
    --auth-muted: #5B7A6E;
    --auth-border: #E6ECE9;
    --auth-input-bg: #F7FAF9;
    --auth-card-radius: 24px;
}

/* ----------------------------- Base / shell ---------------------------- */
body.auth-page {
    margin: 0;
    min-height: 100vh;
    position: relative;
    background: var(--auth-off) !important;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: var(--auth-text);
    overflow-x: hidden;
}

/* Faixa verde curva no topo (decorativa) */
body.auth-page::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 300px;
    z-index: 0;
    background:
        radial-gradient(circle at 1px 1px, rgba(61, 240, 126, .14) 1px, transparent 0) 0 0 / 26px 26px,
        radial-gradient(520px 520px at -6% -60%, rgba(61, 240, 126, .18), transparent 60%),
        linear-gradient(160deg, var(--auth-pine), var(--auth-pine-2));
    border-radius: 0 0 50% 50% / 0 0 90px 90px;
}

/* Marca (wordmark) sobre a faixa */
.auth-page .auth-brand {
    position: absolute;
    top: 42px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 2;
    color: #fff;
}

.auth-page .auth-brand-sub {
    display: block;
    font-size: 12px;
    letter-spacing: 3px;
    color: #9FD9BE;
    font-weight: 600;
}

.auth-page .auth-brand-name {
    display: block;
    font-size: 22px;
    letter-spacing: 2px;
    font-weight: 700;
    margin-top: 2px;
}

/* Neutraliza o posicionamento absoluto herdado do tema */
body.auth-page .container-login {
    position: static;
    transform: none;
    top: auto;
    left: auto;
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
    justify-content: center;
}

.auth-page .auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 150px 24px 48px;
    box-sizing: border-box;
}

/* ------------------------------- Card ---------------------------------- */
.auth-page .content-login {
    width: 452px !important;
    max-width: calc(100vw - 48px) !important;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-card-radius);
    box-shadow: 0 26px 60px rgba(14, 59, 44, 0.16);
    padding: 0 44px 40px;
    text-align: left;
    position: relative;
    z-index: 1;
}

.auth-page .form {
    width: 100% !important;
    margin: 0;
}

/* --------------------------- Cabeçalho / logo -------------------------- */
.auth-page .form-header {
    margin-bottom: 24px;
    text-align: center;
}

/* Medalhão circular com o símbolo do logo, sobreposto ao topo do card */
.auth-page .logo {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    margin: -54px auto 0;
    background: #fff url('../img/ct-symbol.png') center / 64px auto no-repeat;
    border: 4px solid #fff;
    box-shadow: 0 12px 26px rgba(14, 59, 44, 0.28);
}

.auth-page .form-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    line-height: 1.25;
    font-weight: 700;
    color: var(--auth-text);
    text-align: center;
    margin: 20px 0 0 0;
    white-space: normal;
}

.auth-page .auth-subtitle,
.auth-page .form-parag {
    color: var(--auth-muted);
    font-size: 0.9rem;
    text-align: center;
    margin: 6px 0 0 0;
}

/* ------------------------------- Campos -------------------------------- */
.auth-page .auth-field {
    margin-bottom: 16px;
}

.auth-page .custom-form-group {
    position: relative;
    height: auto;
    margin-bottom: 16px;
}

/* Remove a borda extra que o tema base desenha em volta do campo
   (a borda/anel de foco agora vive no próprio input) */
.auth-page .custom-form-group .floating-label::after {
    display: none;
}

.auth-page .auth-field > label,
.auth-page .auth-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--auth-text);
    margin-bottom: 6px;
}

.auth-page .auth-input,
.auth-page .custom-form-group input,
.auth-page .custom-form-group select {
    width: 100%;
    height: 50px;
    box-sizing: border-box;
    padding: 0 14px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    background: var(--auth-input-bg);
    color: var(--auth-text);
    font-size: 0.95rem;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-page .auth-input::placeholder {
    color: #9AA4B2;
    opacity: 1;
}

.auth-page .auth-input:focus,
.auth-page .custom-form-group input:focus,
.auth-page .custom-form-group select:focus {
    border-color: var(--auth-primary-2);
    box-shadow: 0 0 0 3px rgba(20, 160, 110, 0.14);
}

/* Telas irmãs (Recuperar/Nova senha) usam ícone à esquerda (.with-icon) */
.auth-page .with-icon input,
.auth-page .with-icon select {
    padding-left: 44px;
}

.auth-page .with-icon .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    height: 20px;
    color: var(--auth-muted);
}

.auth-page .with-icon .icon svg { width: 20px; height: 20px; }

/* Campo de senha com botão de olho */
.auth-page .auth-input-wrap { position: relative; }
.auth-page .auth-input-wrap .auth-input { padding-right: 44px; }

.auth-page .pwd-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--auth-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-page .pwd-toggle svg { width: 20px; height: 20px; }
.auth-page .pwd-toggle:hover { color: var(--auth-primary); }

/* -------------------- Método de recuperação (radios) ------------------- */
.auth-page .form-group .form-radio {
    display: inline-flex;
    margin-right: 20px;
    margin-bottom: 14px;
}

.auth-page .form-radio .form-check-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--auth-text);
    cursor: pointer;
    margin: 0;
}

.auth-page .form-radio input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--auth-primary);
    margin: 0;
    cursor: pointer;
}

/* --------------------- Lembrar / Esqueceu a senha --------------------- */
.auth-page .auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 6px 0 22px 0;
    flex-wrap: wrap;
}

.auth-page .auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 0.85rem;
    color: var(--auth-muted);
    cursor: pointer;
    font-weight: 400;
}

.auth-page .auth-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--auth-primary);
    margin: 0;
    cursor: pointer;
}

.auth-page .auth-forgot {
    font-size: 0.85rem;
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-page .auth-forgot:hover { text-decoration: underline; }

/* Link "voltar ao login" das telas irmãs */
.auth-page .text-small.text-gray {
    display: inline-block;
    margin: 4px 0 4px 0;
    color: var(--auth-muted) !important;
    font-size: 0.85rem;
    text-decoration: none;
}
.auth-page .text-small.text-gray:hover { color: var(--auth-primary) !important; text-decoration: underline; }

/* --------------------------- reCAPTCHA v2 ------------------------------ */
.auth-page .button-recaptcha {
    display: flex;
    justify-content: center;
    margin: 18px 0 6px 0;
}
.auth-page .button-recaptcha .button-recaptcha { margin: 0; }

/* ------------------------------- Botão --------------------------------- */
.auth-page .form-button { margin-top: 10px; }

.auth-page .form-button button,
.auth-page .form-button input,
.auth-page .btn-primary {
    width: 100%;
    background: linear-gradient(180deg, var(--auth-primary-2), var(--auth-primary));
    border: none;
    border-radius: 12px;
    padding: 14px 16px;
    color: #FFFFFF;
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(18, 128, 92, 0.26);
    transition: filter .15s ease;
}

.auth-page .form-button button:hover,
.auth-page .form-button input:hover,
.auth-page .btn-primary:hover {
    filter: brightness(1.05);
    color: #fff;
}

/* --------------------------- Login externo ----------------------------- */
.auth-page .external-login { margin-top: 22px; }

.auth-page .external-login-separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--auth-muted);
    margin: 18px 0;
}

.auth-page .external-login-separator::before,
.auth-page .external-login-separator::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--auth-border);
}

.auth-page .external-login-separator span {
    padding: 0 12px;
    font-size: 0.8rem;
}

.auth-page .external-login-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.auth-page .btn-external-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 13px 12px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    background: #fff;
    color: var(--auth-text);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    text-align: center;
    transition: border-color .15s ease, background .15s ease;
}

.auth-page .btn-external-login:hover {
    background: #F7FBF9;
    border-color: #CDE7DF;
    color: var(--auth-text);
    text-decoration: none;
}

.auth-page .external-login-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* ------------------------- Validação / mensagens ----------------------- */
.auth-page .text-danger { font-size: 0.8rem; }
.auth-page .validation-summary ul { list-style: none; padding: 0; margin: 8px 0 0 0; }

/* ============================= Responsivo ============================== */
@media (max-width: 560px) {
    body.auth-page::before { height: 240px; }
    .auth-page .auth-shell { padding: 150px 18px 40px; }
    .auth-page .form-title { font-size: 1.35rem; }
}

@media (max-width: 480px) {
    .auth-page .content-login {
        padding: 0 22px 28px;
    }
    .auth-page .logo { width: 92px; height: 92px; margin-top: -46px; background-size: 54px auto; }
}

/* ==================================================================== */
/*  Modal "Segurança da sua conta"                                       */
/* ==================================================================== */
#myModalSecurity .modal-dialog { max-width: 420px; }

#myModalSecurity .modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(16, 40, 34, 0.18);
    overflow: hidden;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

#myModalSecurity .modal-security-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-bottom: 1px solid #EEF2F0;
}

#myModalSecurity .modal-security-icon {
    color: var(--auth-primary);
    display: flex;
    align-items: center;
}

#myModalSecurity .modal-security-icon svg { width: 20px; height: 20px; }

#myModalSecurity .modal-title {
    font-size: 1.05rem !important;
    font-weight: 700;
    color: var(--auth-text);
    margin: 0;
    flex: 1;
    text-align: left;
}

#myModalSecurity .modal-security-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    color: #9AA4B2;
    cursor: pointer;
    opacity: 1;
    padding: 0;
}

#myModalSecurity .modal-security-close:hover { color: var(--auth-text); }

#myModalSecurity .modal-security-body {
    padding: 18px 20px;
    text-align: left !important;
    color: #4B5563;
}

#myModalSecurity .modal-security-body p {
    font-size: 0.9rem !important;
    line-height: 1.55 !important;
    margin: 0 0 12px 0;
}

#myModalSecurity .modal-security-body .hl {
    color: var(--auth-primary);
    font-weight: 600;
}

#myModalSecurity .security-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #F5F7F6;
    border: 1px solid #EAEEEC;
    border-radius: 10px;
    padding: 10px 12px;
    margin: 4px 0 14px 0;
    font-size: 0.85rem;
    color: #4B5563;
}

#myModalSecurity .security-search-box svg {
    width: 16px;
    height: 16px;
    color: #9AA4B2;
    flex-shrink: 0;
}

#myModalSecurity .security-search-box a {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
    word-break: break-all;
}

#myModalSecurity .security-search-box a:hover { text-decoration: underline; }

#myModalSecurity .modal-security-tip {
    font-size: 0.8rem !important;
    color: #9AA4B2;
    margin: 0 !important;
}

#myModalSecurity .modal-footer {
    border-top: none;
    padding: 0 20px 18px 20px;
    justify-content: flex-end;
}

#myModalSecurity .modal-footer .btn-primary {
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 10px;
    background: var(--auth-primary);
    border: 1px solid var(--auth-primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: none;
}

#myModalSecurity .modal-footer .btn-primary:hover {
    background: var(--auth-primary-hover);
    border-color: var(--auth-primary-hover);
}
