/* ==========================================================================
   SAT-SHIELD GIS CENTER
   LOGIN V1
   ========================================================================== */

:root {
    --login-bg: #0f172a;
    --login-panel: rgba(15, 23, 42, 0.82);

    --login-primary: #2563eb;
    --login-primary-hover: #1d4ed8;

    --login-success: #10b981;
    --login-danger: #ef4444;

    --login-text: #f8fafc;
    --login-muted: #94a3b8;

    --login-border: rgba(148, 163, 184, 0.16);
    --login-border-hover: rgba(37, 99, 235, 0.55);

    --login-radius: 12px;

    --login-shadow:
        0 25px 60px rgba(0, 0, 0, 0.45),
        0 8px 25px rgba(0, 0, 0, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family:
        'Inter',
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        sans-serif;

    background: var(--login-bg);
    color: var(--login-text);
}

.login-screen {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    background: var(--login-bg);
}

.gis-background {
    position: absolute;
    inset: -25px;

    background-image:
        url('/static/uploads/login-background.jpeg');

    background-size: cover;
    background-position: center;

    filter:
        saturate(0.65)
        brightness(0.55)
        contrast(1.05)
        blur(1px);

    transform: scale(1.03);

    z-index: 0;
}

.gis-overlay {
    position: absolute;
    inset: 0;

    background:
        radial-gradient(
            circle at center,
            rgba(15, 23, 42, 0.30) 0%,
            rgba(15, 23, 42, 0.68) 65%,
            rgba(2, 6, 23, 0.90) 100%
        ),

        linear-gradient(
            90deg,
            rgba(15, 23, 42, 0.30),
            rgba(15, 23, 42, 0.12),
            rgba(15, 23, 42, 0.30)
        );

    z-index: 1;
}

.gis-grid {
    position: absolute;
    inset: 0;

    background-image:
        linear-gradient(
            rgba(148, 163, 184, 0.035) 1px,
            transparent 1px
        ),

        linear-gradient(
            90deg,
            rgba(148, 163, 184, 0.035) 1px,
            transparent 1px
        );

    background-size: 80px 80px;

    mask-image:
        radial-gradient(
            ellipse at center,
            black 0%,
            transparent 75%
        );

    -webkit-mask-image:
        radial-gradient(
            ellipse at center,
            black 0%,
            transparent 75%
        );

    z-index: 2;

    pointer-events: none;
}

.gis-coordinate {
    position: absolute;

    color: rgba(148, 163, 184, 0.45);

    font-size: 9px;
    letter-spacing: 0.18em;
    text-transform: uppercase;

    z-index: 3;
    user-select: none;
}

.coordinate-top {
    top: 28px;
    left: 32px;
}

.coordinate-bottom {
    right: 32px;
    bottom: 28px;
}

.gis-status {
    position: absolute;

    top: 28px;
    right: 32px;

    display: flex;
    align-items: center;
    gap: 8px;

    color: rgba(226, 232, 240, 0.60);

    font-size: 9px;
    letter-spacing: 0.16em;

    z-index: 3;
}

.status-dot {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: var(--login-success);

    box-shadow:
        0 0 0 3px rgba(16, 185, 129, 0.10),
        0 0 12px rgba(16, 185, 129, 0.55);
}

.login-panel {
    position: relative;

    width: min(420px, calc(100% - 40px));

    padding: 36px 38px 25px;

    background: var(--login-panel);

    border: 1px solid var(--login-border);

    border-radius: 14px;

    box-shadow: var(--login-shadow);

    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    z-index: 10;

    animation:
        login-panel-enter 0.55s ease-out both;
}

.login-panel-accent {
    position: absolute;

    top: -1px;
    left: 15%;
    right: 15%;

    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(37, 99, 235, 0.85),
            transparent
        );

    box-shadow:
        0 0 18px rgba(37, 99, 235, 0.25);
}

.login-header {
    text-align: center;
    margin-bottom: 27px;
}

.logo-container {
    position: relative;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    width: 266px;
    height: 266px;

    margin-bottom: 12px;
}

.login-logo {
    position: relative;

    width: 260px;
    height: 260px;

    object-fit: contain;

    z-index: 2;
}

.logo-glow {
    position: absolute;

    width: 70px;
    height: 70px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(37, 99, 235, 0.18) 0%,
            rgba(37, 99, 235, 0.05) 45%,
            transparent 70%
        );

    filter: blur(5px);

    z-index: 1;
}

.brand-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.18em;

    color: var(--login-text);
}

.brand-subtitle {
    margin-top: 3px;

    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.38em;

    color: var(--login-muted);
}

.login-divider {
    display: flex;

    align-items: center;

    gap: 9px;

    width: 100%;

    margin: 17px auto 13px;
}

.login-divider span {
    flex: 1;

    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            var(--login-border)
        );
}

.login-divider span:last-child {
    background:
        linear-gradient(
            90deg,
            var(--login-border),
            transparent
        );
}

.login-divider i {
    width: 12px;
    height: 12px;

    color: var(--login-primary);
}

.login-intro {
    color: var(--login-muted);
    font-size: 12px;
}

.login-alerts {
    display: flex;
    flex-direction: column;

    gap: 8px;

    margin-bottom: 18px;
}

.login-alert {
    display: flex;
    align-items: center;

    gap: 9px;

    padding: 10px 12px;

    border-radius: 8px;

    font-size: 11px;
    line-height: 1.4;
}

.login-alert svg {
    flex-shrink: 0;

    width: 15px;
    height: 15px;
}

.login-alert.error,
.login-alert.danger {
    color: #fca5a5;

    background:
        rgba(239, 68, 68, 0.08);

    border:
        1px solid rgba(239, 68, 68, 0.18);
}

.login-alert.success {
    color: #6ee7b7;

    background:
        rgba(16, 185, 129, 0.08);

    border:
        1px solid rgba(16, 185, 129, 0.18);
}

.login-form {
    display: flex;
    flex-direction: column;

    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;

    gap: 7px;
}

.form-label {
    color: #cbd5e1;

    font-size: 11px;
    font-weight: 500;

    letter-spacing: 0.01em;
}

.input-wrapper {
    position: relative;

    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    height: 46px;

    padding:
        0 43px
        0 42px;

    color: var(--login-text);

    background:
        rgba(15, 23, 42, 0.70);

    border:
        1px solid rgba(148, 163, 184, 0.16);

    border-radius: 8px;

    outline: none;

    font-family: inherit;
    font-size: 12px;

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.input-wrapper input::placeholder {
    color: #64748b;
}

.input-wrapper input:hover {
    border-color:
        rgba(148, 163, 184, 0.28);
}

.input-wrapper input:focus {
    background:
        rgba(15, 23, 42, 0.86);

    border-color:
        var(--login-border-hover);

    box-shadow:
        0 0 0 3px
        rgba(37, 99, 235, 0.08);
}

.input-icon {
    position: absolute;

    left: 14px;

    width: 16px;
    height: 16px;

    color: #64748b;

    pointer-events: none;

    z-index: 2;
}

.input-wrapper:focus-within .input-icon {
    color: #60a5fa;
}

.password-toggle {
    position: absolute;

    right: 8px;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    border: none;

    border-radius: 6px;

    background: transparent;

    color: #64748b;

    cursor: pointer;

    transition:
        color 0.2s ease,
        background 0.2s ease;
}

.password-toggle:hover {
    color: #cbd5e1;

    background:
        rgba(148, 163, 184, 0.08);
}

.password-toggle svg {
    width: 16px;
    height: 16px;
}

.login-button {
    position: relative;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 100%;
    height: 46px;

    margin-top: 3px;

    border:
        1px solid rgba(96, 165, 250, 0.22);

    border-radius: 8px;

    background:
        linear-gradient(
            135deg,
            #2563eb,
            #1d4ed8
        );

    color: white;

    font-family: inherit;

    font-size: 12px;
    font-weight: 600;

    letter-spacing: 0.04em;

    cursor: pointer;

    box-shadow:
        0 8px 20px
        rgba(37, 99, 235, 0.18);

    transition:
        transform 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease,
        opacity 0.18s ease;
}

.login-button:hover:not(:disabled) {
    background:
        linear-gradient(
            135deg,
            #3b82f6,
            #2563eb
        );

    transform: translateY(-1px);

    box-shadow:
        0 10px 25px
        rgba(37, 99, 235, 0.28);
}

.login-button:active:not(:disabled) {
    transform: translateY(0);
}

.login-button:disabled {
    cursor: wait;
    opacity: 0.75;
    transform: none;
}

.button-content,
.button-loading {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;
}

.button-content svg {
    width: 15px;
    height: 15px;
}

.button-loading {
    font-size: 11px;
}

.loading-spinner {
    width: 14px;
    height: 14px;

    border:
        2px solid
        rgba(255, 255, 255, 0.28);

    border-top-color: white;

    border-radius: 50%;

    animation:
        spinner-rotate 0.7s linear infinite;
}
.login-footer {
    display: flex;

    align-items: center;
    justify-content: center;

    flex-wrap: wrap;

    gap: 7px;

    margin-top: 23px;

    color: #64748b;

    font-size: 9px;

    letter-spacing: 0.02em;
}

.security-indicator {
    display: inline-flex;

    align-items: center;

    gap: 5px;
}

.security-indicator svg {
    width: 12px;
    height: 12px;

    color: var(--login-success);
}

.footer-separator {
    color: #475569;
}


/* ==========================================================================
   OVERLAY DE AUTENTICACIÓN
   ========================================================================== */

.login-loading-overlay {
    position: fixed;

    inset: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    background:
        rgba(2, 6, 23, 0.82);

    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);

    opacity: 0;

    visibility: hidden;

    z-index: 100;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;
}

.login-loading-overlay.active {
    opacity: 1;

    visibility: visible;
}

.loading-panel {
    display: flex;

    flex-direction: column;

    align-items: center;

    text-align: center;
}

.loading-logo-wrapper {
    position: relative;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 100px;
    height: 100px;

    margin-bottom: 18px;
}

.loading-logo {
    width: 100px;
    height: 100px;

    object-fit: contain;

    z-index: 2;

    animation:
        loading-logo-pulse 1.8s ease-in-out infinite;
}

.loading-ring {
    position: absolute;

    width: 94px;
    height: 94px;

    border-radius: 50%;

    border:
        1px solid
        rgba(37, 99, 235, 0.28);

    border-top-color:
        rgba(96, 165, 250, 0.90);

    border-right-color:
        rgba(37, 99, 235, 0.40);

    animation:
        spinner-rotate 1.4s linear infinite;
}

.loading-brand {
    color: var(--login-text);

    font-size: 15px;

    font-weight: 700;

    letter-spacing: 0.18em;
}

.loading-message {
    margin-top: 10px;

    color: #cbd5e1;

    font-size: 12px;
}

.loading-submessage {
    margin-top: 5px;

    color: #64748b;

    font-size: 10px;
}


/* ==========================================================================
   ANIMACIONES
   ========================================================================== */

@keyframes login-panel-enter {

    from {
        opacity: 0;

        transform:
            translateY(12px)
            scale(0.985);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }

}

@keyframes spinner-rotate {

    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }

}

@keyframes loading-logo-pulse {

    0%,
    100% {
        opacity: 0.72;

        transform: scale(0.97);
    }

    50% {
        opacity: 1;

        transform: scale(1);
    }

}


/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 600px) {

    .login-panel {
        width: calc(100% - 28px);

        padding:
            30px 24px
            22px;

        border-radius: 12px;
    }

    .gis-coordinate {
        display: none;
    }

    .gis-status {
        top: 18px;
        right: 18px;
    }

    .logo-container {
        width: 72px;
        height: 72px;
    }

    .login-logo {
        width: 66px;
        height: 66px;
    }

}


@media (max-height: 650px) {

    .login-panel {
        padding-top: 25px;
        padding-bottom: 18px;
    }

    .login-header {
        margin-bottom: 18px;
    }

    .logo-container {
        width: 62px;
        height: 62px;

        margin-bottom: 7px;
    }

    .login-logo {
        width: 58px;
        height: 58px;
    }

    .login-divider {
        margin-top: 10px;
        margin-bottom: 9px;
    }

    .login-form {
        gap: 13px;
    }

    .login-footer {
        margin-top: 15px;
    }

}


/* ==========================================================================
   REDUCCIÓN DE MOVIMIENTO
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;

        animation-iteration-count: 1 !important;

        scroll-behavior: auto !important;

        transition-duration: 0.01ms !important;
    }

}

/* ==========================================================================
   ESTADOS DEL BOTÓN DE LOGIN
   ========================================================================== */

.button-content[hidden],
.button-loading[hidden] {
    display: none !important;
}

