﻿/* ==========================================================================
   ConectorOrionAdmin - login.css
   Pantalla de login con efecto visual de red global (M2M/SIM cards).
   ========================================================================== */

.login-body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(ellipse at center, #0F172A 0%, #050912 100%);
    font-family: var(--font-sans);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
    position: relative;
}

/* ==========================================================================
   Network Background - Mapa mundial + nodos + conexiones
   ========================================================================== */

.network-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 30%, rgba(14, 165, 233, 0.20), transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(99, 102, 241, 0.18), transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.10), transparent 60%);
}

.network-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.85;
}

.network-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(5, 9, 18, 0.55) 0%, transparent 30%, transparent 70%, rgba(5, 9, 18, 0.55) 100%),
        linear-gradient(90deg, rgba(5, 9, 18, 0.45) 0%, transparent 25%, transparent 75%, rgba(5, 9, 18, 0.45) 100%);
    pointer-events: none;
}

/* Continentes - glow sutil que aparece/desaparece */
.continents path {
    fill: #67E8F9;
    filter: drop-shadow(0 0 4px rgba(103, 232, 249, 0.3));
    animation: continentGlow 6s ease-in-out infinite;
}
@keyframes continentGlow {
    0%, 100% { opacity: 0.14; }
    50%      { opacity: 0.26; }
}

/* Líneas de red - flujo de datos animado */
.net-line {
    stroke-dasharray: 80 200;
    stroke-dashoffset: 0;
    animation: dataFlow 5s linear infinite;
    opacity: 0.4;
}
.net-line-2 {
    stroke-dasharray: 40 180;
    animation-duration: 7s;
    opacity: 0.25;
}
@keyframes dataFlow {
    from { stroke-dashoffset: 0;    opacity: 0.5; }
    50%  { stroke-dashoffset: -140; opacity: 0.9; }
    to   { stroke-dashoffset: -280; opacity: 0.5; }
}

/* Pulse rings - ondas que radian desde los hubs */
.pulse-ring {
    transform-origin: center;
    transform-box: fill-box;
    animation: pulseOut 3s ease-out infinite;
    opacity: 0;
}
.pulse-ring-2 {
    animation-delay: 1.5s;
}
@keyframes pulseOut {
    0%   { transform: scale(0.8); opacity: 0.9; }
    70%  { transform: scale(2.6); opacity: 0; }
    100% { transform: scale(2.6); opacity: 0; }
}

/* Hubs / nodos - brillo pulsante */
.hub {
    animation: hubPulse 2.5s ease-in-out infinite;
    transform-origin: center;
    transform-box: fill-box;
}
.hub-major {
    animation-duration: 1.8s;
}
.hub:nth-child(6n+1)  { animation-delay: 0s;   }
.hub:nth-child(6n+2)  { animation-delay: 0.4s; }
.hub:nth-child(6n+3)  { animation-delay: 0.8s; }
.hub:nth-child(6n+4)  { animation-delay: 1.2s; }
.hub:nth-child(6n+5)  { animation-delay: 1.6s; }
.hub:nth-child(6n+6)  { animation-delay: 2.0s; }
@keyframes hubPulse {
    0%, 100% { opacity: 0.7; transform: scale(1);    }
    50%      { opacity: 1;   transform: scale(1.3);  }
}

/* ==========================================================================
   Login Container & Card
   ========================================================================== */

.login-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 2;
}

.login-card {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 18px;
    padding: 22px 26px 20px;
    box-shadow:
        0 30px 80px -20px rgba(0, 0, 0, 0.55),
        0 18px 36px -18px rgba(14, 165, 233, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.4) inset;
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
}
.login-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 18px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.6), rgba(99, 102, 241, 0.4), rgba(14, 165, 233, 0.2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
    opacity: 0.5;
}

.login-brand {
    text-align: center;
    margin-bottom: 14px;
}
.brand-icon {
    width: 68px; height: 68px;
    margin: 0 auto 8px;
    border-radius: 14px;
    background: white;
    padding: 3px;
    object-fit: contain;
    box-shadow: 0 10px 22px -8px rgba(14, 165, 233, 0.55);
    position: relative;
    animation: floatIcon 4s ease-in-out infinite;
}
@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-4px); }
}
.brand-icon::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 18px;
    border: 2px solid rgba(14, 165, 233, 0.5);
    animation: pulseRing 2.4s ease-out infinite;
    pointer-events: none;
}

.login-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--gray-900);
    margin: 0;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #0E7490, #4F46E5);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.login-subtitle {
    color: var(--text-muted);
    font-size: 11.5px;
    margin: 3px 0 0;
}

.login-form {
    display: flex; flex-direction: column;
    gap: 2px;
}

.login-form .form-floating {
    position: relative;
}
.login-form .form-floating .input-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 12px;
    pointer-events: none;
    z-index: 2;
}
.login-form .form-floating .form-control {
    padding-left: 34px !important;
    height: 42px;
    border-radius: 10px;
    border: 1.5px solid var(--gray-200);
    background: var(--gray-50);
    font-size: 13px;
    color: var(--text-primary);
    transition: all var(--t-base);
}
.login-form .form-floating .form-control:focus {
    border-color: #0EA5E9;
    background: white;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
}
.login-form .form-floating label {
    padding-left: 34px;
    transform-origin: 0 50%;
}
.login-form .form-floating .form-control:focus ~ label,
.login-form .form-floating .form-control:not(:placeholder-shown) ~ label {
    transform: scale(0.78) translateY(-0.5rem) translateX(0.3rem);
}
.login-form .form-floating > .field-validation-error {
    font-size: 10.5px;
    color: var(--danger-600);
    margin-top: 3px;
    margin-left: 2px;
    display: block;
    line-height: 1.3;
}

.form-check-input {
    border-color: var(--gray-300);
    width: 1em;
    height: 1em;
}
.form-check-input:checked {
    background-color: #0EA5E9;
    border-color: #0EA5E9;
}
.form-check-label {
    font-size: 12px;
    color: var(--gray-600);
    cursor: pointer;
    user-select: none;
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
    margin-bottom: 2px;
}

.forgot-link {
    font-size: 11.5px;
    color: #0E7490;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: color var(--t-fast);
    background: none;
    border: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.forgot-link:hover {
    color: #0EA5E9;
    text-decoration: underline;
}
.forgot-link i { font-size: 11px; }

.login-alert {
    background: rgba(244, 63, 94, 0.08);
    border: 1px solid rgba(244, 63, 94, 0.25);
    color: var(--danger-600);
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 12px;
    margin-bottom: 10px;
}
.login-alert ul { margin: 4px 0 0 16px; padding: 0; }

.btn-login {
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0E7490, #0EA5E9);
    color: white;
    border: 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 18px -8px rgba(14, 165, 233, 0.55);
    transition: all var(--t-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.btn-login::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.7s;
}
.btn-login:hover::after { transform: translateX(100%); }
.btn-login:hover {
    background: linear-gradient(135deg, #0C4A6E, #0284C7);
    transform: translateY(-1px);
    box-shadow: 0 12px 26px -10px rgba(14, 165, 233, 0.7);
}
.btn-login:active { transform: translateY(0); }
.btn-login i { transition: transform var(--t-base); }
.btn-login:hover i { transform: translateX(3px); }

.login-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 11px;
    background: rgba(14, 165, 233, 0.06);
    border: 1px dashed rgba(14, 165, 233, 0.3);
    border-radius: 8px;
    font-size: 11px;
    color: var(--gray-700);
    margin-top: 12px;
}
.login-hint i { color: #0EA5E9; font-size: 12px; }
.login-hint strong {
    color: #0E7490;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    background: rgba(14, 165, 233, 0.10);
    padding: 1px 5px;
    border-radius: 3px;
    margin: 0 2px;
}

/* ==========================================================================
   Login legal links (Políticas / Términos)
   ========================================================================== */

.login-legal {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(14, 165, 233, 0.18);
    font-size: 10.5px;
    color: var(--text-muted);
    line-height: 1.4;
}
.login-legal-label {
    color: var(--text-muted);
    opacity: 0.85;
}
.login-legal-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #0E7490;
    font-weight: 600;
    text-decoration: none;
    transition: color var(--t-fast);
    background: none;
    border: 0;
    padding: 0;
}
.login-legal-link:hover {
    color: #0EA5E9;
    text-decoration: underline;
}
.login-legal-link i {
    font-size: 9px;
    opacity: 0.85;
}
.login-legal-sep {
    color: var(--text-muted);
    opacity: 0.6;
    margin: 0 1px;
}

@media (max-width: 380px) {
    .login-legal { font-size: 10px; gap: 3px; }
    .login-legal-link i { display: none; }
}

.fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ==========================================================================
   Forgot Password Modal
   ========================================================================== */

.modal-orb {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.modal-orb.show {
    opacity: 1;
    pointer-events: auto;
}
.modal-orb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 9, 18, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.modal-orb-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: #FFFFFF;
    border-radius: 18px;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.4) inset;
    overflow: hidden;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-orb.show .modal-orb-card {
    transform: scale(1) translateY(0);
}
.modal-orb-header {
    background: linear-gradient(135deg, #0E7490 0%, #0EA5E9 100%);
    color: white;
    padding: 22px 24px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    position: relative;
}
.modal-orb-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.15), transparent 50%);
    pointer-events: none;
}
.modal-orb-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.20);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}
.modal-orb-title {
    font-size: 18px;
    font-weight: 700;
    margin: 2px 0 4px;
    line-height: 1.2;
}
.modal-orb-subtitle {
    font-size: 12.5px;
    opacity: 0.90;
    margin: 0;
    line-height: 1.4;
}
.modal-orb-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,255,255,0.15);
    border: 0;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: background var(--t-fast);
}
.modal-orb-close:hover { background: rgba(255,255,255,0.30); }
.modal-orb-body {
    padding: 22px 24px;
    color: var(--text-primary);
    font-size: 13.5px;
    line-height: 1.55;
}
.modal-orb-body p { margin: 0 0 12px; }
.modal-orb-body p:last-child { margin-bottom: 0; }
.modal-orb-body strong { color: #0E7490; font-weight: 700; }
.modal-orb-body .callout {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(99, 102, 241, 0.06));
    border: 1px solid rgba(14, 165, 233, 0.20);
    border-left: 3px solid #0EA5E9;
    border-radius: 8px;
    padding: 11px 13px;
    margin: 12px 0;
    font-size: 12.5px;
    color: var(--gray-700);
}
.modal-orb-body .callout strong { color: #0E7490; }
.modal-orb-body .icon-list {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}
.modal-orb-body .icon-list li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 6px 0;
    font-size: 12.5px;
    color: var(--gray-700);
}
.modal-orb-body .icon-list li i {
    color: #0EA5E9;
    font-size: 12px;
    margin-top: 4px;
    flex-shrink: 0;
}
.modal-orb-actions {
    display: flex;
    gap: 8px;
    padding: 0 24px 22px;
}
.modal-orb-actions .btn {
    flex: 1;
    height: 40px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    transition: all var(--t-base);
}
.modal-orb-actions .btn-primary {
    background: linear-gradient(135deg, #0E7490, #0EA5E9);
    color: white;
    border: 0;
    box-shadow: 0 6px 16px -8px rgba(14, 165, 233, 0.55);
}
.modal-orb-actions .btn-primary:hover {
    background: linear-gradient(135deg, #0C4A6E, #0284C7);
    transform: translateY(-1px);
}
.modal-orb-actions .btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}
.modal-orb-actions .btn-secondary:hover {
    background: var(--gray-200);
}

@media (max-width: 480px) {
    .login-card { padding: 20px 18px 18px; }
    .login-title { font-size: 20px; }
    .brand-icon { width: 64px; height: 64px; }
    .modal-orb-card { max-width: 100%; }
    .modal-orb-header { padding: 18px 20px; }
    .modal-orb-body { padding: 18px 20px; font-size: 13px; }
    .modal-orb-actions { padding: 0 20px 18px; }
}
/* ==========================================================================
   Aceptaci�n de T�rminos (checkbox personalizada)
   ========================================================================== */

.accept-terms-wrap {
    margin-bottom: 8px;
    position: relative;
}

.accept-terms {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 7px 10px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.04), rgba(99, 102, 241, 0.02));
    border: 1px solid rgba(14, 165, 233, 0.18);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--t-fast);
    font-size: 11.5px;
    color: var(--gray-700);
    line-height: 1.4;
    user-select: none;
}
.accept-terms:hover {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(99, 102, 241, 0.04));
    border-color: rgba(14, 165, 233, 0.32);
}

.accept-terms-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.accept-terms-box {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1.5px solid var(--gray-300);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--t-fast);
    margin-top: 1px;
    color: transparent;
}
.accept-terms-input:checked ~ .accept-terms-box {
    background: linear-gradient(135deg, #0E7490, #0EA5E9);
    border-color: #0EA5E9;
    color: white;
}
.accept-terms-box i {
    font-size: 10px;
}

.accept-terms-text {
    flex: 1;
    min-width: 0;
}
.accept-terms-link {
    color: #0E7490;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dotted #0EA5E9;
    transition: color var(--t-fast), border-color var(--t-fast);
}
.accept-terms-link:hover {
    color: #0EA5E9;
    border-bottom-style: solid;
}

.accept-terms-error {
    display: block;
    font-size: 11px;
    color: var(--danger-600);
    margin-top: 5px;
    margin-left: 24px;
    font-weight: 500;
    line-height: 1.3;
}

/* Shake animation cuando no se marca */
@keyframes shakeX {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}
.accept-terms-wrap.shake {
    animation: shakeX 0.4s ease-in-out;
}
.accept-terms-wrap.shake .accept-terms {
    border-color: var(--danger-500);
    background: rgba(244, 63, 94, 0.06);
}

/* ==========================================================================
   Modal variants: Warning (aceptaci�n de t�rminos)
   ========================================================================== */

.modal-orb-header-warn {
    background: linear-gradient(135deg, #B45309 0%, #F59E0B 100%);
}
.modal-orb-icon-warn {
    background: rgba(255, 255, 255, 0.20);
    animation: pulseWarn 1.5s ease-in-out infinite;
}
@keyframes pulseWarn {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.06); }
}

/* ==========================================================================
   Validaci�n inline de campos (usuario / contrase�a)
   ========================================================================== */

.login-form .form-floating .form-control.is-invalid {
    border-color: var(--danger-500);
    background: rgba(244, 63, 94, 0.04);
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.12);
    animation: shakeInput 0.4s ease-in-out;
}
.login-form .form-floating .form-control.is-invalid:focus {
    border-color: var(--danger-500);
    box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.18);
}
@keyframes shakeInput {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-4px); }
    75%      { transform: translateX(4px); }
}

.js-field-error {
    font-size: 10.5px;
    color: var(--danger-600);
    margin-top: 4px;
    margin-left: 2px;
    display: block;
    line-height: 1.3;
    font-weight: 500;
}
.js-field-error::before {
    content: '\f06a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 5px;
    font-size: 10px;
}

/* ==========================================================================
   Bot�n Ingresar deshabilitado (cuando no se aceptan t�rminos)
   ========================================================================== */

.btn-login:disabled,
.btn-login[disabled] {
    background: linear-gradient(135deg, #94A3B8, #CBD5E1);
    color: rgba(255, 255, 255, 0.85);
    cursor: not-allowed;
    box-shadow: 0 4px 10px -6px rgba(148, 163, 184, 0.40);
    transform: none !important;
    opacity: 0.85;
}
.btn-login:disabled::after {
    display: none;
}
.btn-login:disabled:hover {
    background: linear-gradient(135deg, #94A3B8, #CBD5E1);
    transform: none !important;
    box-shadow: 0 4px 10px -6px rgba(148, 163, 184, 0.40);
}

.btn-lock-icon {
    margin-right: 4px;
    font-size: 12px;
}
.btn-arrow-icon {
    transition: transform var(--t-base);
}
.btn-login:not(:disabled):hover .btn-arrow-icon {
    transform: translateX(3px);
}

/* Texto de ayuda debajo del bot�n */
.btn-help-text {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 6px;
    padding: 6px 10px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px dashed rgba(245, 158, 11, 0.35);
    border-radius: 7px;
    font-size: 10.5px;
    color: #92400E;
    line-height: 1.3;
    text-align: center;
}
.btn-help-text.show {
    display: flex;
}
.btn-help-text i {
    color: #F59E0B;
    font-size: 11px;
    flex-shrink: 0;
}
