:root {
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius-md: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body, html {
    height: 100%;
    width: 100%;
    background-color: #f0f2f5;
}

.page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('../img/Fondo.png') no-repeat center center;
    background-size: cover;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.login-container {
    display: flex;
    width: 900px;
    max-width: 95%;
    min-height: 520px;
    background: transparent;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.login-brand {
    flex: 1;
    background-color: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    text-align: center;
}

.logo {
    height: 125px;
    width: auto;
    object-fit: contain;
}

@media (min-width: 768px) {
    .login-brand {
        display: flex;
    }
}

.login-brand p {
    font-size: 1.4rem;
    font-weight: 300;
    opacity: 0.9;
    margin-top: 20px;
    color: #ffffff;
}

.login-form-wrapper {
    flex: 1;
    background-color: #ffffff;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-form {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
}

.form-header {
    text-align: center;
    margin-bottom: 35px;
}

.form-header h2 {
    color: #1e293b;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.form-header .subtitle {
    color: #6b7280;
    font-size: 0.95rem;
}

.input-group {
    margin-bottom: 22px;
}

    .input-group label {
        display: block;
        margin-bottom: 8px;
        color: #374151;
        font-size: 0.9rem;
        font-weight: 500;
    }

.input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0 14px;
    background: #ffffff;
    transition: border-color 0.3s ease;
}

    .input-wrapper:focus-within {
        border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    }

    .input-wrapper i {
        color: #6b7280;
        font-size: 1.2rem;
    }

    .input-wrapper .divider {
        width: 1px;
        height: 24px;
        background-color: #d1d5db;
        margin: 0 12px;
    }

    .input-wrapper input {
        flex: 1;
        border: none;
        outline: none;
        padding: 14px 0;
        font-size: 1rem;
        color: #1f2937;
        background: transparent;
    }

.toggle-password {
    border: 0;
    background: transparent;
    padding: 8px;
    cursor: pointer;
    transition: color 0.2s;
}

.input-wrapper input { min-width: 0; }
.access-link { display: block; text-align: center; margin-top: 22px; color: #1e3a8a; font-size: .92rem; text-underline-offset: 4px; }
.access-link:hover { color: #2563eb; }
.access-link:focus-visible, .toggle-password:focus-visible { outline: 3px solid #2563eb; outline-offset: 4px; border-radius: 4px; }
.recovery-description { color: #64748b; line-height: 1.6; margin-top: 14px; }

    .toggle-password:hover {
        color: #1f2937;
    }

.btn-primary {
    width: 100%;
    background-color: #1e3a8a;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 1.05rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

    .btn-primary:hover {
        background-color: #172554;
    }

.spinner-ring {
    position: absolute;
    right: 20px;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.btn-primary.is-loading .spinner-ring {
    display: block;
}

.btn-primary.is-loading .btn-text {
    opacity: 0.7;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.version-text {
    margin-top: 18px;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.90);
    letter-spacing: 0.5px;
    font-weight: 300;
}

@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        width: 100%;
        max-width: 450px;
        min-height: auto;
    }

    .login-brand {
        padding: 40px 20px;
        display: flex;
    }

    .login-form-wrapper {
        padding: 40px 25px;
    }
}

/* Recursos locales y avisos sin estilos inline. */
.duplicate-instance { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: #f8d7da; color: #721c24; flex-direction: column; text-align: center; padding: 20px; }
.duplicate-instance img { max-width: 300px; margin-top: 20px; }
.duplicate-instance h1 { font-size: 2rem; }
.duplicate-instance p { font-size: 1.2rem; }
.duplicate-instance p:last-child { margin-top: 1px; font-weight: bold; color: #a71d2a; }
.alarm-empty { text-align: center; color: #64748b; padding: 20px 0; }
.alarm-empty > i { font-size: 2rem; color: var(--success); display: block; margin-bottom: 8px; }
.notification-badge[hidden] { display: none; }
