:root {
    --brand-primary: #0b4ea2;
    --brand-primary-dark: #082f63;
    --brand-accent: #1d8cf8;
    --brand-blue: #0b4ea2;
    --brand-blue-dark: #082f63;
    --brand-blue-light: #1d8cf8;
    --brand-blue-sky: #4cc9f0;
    --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;
    color: #ffffff;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    text-align: center;
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.80), rgba(25, 25, 25, 0.25));
    border-right: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px) saturate(1.05);
    -webkit-backdrop-filter: blur(10px) saturate(1.05);
}

.logo {
    height: 125px;
    width: auto;
    object-fit: contain;
}

@media (min-width: 768px) {
    .login-brand {
        display: flex;
    }
}

.login-brand p {
    margin-top: 1px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 1.50rem;
    font-weight: 400;
    line-height: 1.35;
}

.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;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.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: var(--brand-blue-light);
    box-shadow: 0 0 0 3px rgba(29, 140, 248, 0.16), 0 10px 22px rgba(8, 47, 99, 0.10);
}

.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 {
    cursor: pointer;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: #1f2937;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-light));
    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 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 14px 30px rgba(11, 78, 162, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand-blue-dark), var(--brand-blue) 54%, var(--brand-blue-light));
    box-shadow: 0 18px 36px rgba(8, 47, 99, 0.34), 0 0 0 1px rgba(76, 201, 240, 0.28) inset;
    transform: translateY(-1px);
}

.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;
}

/* BOTON SUCCESS */
.btn-success {
    width: 100%;
    min-height: 50px;
    background-color: #16a34a;
    color: #ffffff;
    padding: 14px;
    font-size: 1.05rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: background-color 0.3s ease;
}

.btn-success:hover {
    background-color: #15803d;
}

.btn-success:disabled {
    cursor: wait;
    opacity: 0.8;
}

.btn-success.is-loading .spinner-ring {
    display: block;
}

.btn-success.is-loading .btn-text {
    opacity: 0.7;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.is-open {
    display: flex;
}

.modal-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
}

.modal-icon-wrapper {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.is-error .modal-icon-wrapper {
    color: #ef4444;
}

.is-warning .modal-icon-wrapper {
    color: #f59e0b;
}

.is-success .modal-icon-wrapper {
    color: #10b981;
}

.btn-secondary {
    padding: 0.5rem 1.5rem;
    border: none;
    background: #e2e8f0;
    border-radius: 8px;
    margin-top: 1.5rem;
    cursor: pointer;
    color: #1f2937;
}

.form-links {
    margin-top: 16px;
    text-align: center;
}

.forgot-link {
    color: var(--brand-primary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
}

.forgot-link:hover {
    color: var(--brand-accent);
    text-decoration: underline;
}

.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;
    }
}
