/* ============================================================
   COLFARMA — Hoja de estilos general del sitio
   Colores oficiales del manual de marca:
   Verde:       #4CA845 (RGB 76/168/69)
   Azul oscuro: #1E2D4C (RGB 30/45/76)
   ============================================================ */

:root {
    --colfarma-azul: #1E2D4C;
    --colfarma-azul-hover: #3A4A6C;
    --colfarma-verde: #4CA845;
    --colfarma-verde-hover: #3d8c37;
}

/* Reset general para permitir layouts full-bleed dentro del _Layout compartido */
*, *::before, *::after {
    box-sizing: border-box;
}
html, body {
    margin: 0;
    padding: 0;
    background: #f5f5f5;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}
.container-fluid {
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
}
main.row {
    margin-left: 0;
    margin-right: 0;
}
main.row > *:not(.login-container) {
    padding-right: 0;
    padding-left: 0;
}

/* ---------- Navbar ---------- */
.navbar-colfarma {
    background: var(--colfarma-azul);
    padding: 5px 0;
    height: 90px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    z-index: 100;
}
.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between !important;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}
.navbar-year {
    color: white;
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0;
}
.navbar-year img {
    max-height: 70px;
}

.navbar-actions {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    flex-shrink: 0;
    flex-wrap: nowrap;
}
.navbar-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    text-decoration: none;
    color: #fff;
    text-align: center;
    width: 68px;
}
.navbar-action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 41px;
    height: 41px;
    border-radius: 50%;
    border: 2px solid var(--colfarma-verde);
    color: #fff;
    transition: background 0.2s ease;
}
.navbar-action-icon svg {
    width: 20px;
    height: 20px;
}
.navbar-action-label {
    font-size: 10px;
    font-weight: 600;
    line-height: 1.15;
    text-transform: uppercase;
}
.navbar-action-btn:hover .navbar-action-icon {
    background: var(--colfarma-verde);
}

/* ---------- Panel de login (glass) ----------
   El wrapper es un flex en el flujo normal del documento (no fixed):
   se acomoda solo debajo del navbar y, si el contenido no entra en
   la altura visible, la página hace scroll normal en vez de recortar
   o desbordar el panel. */
.login-container {
    position: relative;
    z-index: 50;
    width: 100%;
    min-width: 0;
    min-height: calc(100vh - 90px);
    margin-top: 90px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 24px 5cm 24px 24px;
    box-sizing: border-box;
}
.login-container-center {
    justify-content: center;
}
.login-container > form {
    flex: 0 1 500px;
    width: 100%;
    max-width: 500px;
    min-width: 0;
    /* Bootstrap le pone márgenes negativos a .row; los anulamos para que
       la separación del borde sea exactamente la del padding del wrapper. */
    margin-left: 0;
    margin-right: 0;
}
#divMain {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(15px);
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 100% !important;
    max-width: 100% !important; /* neutraliza los max-width (48%/58%/650px) heredados de style.css */
    padding: clamp(16px, 3.5vh, 30px) clamp(16px, 3vw, 30px);
    position: relative;
    z-index: 50;
}
#divMain .col-12.py-3,
#divMain .col-12.py-3.px-5,
#divMain .col-12.py-3.text-center {
    padding-top: clamp(6px, 1.5vh, 1rem) !important;
    padding-bottom: clamp(6px, 1.5vh, 1rem) !important;
    padding-left: clamp(4px, 2vw, 3rem) !important;
    padding-right: clamp(4px, 2vw, 3rem) !important;
}
#divMain .form-floating > .form-control,
#divMain .form-floating > label {
    height: clamp(46px, 6.5vh, 58px);
    min-height: clamp(46px, 6.5vh, 58px);
}
#divMain .form-control:focus {
    border-color: var(--colfarma-azul) !important;
    box-shadow: 0 0 0 0.2rem rgba(30, 45, 76, 0.25) !important;
}

/* ---------- Botones principales (Aceptar / Cambiar Contraseña) ---------- */
.btn-colfarma-accept {
    background: var(--colfarma-azul);
    border: 1px solid var(--colfarma-azul);
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.3px;
    border-radius: 8px;
    padding: 10px 28px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-colfarma-accept:hover, .btn-colfarma-accept:focus {
    background: var(--colfarma-azul-hover);
    border-color: var(--colfarma-azul-hover);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(30, 45, 76, 0.45);
}
.btn-colfarma-outline {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #fff;
    font-weight: 600;
    border-radius: 8px;
    padding: 10px 22px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-colfarma-outline:hover, .btn-colfarma-outline:focus {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

img.form-header {
    max-height: clamp(50px, 14vh, 140px) !important;
    max-width: 100% !important;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* ---------- Accesos rápidos (Convenios, Residente, Adobe, TeamViewer, Pago de Cuotas) ---------- */
.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(6px, 1.2vh, 10px);
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}
.quick-link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    border-radius: 8px;
    padding: clamp(6px, 1.4vh, 12px) 8px;
    font-size: clamp(10.5px, 1.6vh, 12.5px);
    font-weight: 600;
    line-height: 1.3;
    min-height: clamp(36px, 6vh, 52px);
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}
.quick-link-btn:hover, .quick-link-btn:focus {
    background: var(--colfarma-azul);
    border-color: var(--colfarma-azul);
    color: #fff;
    transform: translateY(-2px);
}
.quick-link-btn.full-width {
    grid-column: 1 / -1;
}

/* ---------- Fondo estático (páginas sin carousel) ---------- */
.static-page-bg {
    position: fixed;
    top: 90px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    background: linear-gradient(135deg, var(--colfarma-azul) 0%, var(--colfarma-azul-hover) 100%);
}
@media (max-width: 768px) {
    .static-page-bg {
        top: 66px;
    }
}

/* ---------- Carousel de fondo ---------- */
.carousel-section {
    position: fixed;
    top: 90px;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: auto;
    z-index: 1;
    overflow: hidden;
    margin: 0;
}
.carousel-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}
.carousel-item {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}
.carousel-item.active {
    opacity: 1;
}
.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}
.carousel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2;
    pointer-events: none;
}
.carousel-item-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    z-index: 3;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent);
}
.carousel-item-btn {
    background: var(--colfarma-azul);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}
.carousel-item-btn:hover {
    background: var(--colfarma-azul-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(30, 45, 76, 0.5);
}
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 20px;
    z-index: 10;
    transition: background 0.3s;
}
.carousel-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}
.carousel-nav.prev {
    left: 20px;
}
.carousel-nav.next {
    right: 20px;
}
.carousel-controls {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}
.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s;
    border: 2px solid white;
}
.carousel-dot.active {
    background: white;
}

/* ---------- Botón flotante WhatsApp ---------- */
.whatsapp-float {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    z-index: 200;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.whatsapp-float svg {
    width: 30px;
    height: 30px;
}
.whatsapp-float:hover {
    color: #fff;
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    .navbar-colfarma {
        height: 66px;
    }
    .carousel-section {
        top: 66px;
        z-index: 1;
    }
    .login-container {
        margin-top: 66px;
        min-height: calc(100vh - 66px);
        justify-content: center;
        padding: 20px 15px;
        z-index: 60;
    }
    .login-container > form {
        max-width: 340px;
    }
    #divMain {
        padding: 14px 12px;
    }
    #divMain .col-12.py-3,
    #divMain .col-12.py-3.px-5,
    #divMain .col-12.py-3.text-center {
        padding-top: 6px !important;
        padding-bottom: 6px !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
    }
    img.form-header {
        max-height: 50px !important;
        max-width: 100% !important;
        width: auto;
        height: auto;
        object-fit: contain;
    }
    .navbar-year img {
        max-height: 46px;
    }
    .navbar-actions {
        gap: 7px;
    }
    .navbar-action-btn {
        width: 40px;
    }
    .navbar-action-icon {
        width: 28px;
        height: 28px;
    }
    .navbar-action-icon svg {
        width: 14px;
        height: 14px;
    }
    .navbar-action-label {
        font-size: 6.5px;
    }
    .carousel-nav {
        padding: 8px 12px;
        font-size: 15px;
    }
    /* El botón de cada foto del carousel (fondo fijo) queda flotando suelto y superpuesto
       con el panel de login en mobile, ya que el carousel es position:fixed e independiente
       del flujo del documento. Se oculta: el mismo link ya está en la grilla de accesos rápidos. */
    .carousel-item-content {
        display: none;
    }
    .quick-links-grid {
        gap: 6px;
    }
    .quick-link-btn {
        font-size: 10.5px;
        padding: 6px 4px;
        min-height: 36px;
    }
    .btn-colfarma-accept,
    .btn-colfarma-outline {
        padding: 6px 14px;
        font-size: 14px;
    }
    #divMain .form-floating > .form-control,
    #divMain .form-floating > label {
        height: 46px;
        min-height: 46px;
        padding: 0.5rem 0.75rem;
        font-size: 14px;
    }
    #divMain .form-floating > label {
        padding: 0.65rem 0.75rem;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 16px 10px;
    }
    .login-container > form {
        max-width: 300px;
    }
    #divMain {
        padding: 12px 10px;
        border-radius: 8px;
    }
    img.form-header {
        max-height: 40px !important;
    }
    .btn-colfarma-accept,
    .btn-colfarma-outline {
        width: 100%;
    }
    .carousel-controls {
        bottom: 20px;
    }
    .carousel-dot {
        width: 9px;
        height: 9px;
    }
    .carousel-nav {
        padding: 8px 12px;
        font-size: 14px;
    }
}
