/**
 * Light/dark theme for public auth pages (/login, /cadastro).
 * Driven by html[data-theme="light"|"dark"] (set by inline boot + auth-theme.js).
 */
html[data-theme="light"] {
    --cad-body-bg: #f8f9fa;
}
html[data-theme="dark"] {
    --cad-body-bg: #0b1220;
}

/* —— Theme toggle (fixed) —— */
.auth-theme-toggle {
    position: fixed;
    top: max(0.75rem, env(safe-area-inset-top));
    right: max(0.75rem, env(safe-area-inset-right));
    z-index: 10050;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.auth-theme-toggle:hover,
.auth-theme-toggle:focus-visible {
    background: #fff;
    border-color: rgba(15, 23, 42, 0.22);
    outline: none;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
}

html[data-theme="dark"] .auth-theme-toggle {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(30, 41, 59, 0.92);
    color: #e2e8f0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .auth-theme-toggle:hover,
html[data-theme="dark"] .auth-theme-toggle:focus-visible {
    background: rgba(51, 65, 85, 0.95);
    border-color: rgba(255, 255, 255, 0.22);
}

.auth-theme-toggle .fa {
    font-size: 1.1rem;
    line-height: 1;
}

/* Cadastro header logos */
.cadastro-shell .auth-logo--for-light {
    display: inline-block;
}
.cadastro-shell .auth-logo--for-dark {
    display: none;
}
html[data-theme="dark"] .cadastro-shell .auth-logo--for-light {
    display: none;
}
html[data-theme="dark"] .cadastro-shell .auth-logo--for-dark {
    display: inline-block;
}

/*
 * Login / 2FA / invite: one logo asset + server-driven strip contrast
 * (.login-brand-logo-slot--for-light-logo = dark charcoal behind light marks).
 */
.login-brand-logo-slot {
    text-align: center;
}
.login-brand-logo-slot--for-light-logo {
    background: rgba(17, 24, 39, 0.96) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22) !important;
}
.login-brand-logo-slot--for-dark-logo {
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08) !important;
}

.two-fa-auth-logos .auth-brand-logo-single {
    display: inline-block;
}

/* —— Login page —— */
html[data-theme="light"] body.login,
html[data-theme="light"] body.login .user-login-5 {
    background: var(--auth-login-page-bg, #e8edf4) !important;
    color-scheme: light;
}

html[data-theme="dark"] body.login,
html[data-theme="dark"] body.login .user-login-5 {
    background: var(--auth-login-page-bg, var(--auth-brand-secondary, #2d2d2d)) !important;
    color-scheme: dark;
}

html[data-theme="light"] .auth-login-footer-meta {
    color: #64748b !important;
}

html[data-theme="light"] .login-copyright,
html[data-theme="light"] .page-footer-inner,
html[data-theme="light"] .page-footer-inner a {
    color: #475569 !important;
}

html[data-theme="light"] .company-subtitle {
    color: #64748b !important;
}

html[data-theme="light"] .divider span {
    background: var(--auth-login-page-bg, #e8edf4) !important;
    color: #64748b !important;
}

html[data-theme="light"] .login-email-trigger {
    color: #1e3a5f !important;
    border-color: rgba(30, 58, 95, 0.35) !important;
}

html[data-theme="light"] .login-bg-effects .login-bg-grid {
    opacity: 0.35;
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.04) 1px, transparent 1px);
}

html[data-theme="light"] .login-bg-effects .login-bg-dots {
    opacity: 0.4;
}

html[data-theme="light"] .checkbox-modern label {
    color: #334155 !important;
}

html[data-theme="light"] .back-to-login a,
html[data-theme="light"] .forgot-password-link {
    color: #334155 !important;
}

/* —— Cadastro: body + main surfaces (dark) —— */
html[data-theme="dark"] body.cadastro-shell {
    background: #0b1220 !important;
    color-scheme: dark;
}

html[data-theme="dark"] .cadastro-shell .page-header {
    background: #111827 !important;
    border-bottom-color: #1f2937 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .cadastro-shell .page-header .help-link {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .cadastro-shell .page-header .help-link:hover {
    color: #38bdf8 !important;
}

html[data-theme="dark"] .cadastro-shell .pricing-section {
    background: transparent !important;
}

html[data-theme="dark"] .cadastro-shell .pricing-wrap {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .cadastro-shell .company-info {
    background: #0f172a !important;
}

html[data-theme="dark"] .cadastro-shell .form-header h3 {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .cadastro-shell .form-header .subtitle {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .cadastro-shell .trial-notice {
    background: rgba(16, 185, 129, 0.12) !important;
    border-color: #059669 !important;
}

html[data-theme="dark"] .cadastro-shell .trial-notice span {
    color: #6ee7b7 !important;
}

html[data-theme="dark"] .cadastro-shell .form-label-custom,
html[data-theme="dark"] .cadastro-shell .form-group label {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .cadastro-shell .form-control {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .cadastro-shell .form-control::placeholder {
    color: #64748b !important;
}

html[data-theme="dark"] .cadastro-shell .form-control:focus {
    background: #0f172a !important;
    border-color: #0ea5e9 !important;
}

html[data-theme="dark"] .cadastro-shell .divider-text {
    background: #0f172a !important;
    color: #94a3b8 !important;
}

html[data-theme="dark"] .cadastro-shell .btn-email-signup {
    background: #1e293b !important;
    color: #38bdf8 !important;
    border-color: #0ea5e9 !important;
}

html[data-theme="dark"] .cadastro-shell .btn-email-signup[aria-expanded="true"] {
    background: transparent !important;
    color: #94a3b8 !important;
    border-color: #475569 !important;
}

/*
 * Google / GSI material button: keep a light surface in dark mode so label
 * (#1e293b from cadastro inline) stays readable; matches common "Sign in with Google" UX.
 */
html[data-theme="dark"] .cadastro-shell .google-container .gsi-material-button {
    background: #ffffff !important;
    background-image: none !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .cadastro-shell .google-container .gsi-material-button:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
}

html[data-theme="dark"] .cadastro-shell .google-container .gsi-material-button .gsi-material-button-contents {
    color: #0f172a !important;
}

html[data-theme="dark"] .cadastro-shell .google-container .gsi-material-button:disabled {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #64748b !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .cadastro-shell .google-container .gsi-material-button:disabled .gsi-material-button-contents {
    color: #64748b !important;
}

html[data-theme="dark"] .cadastro-shell .security-badge {
    border-top-color: #334155 !important;
    color: #94a3b8 !important;
}

html[data-theme="dark"] .cadastro-shell .passkey-complete-message {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .cadastro-shell .passkey-promote-form .form-label {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .cadastro-shell #register-form {
    border-top-color: #334155 !important;
}

html[data-theme="dark"] .cadastro-shell .passkey-complete-signup {
    border-top-color: #334155 !important;
}

html[data-theme="dark"] .cadastro-shell footer.cadastro-footer {
    background: #111827 !important;
    border-top-color: #1f2937 !important;
    color: #94a3b8 !important;
}

html[data-theme="light"] body.cadastro-shell {
    color-scheme: light;
}

/* Invite banner in dark */
html[data-theme="dark"] .cadastro-shell .alert-info {
    background: #1e3a5f !important;
    color: #e0f2fe !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

/* Security config card (cadastro) dark */
html[data-theme="dark"] .cadastro-shell .security-config-card {
    background: #1e293b !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .cadastro-shell .security-config-card-title {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .cadastro-shell .security-config-card-description {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .cadastro-shell .security-config-card-action {
    color: #64748b !important;
}

/* Scrollbar dark cadastro */
html[data-theme="dark"] .cadastro-shell ::-webkit-scrollbar-track {
    background: #1e293b;
}
html[data-theme="dark"] .cadastro-shell ::-webkit-scrollbar-thumb {
    background: #475569;
}

/* —— Cadastro: section chrome (both themes) —— */
html[data-theme="dark"] .cadastro-shell .header-section.transparent,
html[data-theme="dark"] .cadastro-shell #header.header-section {
    background-color: #111827 !important;
}

html[data-theme="dark"] .cadastro-shell .bg-grey {
    background-color: transparent !important;
}

html[data-theme="dark"] .cadastro-shell .bd-bottom {
    border-bottom-color: #1e293b !important;
}

html[data-theme="dark"] .cadastro-shell .pricing-wrap {
    box-shadow: 0 4px 28px rgba(0, 0, 0, 0.55) !important;
}

html[data-theme="dark"] .cadastro-shell .divider-wrapper::before {
    background: #334155 !important;
}

html[data-theme="dark"] .cadastro-shell .collapse .card,
html[data-theme="dark"] .cadastro-shell #register-form .card-body {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .cadastro-shell .collapse .card-body ul li {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .cadastro-shell .text-muted,
html[data-theme="dark"] .cadastro-shell small.text-muted,
html[data-theme="dark"] .cadastro-shell .form-text.text-muted {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .cadastro-shell .btn-link.text-muted {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .cadastro-shell .email-verify-trigger {
    color: #94a3b8 !important;
    border-color: #475569 !important;
    background: #1e293b !important;
}

html[data-theme="dark"] .cadastro-shell .password-validation-error {
    color: #fca5a5 !important;
}

html[data-theme="dark"] .cadastro-shell .text-danger {
    color: #fca5a5 !important;
}

/* —— Cadastro: light mode — plan column + benefits (match rest of light UI) —— */
html[data-theme="light"] .cadastro-shell .pricing-container {
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%) !important;
    color: #0f172a !important;
}

html[data-theme="light"] .cadastro-shell .pricing-container::before {
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
}

html[data-theme="light"] .cadastro-shell .plan-badge {
    background: rgba(14, 165, 233, 0.12) !important;
    color: #0369a1 !important;
    border-color: rgba(14, 165, 233, 0.35) !important;
}

html[data-theme="light"] .cadastro-shell .pricing-head h2 {
    color: #0f172a !important;
    text-shadow: none !important;
}

html[data-theme="light"] .cadastro-shell .price-section {
    background: rgba(255, 255, 255, 0.85) !important;
    border-color: rgba(15, 23, 42, 0.1) !important;
}

html[data-theme="light"] .cadastro-shell .currency,
html[data-theme="light"] .cadastro-shell .price-period {
    color: #64748b !important;
}

html[data-theme="light"] .cadastro-shell .price-value {
    color: #0f172a !important;
}

html[data-theme="light"] .cadastro-shell .price-description {
    color: #475569 !important;
}

html[data-theme="light"] .cadastro-shell .value-props {
    background: rgba(255, 255, 255, 0.65) !important;
    border-color: rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .cadastro-shell .value-item span {
    color: #334155 !important;
}

html[data-theme="light"] .cadastro-shell .pricing-list a {
    color: #0284c7 !important;
}

html[data-theme="light"] .cadastro-shell .pricing-list a:hover {
    color: #0369a1 !important;
}

html[data-theme="light"] .cadastro-shell #collapseBeneficios .card-body {
    background: rgba(255, 255, 255, 0.92) !important;
    border-color: rgba(14, 165, 233, 0.35) !important;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06) !important;
}

html[data-theme="light"] .cadastro-shell #collapseBeneficios li {
    color: #475569 !important;
}

html[data-theme="light"] .cadastro-shell #collapseBeneficios li::before {
    color: #0284c7 !important;
}

html[data-theme="light"] .cadastro-shell #collapseBeneficios li b {
    color: #0f172a !important;
}

html[data-theme="light"] body.cadastro-shell {
    scrollbar-color: #94a3b8 #f1f5f9;
}

html[data-theme="light"] .cadastro-shell #header.header-section {
    background-color: #ffffff !important;
}

/* —— Cadastro modals (password + e-mail OTP) — dark surfaces —— */
html[data-theme="dark"] body.cadastro-shell .password-modal {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.45),
        0 10px 10px -5px rgba(0, 0, 0, 0.25) !important;
}

html[data-theme="dark"] body.cadastro-shell .password-modal-header {
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] body.cadastro-shell .password-modal-close {
    background: #334155 !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] body.cadastro-shell .password-modal-close:hover {
    background: #475569 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] body.cadastro-shell .password-modal-title {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] body.cadastro-shell .password-modal-subtitle {
    color: #94a3b8 !important;
}

html[data-theme="dark"] body.cadastro-shell .password-modal-body,
html[data-theme="dark"] body.cadastro-shell .password-modal-footer {
    background: #1e293b !important;
}

html[data-theme="dark"] body.cadastro-shell .password-modal-footer {
    border-top: 1px solid #334155 !important;
}

html[data-theme="dark"] body.cadastro-shell .password-requirements-title,
html[data-theme="dark"] body.cadastro-shell .password-requirement span {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] body.cadastro-shell .password-modal-body .form-control,
html[data-theme="dark"] body.cadastro-shell #modalPasswordInputsContainer .form-control {
    background: #0f172a !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] body.cadastro-shell .email-otp-modal {
    background: #1e293b !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] body.cadastro-shell .email-otp-modal__header {
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] body.cadastro-shell .email-otp-modal__close {
    background: #334155 !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] body.cadastro-shell .email-otp-modal__title {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] body.cadastro-shell .email-otp-modal__subtitle,
html[data-theme="dark"] body.cadastro-shell .email-otp-modal__label {
    color: #94a3b8 !important;
}

html[data-theme="dark"] body.cadastro-shell .email-otp-modal__body {
    background: #1e293b !important;
}

html[data-theme="dark"] body.cadastro-shell .email-otp-modal__actions .btn-default.email-otp-modal__btn.email-otp-modal__btn--cooldown:disabled {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

/* —— Login: light mode secondary / recovery —— */
html[data-theme="light"] .btn-secondary-modern {
    background: rgba(15, 23, 42, 0.06) !important;
    border-color: rgba(15, 23, 42, 0.15) !important;
    color: #1e293b !important;
}

html[data-theme="light"] .btn-secondary-modern:hover {
    background: rgba(15, 23, 42, 0.1) !important;
    border-color: rgba(15, 23, 42, 0.25) !important;
}

html[data-theme="light"] #recuperar-senha-container h3 {
    color: #0f172a !important;
}

html[data-theme="light"] #recuperar-senha-container p {
    color: #475569 !important;
}

/* —— Login: dark mode polish —— */
html[data-theme="dark"] #recuperar-senha-container h3 {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] #recuperar-senha-container p {
    color: #cbd5e1 !important;
}
