/* =====================================================================
   estilo.css — leyes.pe Versión Perú
   Paleta y tipografía alineadas al sistema de diseño ya usado en el
   resto de la plataforma (verde institucional, navy, serif clásica).
   ===================================================================== */

:root {
    --verde: #1a5c38;
    --verde-oscuro: #123f27;
    --verde-claro: #e7f0ea;
    --navy: #0f2438;
    --oro: #b8934c;
    --crema: #fdfdfb;
    --texto: #1c1c1c;
    --texto-suave: #5a615c;
    --borde: #d8ddd9;
    --fuente-display: 'EB Garamond', Georgia, serif;
    --fuente-cuerpo: 'Merriweather', Georgia, serif;
    --fuente-ui: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--crema);
    color: var(--texto);
    font-family: var(--fuente-cuerpo);
    line-height: 1.6;
}

/* ---------------------------------------------------------------
   HEADER
   --------------------------------------------------------------- */
.lp-header {
    background: var(--navy);
    padding: 1rem 0;
}
.lp-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.lp-logo { display: flex; flex-direction: column; line-height: 1.1; }
.lp-logo-principal {
    font-family: var(--fuente-display);
    font-size: 1.6rem;
    font-weight: 600;
    color: #fff;
}
.lp-logo-punto { color: var(--oro); }
.lp-logo-secundario {
    font-family: var(--fuente-ui);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--oro);
}
.lp-nav-admin {
    font-family: var(--fuente-ui);
    font-size: 0.85rem;
    color: #cfd8d3;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.25);
    padding: 0.45rem 0.9rem;
    border-radius: 4px;
    transition: all 0.15s ease;
}
.lp-nav-admin:hover { background: rgba(255,255,255,0.08); color: #fff; }

/* ---------------------------------------------------------------
   HERO
   --------------------------------------------------------------- */
.lp-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, var(--navy) 0%, var(--verde-oscuro) 100%);
    color: #f4f4f2;
    padding: 5.5rem 1.5rem 6rem;
    text-align: center;
}
.lp-hero-fondo {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(184,147,76,0.18), transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(26,92,56,0.35), transparent 50%);
    animation: lp-flotar 14s ease-in-out infinite alternate;
}
@keyframes lp-flotar {
    from { transform: translate3d(0,0,0) scale(1); }
    to   { transform: translate3d(-2%, 2%, 0) scale(1.05); }
}
.lp-hero-contenido { position: relative; max-width: 780px; margin: 0 auto; }
.lp-hero-eyebrow {
    font-family: var(--fuente-ui);
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--oro);
    margin-bottom: 1rem;
}
.lp-hero-titulo {
    font-family: var(--fuente-display);
    font-size: clamp(2rem, 4.5vw, 3rem);
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 1.2rem;
}
.lp-hero-subtitulo {
    font-size: 1.05rem;
    color: #dfe4e1;
    max-width: 620px;
    margin: 0 auto 2rem;
}
.lp-hero-cta {
    display: inline-block;
    font-family: var(--fuente-ui);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--navy);
    background: var(--oro);
    padding: 0.85rem 1.8rem;
    border-radius: 4px;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.lp-hero-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(184,147,76,0.35); }

.lp-hero-acciones {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.lp-seleccion-actual {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: .45rem;
    min-width: min(100%, 430px);
    padding: .7rem;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 8px;
    background: rgba(15,36,56,.28);
    text-align: left;
    backdrop-filter: blur(4px);
}
.lp-seleccion-titulo {
    grid-column: 1 / -1;
    font-family: var(--fuente-ui);
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--oro);
}
.lp-seleccion-chip {
    border: 0;
    border-radius: 6px;
    padding: .45rem .55rem;
    background: rgba(255,255,255,.08);
    color: #fff;
    text-align: left;
    cursor: pointer;
    min-width: 0;
}
.lp-seleccion-chip:hover:not(:disabled) { background: rgba(255,255,255,.14); }
.lp-seleccion-chip:disabled { cursor: default; opacity: .55; }
.lp-seleccion-chip small,
.lp-seleccion-chip strong { display: block; }
.lp-seleccion-chip small {
    font-family: var(--fuente-ui);
    font-size: .68rem;
    color: #cfd8d3;
}
.lp-seleccion-chip strong {
    margin-top: .08rem;
    font-family: var(--fuente-ui);
    font-size: .78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------------------------------------------------------------
   WIZARD
   --------------------------------------------------------------- */
.lp-wizard {
    max-width: 780px;
    margin: -2.5rem auto 4rem;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(15,36,56,0.15);
    padding: 2.5rem 2.2rem;
    position: relative;
    z-index: 2;
}

.lp-progreso {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 2.2rem;
    font-family: var(--fuente-ui);
    font-size: 0.8rem;
    color: var(--texto-suave);
}
.lp-progreso-item {
    flex: 1;
    text-align: center;
    position: relative;
    padding-bottom: 0.6rem;
    border-bottom: 3px solid var(--borde);
}
.lp-progreso-item span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--borde);
    color: #fff;
    font-size: 0.75rem;
    margin-right: 0.35rem;
}
.lp-progreso-item.lp-activo,
.lp-progreso-item.lp-completado {
    color: var(--verde);
    border-bottom-color: var(--verde);
}
.lp-progreso-item.lp-activo span,
.lp-progreso-item.lp-completado span { background: var(--verde); }

.lp-progreso-item { cursor: pointer; }
.lp-progreso-item.lp-no-disponible { cursor: default; opacity: .55; }

.lp-ruta-seleccion {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: .55rem;
    align-items: stretch;
    margin: -1.1rem 0 2rem;
    padding: .75rem;
    border: 1px solid var(--borde);
    border-radius: 8px;
    background: #f8faf8;
    font-family: var(--fuente-ui);
}
.lp-ruta-seleccion button {
    border: 1px solid var(--borde);
    border-radius: 6px;
    background: #fff;
    padding: .45rem .6rem;
    text-align: left;
    cursor: pointer;
    min-width: 0;
}
.lp-ruta-seleccion button:hover:not(:disabled) { border-color: var(--verde); }
.lp-ruta-seleccion button:disabled { cursor: default; opacity: .62; }
.lp-ruta-seleccion button span,
.lp-ruta-seleccion button strong { display: block; }
.lp-ruta-seleccion button span {
    font-size: .67rem;
    color: var(--texto-suave);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.lp-ruta-seleccion button strong {
    margin-top: .08rem;
    color: var(--navy);
    font-size: .8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lp-ir-inicio {
    align-self: center;
    padding: .5rem .55rem;
    color: var(--verde);
    text-decoration: none;
    font-weight: 700;
    font-size: .8rem;
    white-space: nowrap;
}
.lp-contexto-informe {
    margin-bottom: 1.35rem;
    padding: .9rem 1rem;
    border: 1px solid rgba(26,92,56,.2);
    border-radius: 8px;
    background: var(--verde-claro);
    font-family: var(--fuente-ui);
}
.lp-contexto-informe strong { color: var(--navy); }
.lp-contexto-informe-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .65rem;
    margin-top: .45rem;
}
.lp-contexto-informe-grid span {
    display: block;
    padding: .45rem .55rem;
    border-radius: 6px;
    background: rgba(255,255,255,.72);
}
.lp-contexto-informe-grid small {
    display: block;
    color: var(--texto-suave);
    text-transform: uppercase;
    font-size: .66rem;
    letter-spacing: .04em;
}
.lp-contexto-informe-grid b {
    display: block;
    margin-top: .08rem;
    color: var(--navy);
    overflow-wrap: anywhere;
}
.lp-btn-volver-informe { margin-bottom: 1.3rem; }

.lp-paso-titulo {
    font-family: var(--fuente-display);
    font-size: 1.5rem;
    color: var(--navy);
    margin: 0 0 1.4rem;
}
.lp-paso-nota {
    font-family: var(--fuente-ui);
    font-size: 0.85rem;
    color: var(--texto-suave);
    margin-top: -0.8rem;
    margin-bottom: 1.2rem;
}
.lp-oculto { display: none !important; }
.lp-cargando { color: var(--texto-suave); font-style: italic; }

.lp-tarjetas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
}
.lp-tarjetas-lista { grid-template-columns: 1fr; }

.lp-tarjeta {
    border: 1.5px solid var(--borde);
    border-radius: 8px;
    padding: 1.1rem 1.2rem;
    cursor: pointer;
    text-align: left;
    background: var(--crema);
    transition: border-color 0.15s ease, transform 0.15s ease;
    font-family: var(--fuente-ui);
}
.lp-tarjeta:hover { border-color: var(--verde); transform: translateY(-2px); }
.lp-tarjeta-nombre { display: block; font-weight: 700; color: var(--navy); margin-bottom: 0.2rem; }
.lp-tarjeta-detalle { display: block; font-size: 0.78rem; color: var(--texto-suave); }

.lp-tarjeta.lp-inactiva {
    cursor: not-allowed;
    opacity: 0.55;
    background: #f4f4f2;
}
.lp-tarjeta.lp-inactiva:hover { transform: none; border-color: var(--borde); }
.lp-badge-proximamente {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--oro);
    border: 1px solid var(--oro);
    border-radius: 3px;
    padding: 0.1rem 0.4rem;
}

.lp-btn-volver {
    margin-top: 1.5rem;
    background: none;
    border: none;
    font-family: var(--fuente-ui);
    font-size: 0.85rem;
    color: var(--texto-suave);
    cursor: pointer;
}
.lp-btn-volver:hover { color: var(--verde); }

/* ---------------------------------------------------------------
   FORMULARIO DE CASO
   --------------------------------------------------------------- */
.lp-form-caso { display: flex; flex-direction: column; gap: 1.1rem; }
.lp-label {
    font-family: var(--fuente-ui);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--navy);
}
.lp-form-caso textarea,
.lp-form-caso input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border: 1.5px solid var(--borde);
    border-radius: 6px;
    font-family: var(--fuente-cuerpo);
    font-size: 0.97rem;
    background: var(--crema);
}
.lp-form-caso textarea:focus {
    outline: none;
    border-color: var(--verde);
    box-shadow: 0 0 0 3px var(--verde-claro);
}
.lp-fuentes {
    border: 1px solid var(--borde);
    border-radius: 6px;
    padding: 0.9rem 1rem;
}
.lp-fuentes legend { padding: 0 0.4rem; }
.lp-radio {
    display: block;
    font-family: var(--fuente-ui);
    font-size: 0.88rem;
    margin-top: 0.4rem;
    color: var(--texto);
}
.lp-radio input { accent-color: var(--verde); margin-right: 0.4rem; }

.lp-btn-enviar {
    align-self: flex-start;
    background: var(--verde);
    color: #fff;
    font-family: var(--fuente-ui);
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    padding: 0.85rem 1.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.lp-btn-enviar:hover { background: var(--verde-oscuro); }
.lp-btn-enviar:disabled { opacity: 0.6; cursor: wait; }

/* ---------------------------------------------------------------
   PREGUNTAS DINÁMICAS
   --------------------------------------------------------------- */
.lp-form-preguntas { display: flex; flex-direction: column; gap: 1.1rem; }
.lp-pregunta-item label {
    display: block;
    font-family: var(--fuente-ui);
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 0.35rem;
}
.lp-pregunta-item textarea {
    width: 100%;
    padding: 0.65rem;
    border: 1.5px solid var(--borde);
    border-radius: 6px;
    font-family: var(--fuente-cuerpo);
}

/* ---------------------------------------------------------------
   INFORME
   --------------------------------------------------------------- */
.lp-informe-seccion { margin-bottom: 1.8rem; }
.lp-informe-seccion h3 {
    font-family: var(--fuente-display);
    color: var(--verde);
    border-bottom: 2px solid var(--verde-claro);
    padding-bottom: 0.3rem;
    margin-bottom: 0.6rem;
}
.lp-fuente-item {
    font-family: var(--fuente-ui);
    font-size: 0.85rem;
    padding: 0.6rem 0.8rem;
    border-left: 3px solid var(--oro);
    background: var(--crema);
    margin-bottom: 0.5rem;
}
.lp-fuente-item a { color: var(--verde); }
.lp-aviso-admin {
    font-family: var(--fuente-ui);
    font-size: 0.85rem;
    background: #fff4e0;
    border: 1px solid var(--oro);
    border-radius: 6px;
    padding: 0.7rem 0.9rem;
    margin-bottom: 1.2rem;
}

.lp-texto-en-vivo {
    white-space: pre-wrap;
    font-family: var(--fuente-cuerpo);
    line-height: 1.7;
}
.lp-texto-en-vivo::after {
    content: '▍';
    color: var(--verde);
    animation: lp-parpadeo 0.9s steps(1) infinite;
}
@keyframes lp-parpadeo {
    50% { opacity: 0; }
}

/* ---------------------------------------------------------------
   DOCUMENTOS RECOMENDADOS
   --------------------------------------------------------------- */
.lp-seccion-documentos {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid var(--verde-claro);
}

.lp-tarjeta-recomendacion {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    border: 1.5px solid var(--borde);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    margin-bottom: 0.9rem;
    background: var(--crema);
}
.lp-tarjeta-recomendacion .lp-tarjeta-nombre {
    font-family: var(--fuente-ui);
    font-weight: 700;
    color: var(--navy);
    font-size: 0.98rem;
}
.lp-tarjeta-recomendacion .lp-tarjeta-detalle {
    font-family: var(--fuente-ui);
    font-size: 0.85rem;
    color: var(--texto-suave);
}
.lp-btn-pequeno {
    padding: 0.5rem 1.1rem;
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

.lp-buscar-manual {
    margin-top: 1.2rem;
    border: 1px dashed var(--borde);
    border-radius: 8px;
    padding: 0.9rem 1.1rem;
}
.lp-buscar-manual summary {
    cursor: pointer;
    font-family: var(--fuente-ui);
    font-size: 0.88rem;
    color: var(--verde);
    font-weight: 700;
}
.lp-buscar-manual[open] summary { margin-bottom: 1rem; }

.lp-nota-plantilla {
    font-family: var(--fuente-ui);
    font-size: 0.8rem;
    color: var(--oro);
    font-style: italic;
    margin-top: 0.6rem;
}

/* ---------------------------------------------------------------
   OVERLAY DE CARGA
   --------------------------------------------------------------- */
.lp-cargando-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,36,56,0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: var(--fuente-ui);
    z-index: 50;
}
.lp-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid rgba(255,255,255,0.25);
    border-top-color: var(--oro);
    border-radius: 50%;
    animation: lp-girar 0.9s linear infinite;
    margin-bottom: 1rem;
}
@keyframes lp-girar { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------
   FOOTER
   --------------------------------------------------------------- */
.lp-footer {
    text-align: center;
    font-family: var(--fuente-ui);
    font-size: 0.78rem;
    color: var(--texto-suave);
    padding: 2rem 1.5rem 3rem;
}

@media (max-width: 640px) {
    .lp-wizard { margin-top: -1.5rem; padding: 1.6rem 1.2rem; border-radius: 0; }
    .lp-progreso-item span { display: none; }
    .lp-seleccion-actual { grid-template-columns: 1fr; min-width: 100%; }
    .lp-ruta-seleccion { grid-template-columns: 1fr; }
    .lp-contexto-informe-grid { grid-template-columns: 1fr; }
}

/* Fuentes jurídicas verificables */
.lp-ayuda-campo {
    margin: -.35rem 0 1rem;
    color: var(--texto-suave, #666);
    font-size: .9rem;
}
.lp-fuente-item {
    display: block;
    margin: 1rem 0;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(126, 96, 45, .28);
    border-radius: 8px;
    background: rgba(255, 252, 244, .72);
}
.lp-fuente-cabecera,
.lp-fuente-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.2rem;
    align-items: baseline;
}
.lp-fuente-cabecera { justify-content: space-between; }
.lp-fuente-id {
    font-size: .78rem;
    letter-spacing: .04em;
    opacity: .65;
}
.lp-fuente-meta {
    margin-top: .45rem;
    font-size: .9rem;
}
.lp-fuente-aporte { margin: .8rem 0 .35rem; }
.lp-fuente-extracto { margin: .65rem 0; }
.lp-fuente-extracto summary { cursor: pointer; font-weight: 600; }
.lp-fuente-extracto blockquote {
    margin: .65rem 0 0;
    padding: .7rem .9rem;
    border-left: 3px solid rgba(126, 96, 45, .5);
    font-size: .92rem;
    line-height: 1.55;
}
.lp-btn-fuente {
    display: inline-block;
    margin-top: .6rem;
    font-weight: 700;
}
.lp-fuente-ubicacion {
    display: block;
    margin-top: .5rem;
    overflow-wrap: anywhere;
    font-size: .85rem;
}
.lp-btn-fuente-secundario {
    margin-left: .45rem;
    font-weight: 500;
}

/* ===============================================================
   INFORME V3: Markdown limpio, citas navegables y descargas dobles
   =============================================================== */
.lp-contenido-juridico { line-height: 1.72; }
.lp-contenido-juridico p { margin: .58rem 0; }
.lp-contenido-juridico strong { color: var(--navy); }
.lp-subtitulo-interno {
    margin-top: 1.05rem !important;
    font-weight: 700;
    color: var(--navy);
}
.lp-lista-juridica {
    margin: .55rem 0 .85rem 1.45rem;
    padding: 0;
}
.lp-lista-juridica li { margin: .38rem 0; padding-left: .2rem; }
.lp-espacio-texto { height: .35rem; }
.lp-cita-inline {
    display: inline-block;
    padding: .04rem .28rem;
    border-radius: 4px;
    color: var(--verde);
    background: var(--verde-claro);
    font-family: var(--fuente-ui);
    font-size: .78em;
    font-weight: 700;
    text-decoration: none;
    vertical-align: .08em;
}
.lp-cita-inline:hover { text-decoration: underline; }
.lp-bloque-fuentes { margin-top: 2.4rem; }
.lp-ayuda-fuentes {
    font-family: var(--fuente-ui);
    color: var(--texto-suave);
    font-size: .9rem;
}
.lp-fuente-numero {
    min-width: 2.2rem;
    height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--verde);
    color: #fff;
    font-family: var(--fuente-ui);
    font-weight: 700;
}
.lp-fuente-cabecera { justify-content: flex-start; gap: .75rem; }
.lp-fuente-cabecera strong { flex: 1; font-size: 1rem; color: var(--navy); }
.lp-fuente-meta span {
    padding: .15rem .5rem;
    border-radius: 999px;
    background: rgba(26,92,56,.08);
}
.lp-fuente-resumen { margin: .45rem 0; }
.lp-fuente-cita {
    margin: .7rem 0;
    padding: .8rem 1rem;
    border-left: 4px solid var(--oro);
    background: #fff;
    font-style: italic;
    line-height: 1.55;
}
.lp-fuente-acciones { margin-top: .45rem; }
.lp-descargas {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin: 1.2rem 0 2rem;
}
.lp-descargas .lp-hero-cta { margin: 0; }
.lp-cta-secundaria {
    background: transparent !important;
    color: var(--verde) !important;
    border: 2px solid var(--verde);
}
.lp-documento-generado {
    margin-top: 2rem;
    padding: 1.4rem;
    border: 1px solid var(--borde);
    border-radius: 10px;
    background: #fff;
}
.lp-estado-documento {
    font-family: var(--fuente-ui);
    color: var(--texto-suave);
    font-style: italic;
}
.lp-escrito-completo {
    padding: 1rem 1.1rem;
    border: 1px solid var(--borde);
    border-radius: 6px;
    background: #fffefb;
}
.lp-error { color: #9c2f2f !important; }
@media (max-width: 640px) {
    .lp-descargas { flex-direction: column; }
    .lp-descargas .lp-hero-cta { width: 100%; text-align: center; }
}
