/* =========================================================
   CTS LOGIN V17 - HOLOGRAPHIC 3D GLOBE (DARK THEME) 
   ========================================================= */
:root {
    --cts-dark: #03060a;
    --cts-principal: #4c77ba;
    --cts-comp-azul: #4C99BA;
    --cts-navy-blue: #1A365D;
    --font-main: 'Outfit', sans-serif;
}

/* Forçamento Absoluto contra o CSS global do Metronic base_login */
body,
html {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: var(--cts-dark) !important;
    font-family: var(--font-main) !important;
    overflow: hidden !important;
    background: radial-gradient(circle at center, #0a1118 0%, #000000 100%) !important;
}

.page-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1200px;
}

/* ================== GLOBO 3D ================== */
.hologram-globe {
    position: absolute;
    width: 680px;
    height: 680px;
    transform-style: preserve-3d;
    animation: spinGlobe 80s linear infinite;
}

@keyframes spinGlobe {
    0% {
        transform: rotateX(-15deg) rotateY(0deg);
    }

    100% {
        transform: rotateX(-15deg) rotateY(360deg);
    }
}

.meridian {
    position: absolute;
    top: 0;
    left: 0;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid rgba(76, 119, 186, 0.4);
    box-shadow: inset 0 0 20px rgba(76, 153, 186, 0.15), 0 0 15px rgba(76, 153, 186, 0.2);
    transform-style: preserve-3d;
}

.m-pure {
    border-color: rgba(76, 119, 186, 0.7);
}

.m-light {
    border-color: rgba(76, 153, 186, 0.6);
}

.m-deep {
    border-color: rgba(26, 54, 93, 0.8);
    box-shadow: inset 0 0 20px rgba(26, 54, 93, 0.4), 0 0 15px rgba(26, 54, 93, 0.5);
}

.meridian:nth-child(1) {
    transform: rotateY(0deg);
}

.meridian:nth-child(2) {
    transform: rotateY(30deg);
}

.meridian:nth-child(3) {
    transform: rotateY(60deg);
}

.meridian:nth-child(4) {
    transform: rotateY(90deg);
}

.meridian:nth-child(5) {
    transform: rotateY(120deg);
}

.meridian:nth-child(6) {
    transform: rotateY(150deg);
}

.thick-equator {
    position: absolute;
    top: 0;
    left: 0;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 6px solid rgba(76, 153, 186, 0.4); /* Fundo sutil para evidenciar a explosao de luz */
    transform: rotateX(90deg);
    box-shadow: inset 0 0 50px rgba(76, 153, 186, 0.6), 0 0 40px rgba(76, 153, 186, 0.7), 0 0 15px rgba(0, 210, 255, 0.8);
    transform-style: preserve-3d;
}

.thick-equator::after {
    content: "";
    position: absolute;
    box-sizing: border-box;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    background: conic-gradient(from 0deg,
            transparent 0deg,
            transparent 120deg,
            rgba(76, 153, 186, 0.1) 220deg,
            var(--cts-comp-azul) 300deg,
            #00d2ff 340deg,
            #ffffff 360deg);
    -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 6px), black calc(100% - 5px));
    mask: radial-gradient(closest-side, transparent calc(100% - 6px), black calc(100% - 5px));
    filter: drop-shadow(0 0 25px #00d2ff) drop-shadow(0 0 10px #ffffff);
    animation: lightBeamOrbit 40s linear infinite;
}

@keyframes lightBeamOrbit {
    0% {
        transform: rotateZ(0deg);
    }

    100% {
        transform: rotateZ(-360deg);
    }
}

/* ================== FORMULÁRIO RESPONSIVO ================== */
.login-card {
    position: absolute;
    z-index: 10;
    width: 90%;
    max-width: 440px;
    box-sizing: border-box;
    padding: 45px 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8), 0 0 40px rgba(76, 153, 186, 0.15);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.login-logo {
    width: 100%;
    max-width: 200px;
    height: auto;
    object-fit: contain;
    opacity: 1;
}

.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
}

/* Sobrescrevendo margens do Metronic FormValidation */
.fv-row {
    margin-bottom: 0 !important;
}

.input-wrapper {
    width: 100%;
    position: relative;
}

.input-pill {
    width: 100%;
    box-sizing: border-box;
    padding: 15px 22px;
    border-radius: 30px;
    border: 1px solid rgba(76, 119, 186, 0.25);
    background: rgba(244, 247, 251, 1);
    font-family: var(--font-main);
    font-size: 0.95rem;
    color: #2a3b5c;
    font-weight: 500;
    outline: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 1;
}

.input-pill::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.input-pill:focus {
    border-color: var(--cts-comp-azul);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(76, 153, 186, 0.15);
}

.btn-submit-pill {
    width: 100%;
    margin-top: 10px;
    padding: 12px 0;
    border: none;
    border-radius: 30px;
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    cursor: pointer;
    position: relative;
    opacity: 1;
    background: linear-gradient(135deg, var(--cts-principal) 0%, #2f5698 100%);
    box-shadow: 0 10px 20px rgba(76, 119, 186, 0.3);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-submit-pill:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, var(--cts-comp-azul) 0%, var(--cts-principal) 100%);
    box-shadow: 0 15px 30px rgba(76, 153, 186, 0.5);
}

.btn-submit-pill:active {
    transform: translateY(1px);
    box-shadow: 0 5px 10px rgba(76, 119, 186, 0.3);
}

/* Indicadores do Metronic via Axios Data Attributes */
.btn-submit-pill .indicator-progress {
    display: none;
}

.btn-submit-pill[data-kt-indicator="on"] .indicator-label {
    display: none;
}

.btn-submit-pill[data-kt-indicator="on"] .indicator-progress {
    display: block;
}

.spinner-border-sm {
    border-width: 0.2em;
    width: 1.25rem;
    height: 1.25rem;
    border-style: solid;
    border-color: transparent transparent #fff #fff;
    border-radius: 50%;
    animation: spinner-border .75s linear infinite;
}

@keyframes spinner-border {
    100% {
        transform: rotate(360deg);
    }
}

.form-footer {
    margin-top: 25px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    opacity: 1;
}

.form-footer a {
    color: var(--cts-principal);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

.form-footer a:hover {
    color: var(--cts-comp-azul);
    transform: translateY(-1px);
}

.login-step {
    animation: stepFadeIn 0.22s ease-out;
}

@keyframes stepFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mfa-copy {
    width: 100%;
    text-align: center;
    color: #2a3b5c;
}

.mfa-kicker {
    display: inline-flex;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(76, 153, 186, 0.11);
    color: var(--cts-principal);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mfa-copy h2 {
    margin: 12px 0 6px;
    color: var(--cts-navy-blue);
    font-size: 1.35rem;
    font-weight: 700;
}

.mfa-copy p {
    margin: 0;
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.45;
}

.mfa-expiration {
    margin-top: 8px;
    color: var(--cts-principal);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.3;
}

.mfa-expiration.is-expired {
    color: #d14343;
}

.mfa-code-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin-top: 4px;
}

.mfa-code-grid input {
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid rgba(76, 119, 186, 0.25);
    border-radius: 14px;
    background: rgba(244, 247, 251, 1);
    color: var(--cts-navy-blue);
    font-family: var(--font-main);
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: all 0.2s ease;
}

.mfa-code-grid input:focus {
    border-color: var(--cts-comp-azul);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(76, 153, 186, 0.15);
}

.mfa-footer {
    margin-top: 18px;
}

/* ================== VALIDAÇÃO DO FORMULÁRIO (METRONIC / FORMVALIDATION) ================== */
/* Container da mensagem de erro gerada pelo Metronic */
.invalid-feedback {
    color: #f1416c !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    margin-top: 6px !important;
    padding-left: 18px !important;
}

/* Feedback visual direto na Input Box */
.input-pill.is-invalid {
    border-color: rgba(241, 65, 108, 0.6) !important;
    transition: border-color 0.3s ease;
}

.input-pill.is-valid {
    border-color: rgba(80, 205, 137, 0.6) !important;
}

/* ================== MEDIA QUERIES ================== */
@media screen and (max-width: 768px) {
    .hologram-globe {
        transform: scale(0.85);
    }
}

@media screen and (max-width: 480px) {
    .hologram-globe {
        transform: scale(0.65);
    }

    .login-card {
        padding: 35px 25px;
        border-radius: 20px;
    }

    .login-logo {
        max-width: 160px;
    }

    .form-footer {
        flex-direction: column;
        gap: 15px;
        align-items: center;
        margin-top: 20px;
    }
}

@media screen and (max-width: 360px) {
    .hologram-globe {
        transform: scale(0.5);
    }

    .login-card {
        padding: 30px 20px;
    }

    .input-pill {
        padding: 12px 18px;
        font-size: 0.9rem;
    }

    .mfa-code-grid {
        gap: 6px;
    }

    .mfa-code-grid input {
        border-radius: 12px;
        font-size: 1.08rem;
    }
}

/* ================== SWAL CUSTOM PREMIUM V17 ================== */
.cts-swal-dark {
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1px solid rgba(76, 119, 186, 0.15) !important;
    border-radius: 20px !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), 0 0 20px rgba(76, 153, 186, 0.05) !important;
    width: 340px !important;
    padding: 1.5rem 1.5rem 1.2rem !important;
}

/* Título */
.cts-swal-dark .swal2-title {
    color: var(--cts-navy-blue) !important;
    font-family: var(--font-main) !important;
    font-size: 1.15rem !important;
    font-weight: 600 !important;
    padding: 0 !important;
    margin-bottom: 0.5rem !important;
}

/* Texto descritivo */
.cts-swal-dark .swal2-html-container {
    color: #64748b !important;
    font-family: var(--font-main) !important;
    font-size: 0.9rem !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ================= ÍCONES PREMIUM ================= */
.cts-swal-dark .swal2-icon {
    transform: scale(0.8);
    margin: 0.5rem auto 0.5rem !important;
    border: none !important;
}

/* Ícone de Erro */
.cts-swal-dark .swal2-icon.swal2-error {
    background-color: #fff5f8 !important;
}
.cts-swal-dark .swal2-icon.swal2-error [class^=swal2-x-mark-line] {
    background-color: #f1416c !important;
}

/* Ícone de Sucesso */
.cts-swal-dark .swal2-icon.swal2-success {
    background-color: #e8fff3 !important;
}
.cts-swal-dark .swal2-icon.swal2-success [class^=swal2-success-line] {
    background-color: #50cd89 !important;
}
.cts-swal-dark .swal2-icon.swal2-success .swal2-success-ring {
    border: none !important;
}

/* Botão Confirmar / Retornar */
.cts-swal-dark .swal2-actions {
    margin-top: 1.2rem !important;
}
.cts-swal-dark .btn-submit-pill {
    width: auto !important;
    min-width: 120px !important;
    margin: 0 !important;
    padding: 10px 24px !important;
    border-radius: 20px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 4px 10px rgba(76, 119, 186, 0.2) !important;
}
