/* =============================================
   AUTH PAGES — Default (design azul original)
   Para todos os usuários
   ============================================= */

/* ---- Base ---- */
body.auth-page {
    margin: 0;
    min-height: 100vh;
    font-family: 'Roboto', "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: #F0F1F4;
    overflow-x: hidden;
    transition: background 0.3s ease;
}

.auth-page .content-wrapper {
    position: relative;
    z-index: 1;
}

/* ---- Card (azul original) ---- */
.auth-page .card {
    position: relative;
    border-radius: 20px !important;
    background: linear-gradient(180deg, rgba(16, 88, 176, 0.85), rgba(25, 105, 209, 0.80), rgba(50, 169, 224, 0.75)) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: none !important;
    box-shadow: 0 8px 32px rgba(16, 88, 176, 0.25),
                0 2px 8px rgba(0, 0, 0, 0.08) !important;
    animation: authCardEntry 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes authCardEntry {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Logo ---- */
.auth-page .logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.auth-page .logo-container img {
    max-height: 50px;
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.2));
}

/* ---- Typography ---- */
.auth-page .text-gray-900,
.auth-page .card h1,
.auth-page .card .h5 {
    color: #ffffff !important;
}

.auth-page .login-subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.auth-page .text-muted {
    color: rgba(255, 255, 255, 0.50) !important;
}

.auth-page label,
.auth-page .form-label {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.85rem;
}

/* ---- Form Controls ---- */
.auth-page .form-control {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 20px !important;
    color: #ffffff !important;
    transition: all 0.25s ease;
    font-size: 0.9rem;
}

.auth-page .form-control::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.auth-page .form-control:focus {
    background: rgba(255, 255, 255, 0.16) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12),
                0 0 15px rgba(255, 255, 255, 0.05) !important;
    outline: none;
}

.auth-page .form-control.is-invalid {
    border-color: #e74a5a !important;
}

.auth-page .invalid-feedback {
    color: #ff8a95;
}

.auth-page .errorlist {
    color: #ff8a95;
    list-style: none;
    padding: 0;
    font-size: 0.85rem;
}

/* ---- Buttons ---- */
.auth-page .btn-primary {
    border-radius: 20px !important;
    background: linear-gradient(135deg, #4ef291 0%, #34d399 100%) !important;
    border: none !important;
    color: #1a1a1a !important;
    font-weight: 700;
    transition: all 0.3s ease;
    padding: 0.65rem 1.2rem;
    box-shadow: 0 2px 8px rgba(78, 242, 145, 0.25);
}

.auth-page .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(78, 242, 145, 0.35) !important;
    background: linear-gradient(135deg, #5ff79d 0%, #3edba5 100%) !important;
    color: #1a1a1a !important;
}

.auth-page .btn-primary:active {
    transform: translateY(0);
}

.auth-page .btn-danger {
    border-radius: 20px !important;
    background: rgba(231, 74, 90, 0.8) !important;
    border: 1px solid rgba(231, 74, 90, 0.4) !important;
    color: #ffffff !important;
    font-weight: 700;
    transition: all 0.3s ease;
}

.auth-page .btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(231, 74, 90, 0.4) !important;
}

/* ---- Password toggle ---- */
.auth-page .form-group .btn-light {
    box-shadow: none;
    background: none !important;
    border: none !important;
}

.auth-page .btn-light i {
    color: rgba(255, 255, 255, 0.35) !important;
    transition: color 0.2s;
}

.auth-page .btn-light:hover i {
    color: rgba(255, 255, 255, 0.75) !important;
}

/* ---- Alerts ---- */
.auth-page .alert-danger {
    background: rgba(231, 74, 90, 0.15) !important;
    border: 1px solid rgba(231, 74, 90, 0.3) !important;
    border-radius: 12px;
    color: #ff8a95 !important;
}

.auth-page .alert-danger ul {
    margin-bottom: 0;
    padding-left: 1rem;
}

.auth-page .alert-success {
    background: rgba(78, 242, 145, 0.12) !important;
    border: 1px solid rgba(78, 242, 145, 0.25) !important;
    border-radius: 12px;
    color: #4EF291 !important;
}

.auth-page .alert-warning-custom {
    background: rgba(255, 193, 7, 0.12) !important;
    border: 1px solid rgba(255, 193, 7, 0.25) !important;
    border-radius: 12px;
    color: #ffd966 !important;
    font-size: 0.82rem;
    padding: 0.75rem 1rem;
}

/* ---- Links ---- */
.auth-page .small,
.auth-page a.small {
    color: rgba(255, 255, 255, 0.45) !important;
    transition: color 0.2s;
}

.auth-page a.small:hover {
    color: #ffffff !important;
    text-decoration: none;
}

/* ---- Footer ---- */
.auth-page .login-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.22);
    font-size: 0.75rem;
}

.auth-page .small-footer {
    text-align: center;
    margin-top: 0.75rem;
    color: #8a8f99;
    font-size: 0.7rem;
}

/* ---- Theme toggle ---- */
.auth-page .theme-toggle {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 0.85rem;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.25s, transform 0.25s;
    padding: 2px;
    line-height: 1;
}

.auth-page .theme-toggle:hover {
    opacity: 1;
    transform: scale(1.18);
}

/* ---- hCaptcha ---- */
.auth-page .h-captcha {
    width: 100%;
    min-height: 78px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-page .h-captcha iframe {
    border-radius: 14px !important;
    opacity: 0.85;
    filter: brightness(0.95) saturate(0.5);
    transition: opacity 0.3s, filter 0.3s;
}

.auth-page .h-captcha:hover iframe {
    opacity: 1;
    filter: brightness(1) saturate(0.7);
}

/* ---- 2FA specifics ---- */
.auth-page .step-text {
    color: rgba(255, 255, 255, 0.60);
    font-size: 0.82rem;
    line-height: 1.5;
}

.auth-page .step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 6px;
}

.auth-page .qr-container {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.auth-page .qr-container img {
    border-radius: 12px;
    background: #fff;
    padding: 8px;
}

.auth-page .icon-lock {
    font-size: 2rem;
    color: #ffffff;
    opacity: 0.7;
}

.auth-page .icon-check {
    font-size: 2.5rem;
    color: #4EF291;
}

.auth-page .backup-link {
    color: rgba(255, 255, 255, 0.40);
    font-size: 0.8rem;
    cursor: pointer;
    transition: color 0.2s;
    border: none;
    background: none;
    text-decoration: underline;
}

.auth-page .backup-link:hover {
    color: rgba(255, 255, 255, 0.75);
}

.auth-page .backup-hint {
    display: none;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.78rem;
    margin-top: 0.25rem;
}

.auth-page .backup-codes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 1rem 0;
}

.auth-page .backup-code {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 10px;
    padding: 8px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 1px;
}

/* ---- 2FA prompt modal ---- */
.auth-page .modal-2fa-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: authFadeIn 0.3s ease;
}

.auth-page .modal-2fa-card {
    max-width: 400px;
    width: 90%;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(16, 88, 176, 0.90), rgba(25, 105, 209, 0.85));
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: none;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    animation: authCardEntry 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
    text-align: center;
    padding: 2rem 1.5rem;
}

@keyframes authFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---- Mobile ---- */
@media (max-width: 575.98px) {
    .auth-page .content-wrapper,
    .auth-page .container,
    .auth-page .row,
    .auth-page .row > [class*="col"] {
        max-width: 100vw !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    .auth-page .card {
        max-width: 100% !important;
        overflow: hidden;
    }
    .auth-page .card-body {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    .auth-page .h-captcha {
        transform: scale(0.85);
        transform-origin: center;
    }
}

/* ==============================================
   DARK THEME (default — azul escuro)
   ============================================== */
html[data-theme="dark"] body.auth-page {
    background: #1a1a2e;
}

html[data-theme="dark"] .auth-page .card {
    background: linear-gradient(180deg, rgba(10, 50, 120, 0.90), rgba(16, 70, 150, 0.85), rgba(25, 100, 190, 0.80)) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.50),
                0 2px 8px rgba(0, 0, 0, 0.20) !important;
}

html[data-theme="dark"] body.auth-page .modal-2fa-card {
    background: linear-gradient(180deg, rgba(10, 50, 120, 0.95), rgba(16, 70, 150, 0.90));
}


/* =============================================
   REBRANDING — Tegge Design System (staff only)
   Ativado por html.rebranding via localStorage
   Para ativar: descomentar ou manter como está
   ============================================= */

/* ---- Base tegge ---- */
html.rebranding body.auth-page {
    font-family: 'Varela Round', 'Roboto', "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: linear-gradient(160deg, #e8e8e8 0%, #f4f3f3 40%, #eef0ec 100%);
}

/* ---- Card tegge (carvão) ---- */
html.rebranding .auth-page .card {
    border-radius: 18px !important;
    background: linear-gradient(170deg,
        #2a2a2a 0%,
        #2d2d2d 40%,
        #323232 100%) !important;
    border: 1px solid rgba(78, 242, 145, 0.08) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25),
                0 4px 12px rgba(0, 0, 0, 0.08),
                0 0 0 1px rgba(78, 242, 145, 0.04) !important;
}

html.rebranding .auth-page .text-gray-900,
html.rebranding .auth-page .card h1,
html.rebranding .auth-page .card .h5 {
    font-family: 'Varela Round', sans-serif !important;
}

/* ---- Form Controls tegge ---- */
html.rebranding .auth-page .form-control {
    background: rgba(255, 255, 255, 0.07) !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    border-radius: 12px !important;
    font-family: 'Varela Round', sans-serif !important;
    padding: 0.6rem 0.9rem;
}

html.rebranding .auth-page .form-control::placeholder {
    color: rgba(255, 255, 255, 0.30);
}

html.rebranding .auth-page .form-control:focus {
    background: rgba(255, 255, 255, 0.10) !important;
    border-color: rgba(78, 242, 145, 0.50) !important;
    box-shadow: 0 0 0 3px rgba(78, 242, 145, 0.10),
                0 0 20px rgba(78, 242, 145, 0.06) !important;
}

/* ---- Button tegge (verde) ---- */
html.rebranding .auth-page .btn-primary {
    border-radius: 12px !important;
    background: linear-gradient(135deg, #4ef291 0%, #34d399 100%) !important;
    color: #1a1a1a !important;
    font-family: 'Varela Round', sans-serif !important;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(78, 242, 145, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

html.rebranding .auth-page .btn-primary:hover {
    box-shadow: 0 8px 24px rgba(78, 242, 145, 0.35),
                0 0 0 1px rgba(78, 242, 145, 0.10),
                inset 0 1px 0 rgba(255, 255, 255, 0.30) !important;
    background: linear-gradient(135deg, #5ff79d 0%, #3edba5 100%) !important;
    color: #1a1a1a !important;
}

/* ---- Links tegge ---- */
html.rebranding .auth-page a.small:hover {
    color: #4ef291 !important;
}

/* ---- Theme toggle tegge ---- */
html.rebranding .auth-page .theme-toggle {
    color: #4ef291;
}

/* ---- Step number tegge ---- */
html.rebranding .auth-page .step-number {
    background: rgba(78, 242, 145, 0.20);
    color: #4EF291;
}

/* ---- Icon tegge ---- */
html.rebranding .auth-page .icon-lock {
    color: #4EF291;
}

/* ---- 2FA modal tegge ---- */
html.rebranding .auth-page .modal-2fa-card {
    background: linear-gradient(170deg,
        #2a2a2a 0%,
        #2d2d2d 40%,
        #323232 100%);
    border: 1px solid rgba(78, 242, 145, 0.06);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35),
                0 4px 12px rgba(0, 0, 0, 0.12);
}

/* ---- Dark tegge ---- */
html.rebranding[data-theme="dark"] body.auth-page {
    background: linear-gradient(160deg, #050805 0%, #0a0a0a 40%, #080b08 100%);
}

html.rebranding[data-theme="dark"] .auth-page .card {
    background: linear-gradient(170deg,
        #141614 0%,
        #181a18 40%,
        #1c1f1c 100%) !important;
    border: 1px solid rgba(78, 242, 145, 0.12) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.60),
                0 4px 12px rgba(0, 0, 0, 0.30),
                0 0 80px rgba(78, 242, 145, 0.04),
                inset 0 1px 0 rgba(78, 242, 145, 0.06) !important;
}

html.rebranding[data-theme="dark"] body.auth-page .form-control {
    background: rgba(0, 0, 0, 0.35) !important;
    border-color: rgba(78, 242, 145, 0.08) !important;
}

html.rebranding[data-theme="dark"] body.auth-page .form-control:focus {
    background: rgba(0, 0, 0, 0.42) !important;
    border-color: rgba(78, 242, 145, 0.45) !important;
    box-shadow: 0 0 0 3px rgba(78, 242, 145, 0.10),
                0 0 25px rgba(78, 242, 145, 0.06) !important;
}

html.rebranding[data-theme="dark"] body.auth-page .btn-primary {
    box-shadow: 0 2px 12px rgba(78, 242, 145, 0.30),
                0 0 30px rgba(78, 242, 145, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.20);
}

html.rebranding[data-theme="dark"] body.auth-page .btn-primary:hover {
    box-shadow: 0 8px 30px rgba(78, 242, 145, 0.40),
                0 0 50px rgba(78, 242, 145, 0.12),
                inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}

html.rebranding[data-theme="dark"] body.auth-page .modal-2fa-card {
    background: linear-gradient(170deg,
        #141614 0%,
        #181a18 40%,
        #1c1f1c 100%);
    border: 1px solid rgba(78, 242, 145, 0.10);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.60),
                0 0 80px rgba(78, 242, 145, 0.04);
}

html.rebranding[data-theme="dark"] body.auth-page .h-captcha iframe {
    opacity: 1;
    filter: brightness(0.80) saturate(0.35);
    border-radius: 14px !important;
    border: 0 !important;
    outline: 2px solid #222 !important;
    outline-offset: -2px;
}
