﻿/* ================================================== */
/* === ESTILOS DE AUTENTICACIÓN (Login, Register, Recover) === */
/* ================================================== */

/* --- Importación de Fuentes --- */
@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@300;400;500;700&family=Inter:wght@400;500;600;700&display=swap');

/* --- Contenedor Principal (Layout) --- */
.op-auth-body {
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    background-color: #ffffff; /* Fondo blanco por defecto (móvil) */
}

/* --- Títulos (H1) --- */
.op-auth-title {
    font-family: 'Hanken Grotesk', sans-serif;
    font-size: 1.875rem; /* 30px */
    font-weight: 300; /* Light */
    color: #111827; /* gray-900 */
    margin-bottom: 2.5rem; /* 40px */
    text-align: center;
}

/* --- Tarjeta Contenedora --- */
.op-auth-card {
    width: 100%;
    max-width: 24rem; /* 384px */
}

/* --- Logo --- */
.op-auth-logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem; /* 32px */
}

.op-auth-logo {
    max-height: 60px;
    width: auto;
}

/* --- Formulario y Campos --- */
.op-auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem; /* 20px */
}

.op-auth-input-group {
    text-align: left;
}

.op-auth-label {
    font-size: 0.875rem; /* 14px */
    font-weight: 500;
    color: #374151; /* gray-700 */
    margin-bottom: 0.5rem; /* 8px */
    display: block;
}

.op-auth-input {
    width: 100%;
    padding: 0.75rem 1.25rem; /* 12px 20px */
    background-color: #F9FAFB; /* gray-50 */
    border: 1px solid #E5E7EB; /* gray-200 */
    border-radius: 9999px; /* rounded-full */
    transition: all 0.2s;
}

    .op-auth-input:focus {
        outline: 2px solid transparent;
        outline-offset: 2px;
        border-color: #3b82f6; /* blue-500 */
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5); /* Anillo de enfoque azul */
    }

/* --- Contraseña y Botón de Ojo --- */
.op-auth-password-wrapper {
    position: relative;
}

.op-auth-password-toggle {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    display: flex;
    align-items: center;
    padding-right: 1.25rem; /* 20px */
    color: #9CA3AF; /* gray-400 */
    background: none;
    border: none;
    cursor: pointer;
}

/* --- Enlaces --- */
.op-auth-link-center {
    text-align: center;
    padding-top: 0.5rem; /* 8px */
}

.op-auth-link {
    font-size: 0.875rem; /* 14px */
    font-weight: 500;
    color: #2563EB; /* blue-600 */
    text-decoration: none;
}

    .op-auth-link:hover {
        color: #1D4ED8; /* blue-800 */
        text-decoration: underline;
    }

/* --- Botón Principal --- */
.op-auth-button-container {
    padding-top: 1rem; /* 16px */
}

.op-auth-button {
    width: 100%;
    background-color: #000000;
    color: #ffffff;
    font-weight: 700;
    padding: 0.75rem 1rem; /* 12px 16px */
    border: none;
    border-radius: 9999px; /* rounded-full */
    cursor: pointer;
    transition: background-color 0.3s;
}

    .op-auth-button:hover {
        background-color: #1F2937; /* gray-800 */
    }

/* --- Mensajes de Feedback --- */
.op-auth-error {
    color: #EF4444; /* red-500 */
    font-size: 0.875rem; /* 14px */
    text-align: center;
    margin-top: 1rem; /* 16px */
}

.op-auth-success {
    color: #10B981; /* green-500 */
    font-size: 0.875rem; /* 14px */
    text-align: center;
    margin-top: 1rem; /* 16px */
}


/* --- Enlace Inferior (Registrarse/Iniciar Sesión) --- */
.op-auth-bottom-link-container {
    margin-top: 2.5rem; /* 40px */
    text-align: center;
}

.op-auth-bottom-text {
    font-size: 0.875rem; /* 14px */
    color: #4B5563; /* gray-600 */
}

.op-auth-bottom-link {
    font-weight: 600;
    color: #2563EB; /* blue-600 */
    text-decoration: none;
}

    .op-auth-bottom-link:hover {
        text-decoration: underline;
    }


/* --- Reglas Responsivas (para pantallas medianas y superiores) --- */
@media (min-width: 768px) {
    .op-auth-body {
        background-color: #F3F4F6; /* gray-100 */
    }

    .op-auth-card {
        background-color: #ffffff;
        padding: 2rem; /* 32px */
        border-radius: 1rem; /* 16px */
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-lg */
    }
}

/* ================================================================== */
/* ===   NUEVO SISTEMA DE ESTILOS GENERALES DE COMPONENTES (OP-UI)  === */
/* ================================================================== */
/* */
/* Instrucción: Usa estas clases 'op-ui-*' para todos los           */
/* nuevos componentes o al migrar los antiguos para unificar         */
/* el diseño de la aplicación.                                       */
/* */
/* ================================================================== */

/* --- Contenedor de Página --- */
.op-ui-page-container {
    padding: 1rem;
}

/* --- Contenedor Principal (Tarjeta) --- */
.op-ui-card {
    background-color: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    max-width: 900px;
    margin: 0 auto;
}

/* --- Título Principal --- */
.op-ui-title {
    font-family: 'Hanken Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 500;
    color: #111827;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* --- Grid para organización de formularios y resúmenes --- */
.op-ui-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem; /* Espacio vertical para móvil */
}

/* --- Fila de Formulario (Mobile First) --- */
.op-ui-form-row label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    text-align: left;
    margin-bottom: 0.5rem;
}

/* --- Contenedor para el Input y su Validación --- */
.op-ui-input-wrapper {
    width: 100%;
}

/* --- Estilo de Inputs, Textareas y Selects --- */
.op-ui-input {
    width: 100%;
    padding: 0.5rem 0.85rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.375rem;
    transition: all 0.2s;
    background-color: white;
}

    .op-ui-input:focus {
        outline: 2px solid transparent;
        outline-offset: 2px;
        border-color: #4849bf;
        box-shadow: 0 0 0 2px rgba(72, 73, 191, 0.4);
    }

.op-ui-input-readonly {
    background-color: #F3F4F6;
    color: #4B5563;
    cursor: not-allowed;
}

/* --- Wrapper para Contraseña con Ícono --- */
.op-ui-password-wrapper {
    position: relative;
}

.op-ui-password-toggle {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    display: flex;
    align-items: center;
    padding-right: 0.85rem;
    color: #6B7280;
    background-color: transparent;
    border: none;
    cursor: pointer;
}

/* --- Mensaje de Validación --- */
.op-ui-validation-message {
    font-size: 0.75rem;
    color: #DC2626;
    padding-left: 0.25rem;
    display: block;
    margin-top: 0.25rem;
}

/* --- Mensajes de Feedback de Formulario (Éxito/Error) --- */
.op-ui-feedback-message {
    text-align: center;
    padding: 0.75rem;
    margin-top: 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

    .op-ui-feedback-message.success {
        background-color: #D1FAE5;
        color: #065F46;
    }

    .op-ui-feedback-message.error {
        background-color: #FEE2E2;
        color: #991B1B;
    }

/* --- Acordeón Desplegable --- */
.op-ui-accordion-header {
    background-color: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    padding: 0.75rem 1.25rem;
    width: 100%;
    text-align: left;
    font-weight: 500;
    color: #1F2937;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.op-ui-accordion-content {
    padding: 1.5rem;
    border: 1px solid #E5E7EB;
    border-top: none;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

/* --- Contenedor de Tabla --- */
.op-ui-table-wrapper {
    overflow-x: auto;
    margin-top: 1.5rem;
}
/* --- Tabla --- */
.op-ui-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

    .op-ui-table th, .op-ui-table td {
        padding: 0.75rem;
        text-align: left;
        border-bottom: 1px solid #E5E7EB;
        white-space: nowrap;
    }

    .op-ui-table th {
        font-weight: 600;
        color: #4B5563;
        font-size: 0.8rem;
        text-transform: uppercase;
        background-color: #F9FAFB;
    }

    .op-ui-table td {
        vertical-align: middle;
        font-size: 0.9rem;
    }

    .op-ui-table tfoot td {
        font-weight: bold;
        background-color: #F9FAFB;
    }

    .op-ui-table .text-right {
        text-align: right;
    }

/* --- Contenedor de Acciones (Botones) --- */
.op-ui-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    border-top: 1px solid #E5E7EB;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
}

/* --- Estilos base de botones --- */
.op-ui-btn {
    padding: 0.6rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid transparent;
    cursor: pointer;
}

/* --- Variantes de Botones --- */
.op-ui-btn-primary {
    background-color: #4849bf;
    color: white;
}

    .op-ui-btn-primary:hover {
        background-color: #3c3d9c;
    }

.op-ui-btn-secondary {
    background-color: #DBF5F0;
    color: #065f46;
    border-color: transparent;
}

    .op-ui-btn-secondary:hover {
        background-color: #bcf0e4;
    }

.op-ui-btn-success {
    background-color: #10B981;
    color: white;
}

    .op-ui-btn-success:hover {
        background-color: #059669;
    }

.op-ui-btn-danger-sm {
    background-color: #FEE2E2;
    color: #DC2626;
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
}

    .op-ui-btn-danger-sm:hover {
        background-color: #FECACA;
        color: #B91C1C;
    }

/* --- Resumen de Préstamo --- */
.op-ui-summary-box {
    background-color: #F9FAFB;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.op-ui-summary-grid {
    display: grid;
    gap: 0.25rem 1.5rem;
}

.op-ui-summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    padding: 0.1rem 0;
}

    .op-ui-summary-item strong {
        color: #374151;
    }

    .op-ui-summary-item span {
        color: #111827;
        font-weight: 500;
    }

/* --- NUEVO: Caja para la Política de Datos --- */
.op-ui-policy-box {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    background-color: #f9fafb;
    font-size: 0.8rem;
    line-height: 1.5;
    text-align: left;
}

    .op-ui-policy-box h5 {
        font-size: 1rem;
        font-weight: 600;
        margin-top: 0.75rem;
        margin-bottom: 0.25rem;
    }

/* --- Responsive --- */
@media (min-width: 768px) {
    .op-ui-page-container {
        padding: 2rem;
    }

    .op-ui-card {
        padding: 2rem;
    }

    .op-ui-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem 1.5rem;
    }

    .op-ui-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .op-ui-grid > .op-ui-col-span-2 {
        grid-column: span 2;
    }

    .op-ui-form-row {
        display: flex;
        align-items: center;
    }

        .op-ui-form-row label {
            flex-basis: 130px;
            flex-shrink: 0;
            padding-right: 1rem;
            margin-bottom: 0;
        }
}

@media (max-width: 640px) {
    .op-ui-table thead {
        display: none;
    }

    .op-ui-table tr {
        display: block;
        border: 1px solid #e5e7eb;
        border-radius: 0.5rem;
        margin-bottom: 1rem;
        padding: 0.5rem;
    }

    .op-ui-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
        padding: 0.5rem 0;
    }

        .op-ui-table td::before {
            content: attr(data-label);
            font-weight: 600;
            color: #4B5563;
            padding-right: 1rem;
        }
}
