/* ============================================
   NEXPRO CONNECT - LOGIN PAGE
   ============================================ */

/* Los tokens los enlaza _Layout.cshtml con asp-append-version. No van por
   @import: esa URL no lleva versión, el navegador reusa la copia vieja de la
   caché y, al llegar después en el cascade, le gana a la del <link>. Un cambio
   de token no se veía hasta vaciar la caché a mano. */

.nexpro-login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: url('/images/login-background.jpg') no-repeat center center fixed;
    background-size: cover;
}

/* Very subtle technical grid for texture */
.nexpro-login-container::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.5;
    z-index: 0;
}

/* Soft dark overlay to reduce edge brightness */
.nexpro-login-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at center,
        rgba(6, 14, 26, 0.15) 0%,
        rgba(6, 14, 26, 0.45) 70%,
        rgba(6, 14, 26, 0.6) 100%
    );
    z-index: 1;
}

.nexpro-login-card {
    position: relative;
    z-index: 10;
    background-color: var(--nexpro-glass-bg);
    border: 1px solid var(--nexpro-glass-border);
    border-radius: var(--nexpro-border-radius-xl);
    padding: var(--nexpro-spacing-2xl);
    width: 100%;
    max-width: 480px;
    box-shadow:
        0 30px 60px -12px rgba(0, 0, 0, 0.4),
        0 18px 36px -18px rgba(0, 0, 0, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(30px) saturate(160%);
    -webkit-backdrop-filter: blur(30px) saturate(160%);
    animation: cardEntrance 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nexpro-login-logo {
    text-align: center;
    margin-bottom: var(--nexpro-spacing-xl);
}

.nexpro-login-logo img {
    max-width: 200px;
    height: auto;
}

/* Language Selector Dropdown */
.nexpro-login-language {
    position: absolute;
    top: var(--nexpro-spacing-lg);
    right: var(--nexpro-spacing-lg);
    z-index: 10;
}

.nexpro-language-toggle {
    background: rgba(19, 75, 230, 0.08);
    border: 1px solid rgba(19, 75, 230, 0.18);
    padding: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nexpro-primary, #134be6);
    transition: all 0.3s ease;
    border-radius: 14px;
}

.nexpro-language-toggle:hover {
    background: rgba(19, 75, 230, 0.14);
    color: var(--nexpro-primary-dark, #0f3bb8);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(19, 75, 230, 0.15);
}

.nexpro-language-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nexpro-primary);
}

.nexpro-language-dropdown {
    position: absolute;
    top: calc(100% + var(--nexpro-spacing-xs));
    right: 0;
    background-color: var(--nexpro-bg-card);
    border: 1px solid var(--nexpro-border-color);
    border-radius: var(--nexpro-border-radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 2px;
    min-width: 60px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: slideDown 0.2s ease;
    z-index: 1000;
}

.nexpro-language-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 12px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 6px 8px 6px;
    border-color: transparent transparent var(--nexpro-bg-card) transparent;
}

.nexpro-language-dropdown::after {
    content: '';
    position: absolute;
    top: -9px;
    right: 12px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 6px 8px 6px;
    border-color: transparent transparent var(--nexpro-border-color) transparent;
    z-index: -1;
}

.nexpro-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--nexpro-spacing-md);
    font-size: 14px;
}

.nexpro-remember-me {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--nexpro-text-secondary);
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.nexpro-remember-me:hover {
    color: var(--nexpro-primary);
}

.nexpro-remember-me input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--nexpro-primary);
}

.nexpro-forgot-password {
    color: var(--nexpro-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    padding: 4px 8px;
    border-radius: 8px;
}

.nexpro-forgot-password:hover {
    background-color: var(--nexpro-primary-lighter);
    transform: translateY(-1px);
}

/* Forgot Password View Specifics */
.nexpro-login-header {
    text-align: center;
    margin-bottom: var(--nexpro-spacing-xl);
}

.nexpro-login-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--nexpro-text-primary);
    margin-bottom: 8px;
}

.nexpro-login-header p {
    color: var(--nexpro-text-secondary);
    font-size: 0.95rem;
}

.nexpro-login-success {
    background-color: var(--nexpro-success-light);
    color: #155724;
    padding: 16px;
    border-radius: var(--nexpro-border-radius-lg);
    font-size: 14px;
    text-align: center;
    margin-bottom: var(--nexpro-spacing-lg);
    border: 1px solid rgba(38, 176, 80, 0.2);
    animation: fadeIn 0.4s ease;
}

.nexpro-form-footer {
    margin-top: var(--nexpro-spacing-xl);
    text-align: center;
}

.nexpro-back-link {
    display: inline-block;
    color: var(--nexpro-text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 14px;
}

.nexpro-back-link:hover {
    color: var(--nexpro-primary);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nexpro-lang-btn {
    padding: 8px 12px;
    border: none;
    background-color: transparent;
    color: var(--nexpro-text-secondary);
    border-radius: var(--nexpro-border-radius-sm);
    font-size: var(--nexpro-font-size-sm);
    font-weight: var(--nexpro-font-weight-medium);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    width: 100%;
}

.nexpro-lang-btn:hover {
    background-color: var(--nexpro-bg-hover);
    color: var(--nexpro-primary);
}

.nexpro-lang-btn.active {
    background-color: var(--nexpro-primary);
    color: var(--nexpro-text-white);
}

/* Login Form */
.nexpro-login-form {
    display: flex;
    flex-direction: column;
    gap: var(--nexpro-spacing-lg);
}

.nexpro-form-group {
    display: flex;
    flex-direction: column;
    gap: var(--nexpro-spacing-xs);
}

.nexpro-form-label {
    font-size: var(--nexpro-font-size-sm);
    font-weight: var(--nexpro-font-weight-medium);
    color: var(--nexpro-primary);
    margin-bottom: var(--nexpro-spacing-xs);
    text-align: left;
}

.nexpro-form-input {
    width: 100%;
    padding: var(--nexpro-spacing-md) var(--nexpro-spacing-lg);
    border: 2px solid var(--nexpro-border-color);
    border-radius: var(--nexpro-border-radius-md);
    font-size: var(--nexpro-font-size-base);
    color: var(--nexpro-text-primary);
    background-color: var(--nexpro-bg-card);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.nexpro-form-input:focus {
    outline: none;
    border-color: var(--nexpro-primary);
    box-shadow: 0 0 0 3px rgba(19, 75, 230, 0.1);
}

.nexpro-form-input::placeholder {
    color: var(--nexpro-text-muted);
}

.nexpro-form-input.error {
    border-color: #dc3545;
}

.nexpro-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.nexpro-password-wrapper .nexpro-form-input {
    padding-right: 50px;
}

.nexpro-password-toggle {
    position: absolute;
    right: var(--nexpro-spacing-md);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--nexpro-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--nexpro-spacing-xs);
    transition: color 0.2s ease;
}

.nexpro-password-toggle:hover {
    color: var(--nexpro-primary);
}

.nexpro-password-toggle svg {
    width: 20px;
    height: 20px;
}

.nexpro-login-error {
    padding: var(--nexpro-spacing-md);
    background-color: #fee;
    border: 1px solid #fcc;
    border-radius: var(--nexpro-border-radius-md);
    color: #c33;
    font-size: var(--nexpro-font-size-sm);
    text-align: center;
    animation-duration: 0.35s;
    animation-timing-function: ease-in-out;
    min-height: 0;
    display: none;
}

.nexpro-login-error.is-hidden {
    display: none;
}

.nexpro-login-error:not(.is-hidden) {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pulse when the same error repeats */
.nexpro-login-error.error-pulse-1,
.nexpro-login-error.error-pulse-2,
.nexpro-login-error.error-pulse-3,
.nexpro-login-error.error-pulse-4,
.nexpro-login-error.error-pulse-5 {
    animation-name: errorPulse;
}

.nexpro-login-button {
    width: 100%;
    padding: var(--nexpro-spacing-md) var(--nexpro-spacing-xl);
    background-color: var(--nexpro-primary);
    color: var(--nexpro-text-white);
    border: none;
    border-radius: var(--nexpro-border-radius-md);
    font-size: var(--nexpro-font-size-base);
    font-weight: var(--nexpro-font-weight-semibold);
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--nexpro-spacing-sm);
    min-height: 48px;
}

.nexpro-login-button:hover:not(:disabled) {
    background-color: var(--nexpro-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(19, 75, 230, 0.3);
}

.nexpro-login-button:active:not(:disabled) {
    transform: translateY(0);
}

.nexpro-login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.nexpro-spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--nexpro-text-white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes errorPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.015); }
    100% { transform: scale(1); }
}

/* Responsive */
@media (max-width: 768px) {
    .nexpro-login-card {
        margin: var(--nexpro-spacing-lg);
        padding: var(--nexpro-spacing-xl);
        max-width: 100%;
    }
}
/* Aviso de sesion expirada: informativo, no es un error de credenciales. */
.nexpro-login-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    padding: 0.65rem 0.8rem;
    border-radius: 8px;
    background: rgba(20, 80, 255, 0.08);
    border: 1px solid rgba(20, 80, 255, 0.25);
    color: #0a3f9e;
    font-size: 0.85rem;
    line-height: 1.35;
}

.nexpro-login-notice i {
    flex-shrink: 0;
    line-height: 1.35;
}
