/* ============================================================
   Portal de autogestión de la librería — [libreria_portal]
   ============================================================

   Misma estética que el formulario de alta (`librerias-form.css`): mismo azul,
   mismo borde crema, mismos radios y tipografías. No es un sistema nuevo.

   Por qué se repiten las reglas de los campos en vez de reusar las de allá: el
   CSS del alta scopea TODO bajo `.pl-librerias-postular`, y ese selector le gana
   por especificidad a cualquier cosa más corta (está documentado ahí mismo, con
   el caso del checkbox estirado al 100%). Colgarse de esas reglas obligaría a
   meter el markup del portal dentro de `.pl-librerias-postular`, que es la clase
   del CTA de postulación y no tiene nada que ver acá.
   ============================================================ */

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

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

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

/* ---------- Encabezado ---------- */

.pl-librerias-portal-head {
    margin-bottom: 8px;
}

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

/* El tema (besa) define `.elementor-kit-9 h2` con una especificidad que pisa
   una clase sola: por eso el título va con la doble clase del wrapper. */
.pl-librerias-portal .pl-librerias-portal-title {
    margin: 0 0 6px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 30px;
    line-height: 1.2;
    color: #111827;
    font-weight: normal;
}

.pl-librerias-portal .pl-librerias-portal-domicilio {
    margin: 0 0 14px;
    font-size: 14px;
    color: #6b7280;
}

.pl-librerias-portal .pl-librerias-portal-lead {
    margin: 0 0 10px;
    color: #4b5563;
    font-size: 15px;
    line-height: 1.65;
}

.pl-librerias-portal .pl-librerias-portal-lead a {
    color: #1d4ed8;
    text-decoration: underline;
}

.pl-librerias-portal .pl-librerias-portal-aviso {
    margin: 0 0 10px;
    padding: 12px 14px;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    font-size: 14.5px;
    line-height: 1.55;
}

/* Misma paleta que .pl-librerias-form-status.is-success, para el banner de
   bienvenida tras elegir contraseña nueva. */
.pl-librerias-portal .pl-librerias-portal-aviso--success {
    background: #f0fdf4;
    color: #166534;
    border-color: #86efac;
}

/* ---------- Pantallas sin acceso ---------- */

.pl-librerias-portal-acciones {
    margin: 20px 0 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pl-librerias-portal .pl-librerias-portal-btn {
    display: inline-block;
    background: #1d4ed8;
    color: #fff;
    border-radius: 6px;
    padding: 0.7rem 1.5rem;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(29, 78, 216, 0.2);
    transition: background 0.15s ease, transform 0.15s ease;
}

.pl-librerias-portal .pl-librerias-portal-btn:hover {
    background: #1e40af;
    transform: translateY(-1px);
    color: #fff;
}

.pl-librerias-portal .pl-librerias-portal-btn--suave {
    background: #ffffff;
    color: #1d4ed8;
    border: 1.5px solid #d1d5db;
    box-shadow: none;
}

.pl-librerias-portal .pl-librerias-portal-btn--suave:hover {
    background: #eff6ff;
    color: #1e3a8a;
    border-color: #1d4ed8;
}

/* ---------- Formulario ---------- */

.pl-librerias-portal .pl-librerias-form {
    margin-top: 18px;
    padding-top: 22px;
    border-top: 1px solid #f0ece2;
}

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

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

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

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

.pl-librerias-portal .pl-librerias-field input,
.pl-librerias-portal .pl-librerias-field select,
.pl-librerias-portal .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-portal .pl-librerias-field input:focus,
.pl-librerias-portal .pl-librerias-field select:focus,
.pl-librerias-portal .pl-librerias-field textarea:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

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

.pl-librerias-portal .pl-librerias-field-hint {
    margin-top: 6px;
    font-size: 12.5px;
    line-height: 1.5;
    color: #6b7280;
}

/* El aviso del WhatsApp NO es letra chica decorativa: es la diferencia entre un
   botón que abre un chat y uno que abre un número que no existe. */
.pl-librerias-portal .pl-librerias-field-hint--fuerte {
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 8px 10px;
}

.pl-librerias-portal .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-portal .pl-librerias-portal-readonly {
    margin: 0;
    padding: 0.6rem 0.75rem;
    background: #f8f6f0;
    border: 1px solid #e8e3d6;
    border-radius: 6px;
    font-size: 15px;
    color: #374151;
}

.pl-librerias-portal .pl-librerias-portal-nota {
    margin: 4px 0 0;
    padding-top: 14px;
    border-top: 1px solid #f0ece2;
    font-size: 13.5px;
    line-height: 1.6;
    color: #6b7280;
}

.pl-librerias-portal .pl-librerias-portal-cache {
    margin: 14px 0 0;
    font-size: 13px;
    line-height: 1.6;
    color: #6b7280;
}

/* ---------- Radios ---------- */

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

.pl-librerias-portal .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-portal .pl-librerias-radio-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pl-librerias-portal .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;
    margin-bottom: 0;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

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

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

.pl-librerias-portal .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-portal .pl-librerias-radio-pill:has(input:focus-visible) {
    outline: none;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.3);
}

/* Checkbox suelto (opt-in al ciclo, declaración de titularidad): mismo look
   que el radio-pill, sin el layout de grupo. */
.pl-librerias-portal .pl-librerias-checkbox-pill {
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: 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-portal .pl-librerias-checkbox-pill input[type="checkbox"] {
    width: auto;
}

.pl-librerias-portal .pl-librerias-checkbox-pill:hover {
    border-color: #9ca3af;
}

.pl-librerias-portal .pl-librerias-checkbox-pill:has(input:checked) {
    border-color: #1d4ed8;
    background: #eff6ff;
    color: #1e3a8a;
}

.pl-librerias-portal .pl-librerias-ciclo-extra {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

/* ---------- Acciones y estado ---------- */

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

.pl-librerias-portal .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-portal .pl-librerias-submit:hover:not(:disabled) {
    background: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.28);
}

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

.pl-librerias-portal .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-portal .pl-librerias-form-status.is-error {
    display: block;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

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

/* ---------- Mobile ---------- */

@media (max-width: 640px) {
    .pl-librerias-portal-card {
        padding: 28px 22px 24px;
    }
    .pl-librerias-portal .pl-librerias-portal-title {
        font-size: 25px;
    }
    .pl-librerias-portal .pl-librerias-form-grid {
        grid-template-columns: 1fr;
    }
    .pl-librerias-portal .pl-librerias-form-actions {
        justify-content: stretch;
    }
    .pl-librerias-portal .pl-librerias-submit {
        width: 100%;
    }
    .pl-librerias-portal-acciones {
        flex-direction: column;
    }
    .pl-librerias-portal .pl-librerias-portal-btn {
        text-align: center;
    }
}

/* ---------- Login del portal (fase 2) ---------- */

.pl-librerias-portal .pl-librerias-portal-login {
    margin-top: 22px;
    text-align: left;
    max-width: 420px;
}

.pl-librerias-portal .pl-librerias-portal-login-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
}

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

.pl-librerias-portal .pl-librerias-portal-login-field input {
    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-portal .pl-librerias-portal-login-field input:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.pl-librerias-portal .pl-librerias-portal-login-error {
    margin: 0 0 16px;
    padding: 0.7rem 0.9rem;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    font-size: 14.5px;
    line-height: 1.5;
}

.pl-librerias-portal .pl-librerias-portal-login-captcha {
    margin: 4px 0 14px;
}

.pl-librerias-portal .pl-librerias-portal-login-remember {
    margin-bottom: 16px;
}

.pl-librerias-portal .pl-librerias-portal-login-remember label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: #4b5563;
    cursor: pointer;
}

.pl-librerias-portal .pl-librerias-portal-login-remember input {
    margin: 0;
}

.pl-librerias-portal .pl-librerias-portal-login-actions .pl-librerias-portal-btn {
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

.pl-librerias-portal .pl-librerias-portal-login-ayuda {
    margin: 16px 0 0;
    font-size: 13.5px;
    color: #6b7280;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pl-librerias-portal .pl-librerias-portal-login-ayuda a {
    color: #1d4ed8;
    text-decoration: underline;
}

/* ---------- Reset de contraseña (fase 2) ---------- */

/* El bloque de ayuda del login es un flex de links cortos. Acá abajo es una
   frase entera: en flex, cada palabra sería un ítem y el `gap` la partiría. */
.pl-librerias-portal--reset .pl-librerias-portal-login-ayuda {
    display: block;
    line-height: 1.5;
}

/* El campo de usuario existe sólo para los gestores de contraseñas. `hidden`
   solo pierde contra el `display` que el tema le pone a los input del portal. */
.pl-librerias-portal--reset input[hidden] {
    display: none !important;
}

/* El honeypot no se ve, no se tabula y no lo lee el lector de pantalla. */
.pl-librerias-portal .pl-librerias-honeypot {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

@media (max-width: 640px) {
    .pl-librerias-portal .pl-librerias-portal-login {
        max-width: none;
    }
    .pl-librerias-portal .pl-librerias-portal-login-actions .pl-librerias-portal-btn {
        width: 100%;
    }
}
