@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* ── Variables ─────────────────────────────────────── */
:root {
    --auth-primary:      #0A1628;
    --auth-primary-mid:  #1B2D4F;
    --auth-gold:         #C9A84C;
    --auth-gold-dark:    #A8893A;
    --auth-gold-light:   #E2C97A;
    --auth-surface:      #F8F9FA;
    --auth-white:        #FFFFFF;
    --auth-text-dark:    #0A1628;
    --auth-text-muted:   #6B7280;
    --auth-error-bg:     #FEF2F2;
    --auth-error-border: #FECACA;
    --auth-error-text:   #DC2626;
}

/* ── Contenedor principal split screen ───────────────── */
.auth-container {
    display: flex;
    min-height: 100vh;
    font-family: 'Poppins', sans-serif;
}

/* ── Panel izquierdo (institucional) ─────────────────── */
.auth-panel-left {
    width: 40%;
    background: linear-gradient(160deg, var(--auth-primary) 0%, var(--auth-primary-mid) 100%);
    border-right: 3px solid var(--auth-gold);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 2.5rem;
    position: relative;
    overflow: hidden;
}

.auth-panel-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(201, 168, 76, 0.15) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
}

.auth-panel-left::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--auth-gold), transparent);
}

.auth-logo-wrapper {
    position: relative;
    z-index: 1;
    margin-bottom: 1.5rem;
}

.auth-logo-wrapper svg {
    width: 90px;
    height: 90px;
    filter: drop-shadow(0 4px 12px rgba(201, 168, 76, 0.4));
}

.auth-institution-name {
    color: var(--auth-white);
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.35;
    margin: 0 0 0.5rem 0;
    position: relative;
    z-index: 1;
}

.auth-system-name {
    color: var(--auth-gold-light);
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    margin: 0 0 1.25rem 0;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.auth-description {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.8rem;
    text-align: center;
    line-height: 1.6;
    max-width: 260px;
    margin: 0;
    position: relative;
    z-index: 1;
}

.auth-gold-divider {
    width: 60px;
    height: 2px;
    background: var(--auth-gold);
    margin: 1.25rem auto;
    border-radius: 2px;
    position: relative;
    z-index: 1;
}

/* ── Panel derecho (formulario) ──────────────────────── */
.auth-panel-right {
    width: 60%;
    background: var(--auth-surface);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 2rem;
}

.auth-form-container {
    width: 100%;
    max-width: 400px;
}

.auth-form-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--auth-text-dark);
    margin: 0 0 0.25rem 0;
}

.auth-form-subtitle {
    font-size: 0.9rem;
    color: var(--auth-text-muted);
    margin: 0 0 2rem 0;
}

/* ── Campos del formulario ───────────────────────────── */
.auth-field {
    margin-bottom: 1.25rem;
}

.auth-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--auth-text-dark);
    margin-bottom: 0.4rem;
}

.auth-field .rz-textbox,
.auth-field .rz-password input {
    width: 100% !important;
    height: 48px !important;
    border-radius: 8px !important;
    border: 1.5px solid #D1D5DB !important;
    font-family: 'Poppins', sans-serif !important;
    font-size: 0.9rem !important;
    transition: border-color 0.2s !important;
    background: var(--auth-white) !important;
}

.auth-field .rz-textbox:focus,
.auth-field .rz-password input:focus {
    border-color: var(--auth-gold) !important;
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15) !important;
    outline: none !important;
}

/* ── Botón principal (dorado) ────────────────────────── */
.btn-auth-primary {
    width: 100% !important;
    height: 48px !important;
    background: var(--auth-gold) !important;
    color: var(--auth-white) !important;
    border: none !important;
    border-radius: 8px !important;
    font-family: 'Poppins', sans-serif !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.2s, transform 0.1s !important;
    margin-top: 0.5rem !important;
    letter-spacing: 0.3px !important;
}

.btn-auth-primary:hover:not(:disabled) {
    background: var(--auth-gold-dark) !important;
    transform: translateY(-1px) !important;
}

.btn-auth-primary:disabled {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
}

/* ── Mensajes de error inline ────────────────────────── */
.auth-error-message {
    background: var(--auth-error-bg);
    border: 1px solid var(--auth-error-border);
    color: var(--auth-error-text);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Mensaje de éxito inline ─────────────────────────── */
.auth-success-message {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    color: #166534;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ── Links de autenticación ──────────────────────────── */
.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 1.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.auth-links a {
    color: var(--auth-primary-mid);
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-links a:hover {
    color: var(--auth-gold);
    text-decoration: underline;
}

/* ── Versión ─────────────────────────────────────────── */
.auth-version {
    color: var(--auth-text-muted);
    font-size: 0.75rem;
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 0;
}

/* ── Responsive: móvil ───────────────────────────────── */
@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
    }

    .auth-panel-left {
        width: 100%;
        flex-direction: row;
        justify-content: flex-start;
        gap: 1rem;
        padding: 1.25rem 1.5rem;
        min-height: auto;
        border-right: none;
        border-bottom: 3px solid var(--auth-gold);
    }

    .auth-panel-left::before { display: none; }

    .auth-logo-wrapper { margin-bottom: 0; }
    .auth-logo-wrapper svg { width: 48px; height: 48px; }

    .auth-institution-name {
        font-size: 0.95rem;
        text-align: left;
        margin: 0;
    }

    .auth-system-name {
        font-size: 0.8rem;
        text-align: left;
        margin: 0;
    }

    .auth-description,
    .auth-gold-divider { display: none; }

    .auth-panel-right {
        width: 100%;
        padding: 2rem 1.5rem;
        flex: 1;
    }
}
