/* --- HERO AGENDAMIENTO: ESTILO APPLE LIQUID GLASS --- */

.ps-hero-agendamiento {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 150px 20px 60px 20px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Contenedor del Background (Three.js) */
.ps-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.ps-hero-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    z-index: 2;
    text-align: center;
}

/* --- TIPOGRAFÍA --- */

.ps-hero-title {

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    /* Aumentamos el tamaño base y el máximo */
    font-size: clamp(3.2rem, 10vw, 7.5rem);

    /* Peso máximo disponible en sistemas Apple (Black) */
    font-weight: 900;

    /* Reducimos el interlineado para que el bloque de texto se vea macizo */
    line-height: 0.95;

    color: #003366;

    /* Tracking más cerrado para tipografía extra gruesa */
    letter-spacing: -0.06em;

    margin-bottom: 50px;
    opacity: 0;
    transform: translateY(30px);

    /* Suavizado de fuente para que el grosor no se vea pixelado */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.ps-hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 500;
    color: rgba(0, 51, 102, 0.8);
    margin-top: 50px;
    opacity: 0;
}

/* --- GRID DE CARDS --- */

.ps-steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-top: 20px;
}

.ps-step-card {
    opacity: 0;
    transform: translateY(40px);
    transition: transform 0.4s cubic-bezier(0.2, 0, 0.2, 1);
}

.ps-card-glass {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 40px 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

/* Efecto Hover Apple-ish */
.ps-step-card:hover {
    transform: translateY(-10px) scale(1.02);
}

.ps-card-glass:hover {
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.ps-step-number {
    font-size: 0.9rem;
    font-weight: 700;
    background: #003366;
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 20px;
}

.ps-step-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #003366;
    margin-bottom: 15px;
    letter-spacing: -0.02em;
}

.ps-step-description {
    font-size: 1rem;
    line-height: 1.5;
    color: #334e68;
    margin: 0;
}

/* --- RESPONSIVE (MÓVIL) --- */

@media (max-width: 992px) {
    .ps-steps-grid {
        grid-template-columns: 1fr;
        /* Stack vertical */
        gap: 20px;
        padding: 0 10px;
    }

    .mobile-hide {
        display: none;
    }

    .ps-hero-agendamiento {
        padding-top: 150px;
    }

    .ps-card-glass {
        padding: 30px 25px;
    }
}

/* Animación de indicador de scroll sutil */
.ps-scroll-indicator {
    width: 2px;
    height: 40px;
    background: linear-gradient(to bottom, #003366, transparent);
    margin: 30px auto 0;
    border-radius: 2px;
    animation: pulseScroll 2s infinite ease-in-out;
}

@keyframes pulseScroll {
    0% {
        transform: scaleY(0);
        transform-origin: top;
        opacity: 0;
    }

    50% {
        transform: scaleY(1);
        transform-origin: top;
        opacity: 1;
    }

    100% {
        transform: scaleY(0);
        transform-origin: bottom;
        opacity: 0;
    }
}

/* --- FORMULARIO PREVENSALUD: APPLE LIQUID GLASS --- */

.ps-booking-section {
    background: linear-gradient(180deg, #f0f7ff 0%, #ffffff 100%);
    padding: 100px 20px;
    display: flex;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
}

.ps-booking-container {
    max-width: 900px;
    width: 100%;
}

.ps-form-intro {
    text-align: center;
    margin-bottom: 50px;
}

.ps-form-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #003366;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
}

.ps-form-subtitle {
    font-size: 1.1rem;
    color: #636e72;
}

/* --- ESTILO GLASSMORPHISM --- */

.ps-glass-form {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: 50px;
    box-shadow: 0 20px 40px rgba(0, 51, 102, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.ps-form-group-wrapper {
    margin-bottom: 40px;
}

.ps-group-label {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #00509e;
    /* Contraste WCAG AA 7.2:1 respecto al fondo blanco */
    letter-spacing: 0.1em;
    margin-bottom: 25px;
    display: block;
}

.ps-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

/* --- INPUTS CON FLOATING LABELS TIPO APPLE --- */

.ps-input-field {
    position: relative;
    width: 100%;
}

.ps-input-field.full-width {
    grid-column: 1 / -1;
    margin-top: 10px;
}

form#ps-booking-form .ps-input-field input[type="text"],
form#ps-booking-form .ps-input-field input[type="email"],
form#ps-booking-form .ps-input-field input[type="tel"],
form#ps-booking-form .ps-input-field input[type="date"],
form#ps-booking-form .ps-input-field select,
form#ps-booking-form .ps-input-field textarea {
    width: 100% !important;
    padding: 18px 20px !important;
    font-size: 1rem !important;
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid rgba(0, 51, 102, 0.25) !important;
    border-radius: 14px !important;
    color: #001f3f !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    outline: 2px solid transparent !important;
    /* Práctica de accesibilidad WCAG */
    box-shadow: none !important;
    box-sizing: border-box !important;
}

.ps-input-field label.ps-checkbox-label {
    top: auto;
}

.ps-input-field label {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #475569;
    /* Slate 600, Ratio > 4.5:1 (Pasa AA) */
    font-weight: 500;
    pointer-events: none;
    transition: all 0.3s ease;
    font-size: 1rem;
}

/* Animación del Label al hacer focus o tener texto */
.ps-input-field input:focus~label,
.ps-input-field input:not(:placeholder-shown)~label,
.ps-input-field select:focus~label,
.ps-input-field select:not([value=""]):valid~label,
.ps-input-field textarea:focus~label,
.ps-input-field textarea:not(:placeholder-shown)~label {
    top: -12px;
    left: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #003366;
    background: #fff;
    padding: 0 8px;
    border-radius: 4px;
}

form#ps-booking-form .ps-input-field input:focus,
form#ps-booking-form .ps-input-field select:focus,
form#ps-booking-form .ps-input-field textarea:focus {
    background: #ffffff !important;
    border-color: #00509e !important;
    /* Feedback visual claro en Active */
    box-shadow: 0 0 0 4px rgba(0, 80, 158, 0.2) !important;
}

/* --- ESTADOS DE ERROR Y VALIDACIÓN --- */

.ps-input-error input,
.ps-input-error select,
.ps-input-error textarea {
    border-color: #d32f2f !important;
    background: rgba(253, 242, 242, 0.85) !important;
}

.ps-input-error input:focus,
.ps-input-error select:focus,
.ps-input-error textarea:focus {
    box-shadow: 0 0 0 4px rgba(211, 47, 47, 0.2) !important;
}

.ps-input-error label {
    color: #d32f2f !important;
}

.ps-error-msg {
    display: none;
    color: #d32f2f;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 6px;
    padding-left: 12px;
}

.ps-input-error .ps-error-msg {
    display: block;
    animation: fadeInError 0.3s ease forwards;
}

@keyframes fadeInError {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- AVISO LEGAL Y CHECKBOX --- */

.ps-legal-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 30px 0 20px;
    text-align: left;
}

.ps-legal-check input[type="checkbox"] {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    padding: 0 !important;
    margin-top: 2px !important;
    accent-color: #00509e;
    cursor: pointer;
    box-shadow: none !important;
    outline: none !important;
}

.ps-legal-check .ps-checkbox-label {
    position: static !important;
    transform: none !important;
    pointer-events: auto !important;
    font-size: 0.95rem !important;
    color: #475569 !important;
    line-height: 1.5;
    cursor: pointer;
    font-weight: 400 !important;
}

.ps-legal-check a {
    color: #00509e;
    font-weight: 600;
    text-decoration: underline;
}

.ps-legal-check.ps-input-error .ps-checkbox-label {
    color: #d32f2f !important;
}

/* --- BOTONES --- */

.ps-form-actions {
    text-align: center;
    margin-top: 20px;
}

.ps-btn-primary {
    background: #003366;
    color: #fff;
    padding: 20px 50px;
    border-radius: 18px;
    border: none;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s transform ease;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.ps-btn-primary:hover {
    transform: scale(1.03);
    background: #004080;
    box-shadow: 0 10px 25px rgba(0, 51, 102, 0.2);
}

.ps-btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 51, 102, 0.3);
}

/* --- MODAL DE ÉXITO (GLASS) --- */

.ps-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    display: none;
    /* Controlado por JS */
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.ps-modal-content {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(25px);
    border-radius: 30px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    /* Animacion CSS removida para evitar conflictos con GSAP */
}

.ps-code-container {
    background: #f1f5f9;
    padding: 20px;
    border-radius: 20px;
    margin: 25px 0;
    border: 1px dashed #8abbf0;
}

.ps-code-value {
    font-size: 2rem;
    font-weight: 900;
    color: #003366;
    letter-spacing: 2px;
}

.ps-recommendations {
    text-align: left;
    list-style: none;
    padding: 0;
    margin: 20px 0;
    font-size: 0.9rem;
}

/* --- RESPONSIVE --- */

@media (max-width: 768px) {
    .ps-form-grid {
        grid-template-columns: 1fr;
    }

    .ps-glass-form {
        padding: 30px 20px;
    }

    .ps-form-title {
        font-size: 1.8rem;
    }
}

/* =============================================================
   SECCIÓN UBICACIÓN: GOOGLE MAPS APPLE STYLE (FULL CARD)
   ============================================================= */

.ps-location-section {
    background-color: #ffffff;
    padding: 80px 20px 120px 20px;
    display: flex;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
}

.ps-location-container {
    max-width: 1100px;
    width: 100%;
}

/* Cabecera Estética */
.ps-location-header {
    text-align: center;
    margin-bottom: 60px;
}

.ps-location-tag {
    background: rgba(138, 187, 240, 0.15);
    color: #003366;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ps-location-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 850;
    color: #003366;
    letter-spacing: -0.04em;
    margin: 20px 0 10px;
}

.ps-location-address {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #636e72;
    font-size: 1.1rem;
}

.ps-location-address svg {
    color: #8abbf0;
}

/* --- CONTENEDOR DE MAPA (ESTILO CARD TOTAL) --- */

.ps-map-wrapper {
    position: relative;
    width: 100%;
    height: 600px;
    /* Altura de la card total */
    border-radius: 40px;
    /* Curvatura Apple */
    background: #f0f0f0;
    border: 1px solid rgba(0, 51, 102, 0.05);
    box-shadow: 0 40px 100px rgba(0, 51, 102, 0.1);
    overflow: hidden;
    /* Crucial para que el mapa tome la forma de la card */
}

.ps-map-glass-card {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
}

.ps-map-branch {
    width: 100%;
    height: 100%;
}

.ps-map-render,
.ps-map-render iframe {
    width: 100% !important;
    height: 100% !important;
    border: none;
    display: block;
    filter: grayscale(0.1) contrast(1.05);
}

/* --- OVERLAY DE INFORMACIÓN FLOTANTE (iOS STYLE) --- */

.ps-map-info-overlay {
    position: absolute;
    bottom: 40px;
    left: 40px;
    z-index: 10;
    max-width: 320px;
    pointer-events: none;
    /* Permite interactuar con el mapa detrás si es necesario */
}

.ps-overlay-content {
    pointer-events: auto;
    /* Reactiva interacción para botones */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    padding: 30px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.ps-overlay-content h4 {
    margin: 0 0 10px 0;
    color: #003366;
    font-size: 1.2rem;
    font-weight: 700;
}

.ps-overlay-content p {
    margin: 4px 0;
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.5;
}

.ps-btn-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    color: #003366;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.ps-btn-link:hover {
    transform: translateX(5px);
}

/* --- RESPONSIVE MÓVIL --- */

@media (max-width: 768px) {
    .ps-location-section {
        padding: 60px 15px;
    }

    .ps-map-wrapper {
        height: 500px;
        border-radius: 30px;
    }

    .ps-map-info-overlay {
        bottom: 20px;
        left: 20px;
        right: 20px;
        max-width: none;
    }

    .ps-overlay-content {
        padding: 20px;
        border-radius: 24px;
    }
}

/* =============================================================
   DIVISOR DE FORMA SIMPLE (AZUL PREVENSALUD)
   ============================================================= */

.ps-divider-azul {
    width: 100%;
    height: 80px;
    /* Altura de la franja, ajústala a tu gusto */
    background-color: #003366;
    /* Tu azul corporativo */
    position: relative;
    z-index: 5;
    border: none;

    /* Si quieres que se adapte en móviles */
}

@media (max-width: 768px) {
    .ps-divider-azul {
        height: 50px;
        /* Un poco más delgada en celulares */
    }
}