﻿:root {
    --blue: #2563EB;
    --blue-light: #dbeafe;
    --blue-hover: #1D4ED8;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --bg: #f5f5f5;
    --card: #ffffff;
    --input-bg: #f8fafc;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, .07), 0 2px 4px -2px rgba(0, 0, 0, .05);
    --shadow-lg: 0 20px 60px -10px rgba(37, 99, 235, .15), 0 4px 16px rgba(0, 0, 0, .06);
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    gap: 16px;
}

/* estilo del card */
.login-card {
    background: var(--card);
    border-radius: var(--radius);
    border-color: 1px solid #0f172a;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 1000px;
    height: 530px;
    max-width: 860px;
    overflow: hidden;
    animation: fadeUp .45s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/*estilo del logo empresa*/
.logo-header {
    height: 1px;
    width: 1px;
}

.logo-header img {
    height: 1px;
    width: 1px;
}

/* estilo del panel de formulario */
.form-panel {
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-header {
    text-align: center;
    margin-bottom: 4px;
}

.form-header h1 {
    font-size: 2rem;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 6px;
    font-weight: 700;
}

.form-header p {
    margin-top: .5rem;
    margin-bottom: .5rem;
    font-size: 1rem;
    color: var(--muted);
}

/* fields */
.form-group-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group-wrap label {
    font-size: .9rem;
    font-weight: 600;
    color: var(--text);
}

.contrase-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.field-row a {
    font-size: 0.82rem;
    color: var(--blue);
    text-decoration: none;
}

.input-wrap {
    position: relative;
    width: 100%;
    height: 44px; 
}

.input-wrap input {
    width: 100%;
    height: 100%;
    padding: 0 42px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--text);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

/* Quitar icono de validacion de la contraseña */
.form-login .form-control,
.form-login .form-control:valid,
.form-login .form-control:invalid,
.form-login .form-control.is-valid,
.form-login .form-control.is-invalid {
    background-image: none !important;
    padding-right: 42px !important;
}

.input-wrap input::placeholder {
    color: var(--muted);
    font-size: 0.875rem;
}

.input-wrap input:focus {
    border-color: var(--blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.input-wrap > i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--muted);
    pointer-events: none;
    line-height: 1;
}

.btn-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: color .2s;
}

.btn-eye:hover {
    color: var(--blue);
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background: var(--blue);
    color: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-submit:hover {
    background: var(--blue-hover);
}

.btn-submit:active {
    transform: scale(0.98);
}

/* image de login*/
.image-panel {
    position: relative;
    overflow: hidden;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 21px;
    object-fit: cover;
}

.image-panel img {
    width: 100%;
    height: 100%;
    object-fit: fill;
}


/* ===== MODAL DE ERROR ===== */
.auth-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.58);
    z-index: 9999;
    padding: 20px;
}

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

.alert-danger {
    width: 400px;
    max-width: 420px;
    border-radius: 14px;
    border: 1px solid #fecaca;
    padding: 24px 20px;
    color: #7a271a;
}
.alert-danger i {
    font-size: 1.2rem;
    color: #b42318;
}

.alert-danger h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #b42318;
    margin: 0 0 8px;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-modal-box {
    animation: modalSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}


/* Validación del formulario */
.input-wrap input.is-invalid {
    border-color: #dc3545;
    padding-right: 40px;
    background-image: none;
}

.input-wrap input.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, .25);
}

.form-group-wrap .invalid-feedback {
    display: none;
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 4px;
    padding-left: 2px;
}

.was-validated .form-group-wrap.has-error .invalid-feedback {
    display: block;
}

/*spinner de carga*/
.spinner-icon {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.btn-submit.loading .btn-text { display: none; }
.btn-submit.loading .spinner-icon { display: block; }
.btn-submit.loading {
    pointer-events: none;
    opacity: 0.85;
    cursor: not-allowed;
}

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


@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(-1deg);
    }

    50% {
        transform: translateY(-14px) rotate(1deg);
    }
}


/* FOOTER NOTE */
.footer-note {
    font-size: 0.8rem;
    color: var(--muted);
    text-align: center;
    animation: fadeUp .45s .15s cubic-bezier(.22, 1, .36, 1) both;
}

.footer-note small {
    font-size: 0.9rem;
}

.footer-note span {
    font-weight: 500;
    color: var(--text);
}

/* RESPONSIVE */
@media (max-width: 640px) {
    .login-card {
        grid-template-columns: 1fr;
    }

    .image-panel {
        display: none;
    }

    .form-panel {
        padding: 36px 28px;
    }
}


