/* =============================================================
   IDUVI — Responsive
   Bootstrap 5 breakpoints:
     xs  < 576px | sm >= 576px | md >= 768px
     lg >= 992px | xl >= 1200px | xxl >= 1400px
   ============================================================= */

/* ---------------------------------------------------------
   1. LOGIN PAGE (.lp-*)
   --------------------------------------------------------- */

.login-page {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

/* Panel izquierdo — Banner institucional */
.lp-panel-left {
    width: 38%;
    min-height: 100vh;
    background: linear-gradient(150deg, #96bd26 0%, #009045 55%, #007a3a 100%);
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: sticky;
    top: 0;
    overflow: hidden;
}

.lp-panel-left::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../img/login/bg-login-TR.png") center/cover no-repeat;
    opacity: 0.10;
    pointer-events: none;
}

.lp-logo        { height: 60px; width: auto; }
.lp-mobile-logo { height: 52px; width: auto; }

.lp-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 0 24px;
}

.lp-title {
    color: #fff;
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.lp-subtitle {
    color: rgba(255, 255, 255, 0.88);
    font-size: clamp(0.88rem, 1.2vw, 1rem);
    line-height: 1.65;
    margin-bottom: 32px;
}

.lp-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lp-link {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 24px;
    padding: 8px 20px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background-color 0.25s, border-color 0.25s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
}

.lp-link:hover {
    background-color: rgba(255, 255, 255, 0.18);
    border-color: #fff;
    color: #fff;
}

.lp-footer-brand {
    color: rgba(255, 255, 255, 0.60);
    font-size: 0.78rem;
}

/* Panel derecho — Formularios */
.lp-panel-right {
    flex: 1;
    background-color: #fff;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 48px 24px;
}

.lp-form-wrapper { width: 100%; max-width: 520px; }

.lp-form-title {
    color: var(--iduvi-primary);
    font-size: 1.65rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.lp-form-subtitle {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.lp-divider {
    border: none;
    border-top: 1px solid #e9ecef;
    margin: 12px 0;
}

.lp-link-forgot {
    font-size: 0.82rem;
    color: var(--iduvi-primary);
    text-decoration: none;
    font-weight: 500;
}

.lp-link-forgot:hover {
    text-decoration: underline;
    color: var(--iduvi-secondary);
}

.lp-forgot-section {
    background-color: #f8fffe;
    border: 1px solid #c3e6cb;
    border-radius: var(--iduvi-radius);
    padding: 16px 18px;
}

.lp-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--iduvi-primary);
    border-bottom: 1px solid #d4edda;
    padding-bottom: 6px;
    margin-bottom: 12px;
    margin-top: 8px;
    display: flex;
    align-items: center;
}

/* Input group — borde rojo en icono prepend cuando el campo es inválido */
.input-group.has-validation .input-group-text.is-invalid {
    border-color: #dc3545;
}

/* Input group — focus institucional */
.input-group .form-control:focus {
    border-color: var(--iduvi-primary);
    box-shadow: 0 0 0 3px rgba(0, 144, 69, 0.15);
    z-index: 3;
}

.input-group .btn-outline-secondary {
    border-color: #dee2e6;
    color: #6c757d;
    background-color: #fff;
}

.input-group .btn-outline-secondary:hover {
    border-color: var(--iduvi-primary);
    color: var(--iduvi-primary);
    background-color: var(--iduvi-accent);
}

.lp-panel-right .btn-iduvi {
    padding: 12px 20px;
    font-size: 0.95rem;
}

/* ---------------------------------------------------------
   2. LAYOUT PRINCIPAL RESPONSIVE
   --------------------------------------------------------- */

@media (max-width: 991.98px) {
    .iduvi-main-content { width: 100%; }
    .iduvi-header { padding: 10px 16px; }
    .iduvi-page-panel { padding: 16px 14px; }
}

@media (max-width: 575.98px) {
    .iduvi-header img.iduvi-logo { height: 40px; }
    .iduvi-page-panel { padding: 12px 10px; }
}

/* ---------------------------------------------------------
   3. CARDS RESPONSIVE
   --------------------------------------------------------- */

@media (max-width: 767.98px) {
    .card-iduvi { padding: 16px; }
}

/* ---------------------------------------------------------
   4. FORMULARIOS RESPONSIVE
   --------------------------------------------------------- */

@media (max-width: 575.98px) {
    .form-control,
    .form-select {
        font-size: 16px; /* evita zoom en iOS */
    }

    .btn-iduvi,
    .btn-iduvi-outline {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}

/* ---------------------------------------------------------
   5. TABLAS RESPONSIVE
   --------------------------------------------------------- */

.table-iduvi-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--iduvi-radius);
    box-shadow: var(--iduvi-shadow);
}

@media (max-width: 767.98px) {
    .table-iduvi thead { display: none; }

    .table-iduvi tr {
        display: block;
        margin-bottom: 12px;
        border: 1px solid #dee2e6;
        border-radius: var(--iduvi-radius);
        overflow: hidden;
    }

    .table-iduvi td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 14px;
        border-bottom: 1px solid #f0f0ec;
        font-size: 0.88rem;
    }

    .table-iduvi td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--iduvi-dark);
        flex-shrink: 0;
        margin-right: 12px;
        font-size: 0.82rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }
}

/* ---------------------------------------------------------
   6. BOTONES RESPONSIVE
   --------------------------------------------------------- */

@media (max-width: 575.98px) {
    .btn-iduvi-full-mobile {
        width: 100%;
        display: block;
    }
}

/* ---------------------------------------------------------
   7. TIPOGRAFÍA RESPONSIVE
   --------------------------------------------------------- */

@media (max-width: 575.98px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.1rem; }
}

/* ---------------------------------------------------------
   8. UTILIDADES RESPONSIVE
   --------------------------------------------------------- */

.hide-mobile  { display: none; }
.show-mobile  { display: block; }

@media (min-width: 768px) {
    .hide-mobile  { display: block; }
    .show-mobile  { display: none; }
}

.iduvi-section { margin-bottom: 2rem; }

@media (max-width: 575.98px) {
    .iduvi-section { margin-bottom: 1.25rem; }
}

/* ---------------------------------------------------------
   9. LOGIN RESPONSIVE
   --------------------------------------------------------- */

.lp-title-compact { display: none; }

@media (max-width: 991.98px) {
    .login-page {
        flex-direction: column;
        min-height: 100vh;
    }

    .lp-panel-left {
        width: 100%;
        min-height: unset;
        height: 120px;
        padding: 0 24px;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 16px;
        position: static;
        background: linear-gradient(90deg, #007a3a 0%, #009045 60%, #96bd26 100%);
    }

    .lp-panel-left .lp-welcome,
    .lp-panel-left .lp-footer-brand,
    .lp-panel-left .lp-links {
        display: none;
    }

    .lp-logo { height: 42px; display: block; }

    .lp-panel-left .lp-title-compact {
        display: block;
        color: #fff;
        font-size: 0.95rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        line-height: 1.3;
        margin: 0;
    }

    .lp-panel-right {
        flex: 1;
        padding: 28px 20px;
        align-items: flex-start;
    }

    .lp-form-wrapper { max-width: 100%; }
    .lp-form-title { font-size: 1.35rem; }
}

@media (max-width: 575.98px) {
    .lp-panel-left {
        height: 90px;
        padding: 0 16px;
        gap: 12px;
    }

    .lp-logo { height: 34px; }

    .lp-panel-left .lp-title-compact { font-size: 0.82rem; }

    .lp-panel-right { padding: 20px 14px; }
}

@media (min-width: 1400px) {
    .lp-panel-left {
        width: 35%;
        padding: 56px 52px;
    }
}
