/* ============================================================
   Modificadores cuando el form convive con el mapa
   ============================================================
   Funcionan tanto si la clase está combinada con .pl-librerias-postular
   (vía atributo del shortcode: [librerias_form_alta class="pl-librerias-before-map"])
   como si está en un <div> wrapper externo.
*/

/* Form ARRIBA del mapa: separador visual debajo del card */
.pl-librerias-before-map {
    position: relative;
    margin-bottom: 56px;
    padding-bottom: 48px;
    border-bottom: 1px solid #e8e3d6;
}
.pl-librerias-before-map::after {
    content: "";
    display: block;
    width: 56px;
    height: 3px;
    background: #1d4ed8;
    margin: 28px auto 0;
    border-radius: 2px;
}

/* Form DEBAJO del mapa: separador visual arriba del card */
.pl-librerias-after-map {
    position: relative;
    margin-top: 64px;
    padding-top: 48px;
    border-top: 1px solid #e8e3d6;
}
.pl-librerias-after-map::before {
    content: "";
    display: block;
    width: 56px;
    height: 3px;
    background: #1d4ed8;
    margin: 0 auto 28px;
    border-radius: 2px;
}

@media (max-width: 640px) {
    .pl-librerias-before-map {
        margin-bottom: 36px;
        padding-bottom: 32px;
    }
    .pl-librerias-before-map::after {
        margin-top: 22px;
    }
    .pl-librerias-after-map {
        margin-top: 44px;
        padding-top: 32px;
    }
    .pl-librerias-after-map::before {
        margin-bottom: 22px;
    }
}

/* ============================================================
   Postular librería — wrapper principal
   ============================================================ */

.pl-librerias-postular {
    max-width: 760px;
    margin: 0 auto;
    color: inherit;
}

.pl-librerias-postular-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #e8e3d6;
    border-radius: 8px;
    padding: 36px 36px 32px;
    overflow: hidden;
}

.pl-librerias-postular-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #1d4ed8;
}

.pl-librerias-postular-intro {
    text-align: center;
    margin-bottom: 24px;
}

.pl-librerias-postular-eyebrow {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #1d4ed8;
    font-weight: 600;
    margin-bottom: 12px;
}

.pl-librerias-postular-title {
    margin: 0 0 12px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 32px;
    line-height: 1.2;
    color: #111827;
    font-weight: normal;
}

.pl-librerias-postular-lead {
    margin: 0 auto;
    max-width: 540px;
    color: #4b5563;
    font-size: 15px;
    line-height: 1.65;
}

/* ============================================================
   Toggle <details>/<summary> — CTA colapsable
   ============================================================ */

.pl-librerias-postular-toggle {
    margin-top: 4px;
}

.pl-librerias-postular-toggle > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 28px;
    background: #1f2937;
    color: #ffffff;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.2px;
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 4px 14px rgba(31, 41, 55, 0.18);
    user-select: none;
}

/* Hide default disclosure triangle in WebKit/Chromium */
.pl-librerias-postular-toggle > summary::-webkit-details-marker {
    display: none;
}

.pl-librerias-postular-toggle > summary:hover {
    background: #111827;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(31, 41, 55, 0.22);
}

.pl-librerias-postular-toggle > summary:focus-visible {
    outline: 3px solid rgba(29, 78, 216, 0.45);
    outline-offset: 3px;
}

.pl-librerias-postular-cta-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: #ffffff;
    transition: transform 0.25s ease;
}

.pl-librerias-postular-toggle[open] > summary {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    box-shadow: none;
    padding: 14px 28px;
}

.pl-librerias-postular-toggle[open] > summary:hover {
    background: #f9fafb;
    transform: none;
}

.pl-librerias-postular-toggle[open] .pl-librerias-postular-cta-arrow {
    transform: rotate(180deg);
    color: #6b7280;
}

/* Swap label text when open via data-attrs */
.pl-librerias-postular-toggle[open] .pl-librerias-postular-cta-label {
    font-size: 0;
}
.pl-librerias-postular-toggle[open] .pl-librerias-postular-cta-label::before {
    content: attr(data-open);
    font-size: 16px;
}
.pl-librerias-postular-toggle:not([open]) .pl-librerias-postular-cta-label {
    font-size: 0;
}
.pl-librerias-postular-toggle:not([open]) .pl-librerias-postular-cta-label::before {
    content: attr(data-closed);
    font-size: 16px;
}

/* Animación al abrir */
.pl-librerias-postular-toggle[open] .pl-librerias-form {
    animation: pl-librerias-slide-down 0.32s ease-out;
}

@keyframes pl-librerias-slide-down {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   Formulario (campos)
   ============================================================ */

.pl-librerias-postular .pl-librerias-form {
    margin-top: 20px;
    padding-top: 24px;
    border-top: 1px solid #f0ece2;
}

.pl-librerias-postular .pl-librerias-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
}

.pl-librerias-postular .pl-librerias-field {
    display: flex;
    flex-direction: column;
}

.pl-librerias-postular .pl-librerias-field-full {
    grid-column: 1 / -1;
}

.pl-librerias-postular .pl-librerias-field label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #1f2937;
    letter-spacing: 0.1px;
}

.pl-librerias-postular .pl-librerias-field input,
.pl-librerias-postular .pl-librerias-field select,
.pl-librerias-postular .pl-librerias-field textarea {
    padding: 0.6rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    color: #1f2937;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pl-librerias-postular .pl-librerias-field input:focus,
.pl-librerias-postular .pl-librerias-field select:focus,
.pl-librerias-postular .pl-librerias-field textarea:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.pl-librerias-postular .pl-librerias-field textarea {
    resize: vertical;
    min-height: 84px;
}

.pl-librerias-postular .pl-librerias-required {
    color: #b91c1c;
    margin-left: 2px;
}

.pl-librerias-postular .pl-librerias-section-title {
    margin: 8px 0 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    color: #1f2937;
    font-weight: normal;
    border-top: 1px solid #f0ece2;
    padding-top: 16px;
}

.pl-librerias-postular .pl-librerias-field-radio {
    border: none;
    padding: 0;
    margin: 0;
}

.pl-librerias-postular .pl-librerias-field-radio legend {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 8px;
    color: #1f2937;
    letter-spacing: 0.1px;
    padding: 0;
}

.pl-librerias-postular .pl-librerias-radio-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pl-librerias-postular .pl-librerias-radio-pill {
    flex: 1 1 auto;
    min-width: 0;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    font-size: 14.5px;
    font-weight: 500;
    color: #374151;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.pl-librerias-postular .pl-librerias-radio-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pl-librerias-postular .pl-librerias-radio-pill:hover {
    border-color: #9ca3af;
}

.pl-librerias-postular .pl-librerias-radio-pill:has(input:checked) {
    border-color: #1d4ed8;
    background: #eff6ff;
    color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.pl-librerias-postular .pl-librerias-radio-pill:has(input:focus-visible) {
    outline: none;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.3);
}

.pl-librerias-postular .pl-librerias-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.pl-librerias-postular .pl-librerias-form-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.pl-librerias-postular .pl-librerias-submit {
    background: #1d4ed8;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.8rem 2rem;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 2px 8px rgba(29, 78, 216, 0.2);
}

.pl-librerias-postular .pl-librerias-submit:hover:not(:disabled) {
    background: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.28);
}

.pl-librerias-postular .pl-librerias-submit:disabled {
    opacity: 0.55;
    cursor: progress;
    transform: none;
    box-shadow: none;
}

.pl-librerias-postular .pl-librerias-form-status {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 6px;
    font-size: 14.5px;
    line-height: 1.5;
    display: none;
}

.pl-librerias-postular .pl-librerias-form-status.is-error {
    display: block;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.pl-librerias-postular .pl-librerias-form-status.is-success {
    display: block;
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #86efac;
}

.pl-librerias-postular .pl-librerias-form-closed {
    margin-top: 8px;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
}

/* ============================================================
   Mobile
   ============================================================ */

@media (max-width: 640px) {
    .pl-librerias-postular-card {
        padding: 28px 22px 24px;
    }
    .pl-librerias-postular-title {
        font-size: 26px;
    }
    .pl-librerias-postular-lead {
        font-size: 14.5px;
    }
    .pl-librerias-postular .pl-librerias-form-grid {
        grid-template-columns: 1fr;
    }
    .pl-librerias-postular .pl-librerias-form-actions {
        justify-content: stretch;
    }
    .pl-librerias-postular .pl-librerias-submit {
        width: 100%;
    }
}
