/* === APORTES — todo el módulo usa el diseño claro de la ayuda ===
   Base (contenedor, cabecera azul, tarjetas blancas, chips): sección "BASE DEL MÓDULO", más abajo.
   Aquí: catálogo, formularios, "Mis aportes" y ventanas. */

/* ---------- Cabecera azul: botones y datos ---------- */
.ay-contenedor--ancho { max-width: 1240px; }

.ay-hero-acciones {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 18px;
}

.ay-btn-hero {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    color: #0077cc;
    font-weight: bold;
    font-size: 0.92em;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 60, 120, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ay-btn-hero:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 60, 120, 0.3); }

.ay-hero-datos {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 6px;
}

.ay-hero-datos span {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 20px;
    padding: 5px 14px;
    font-weight: bold;
}

/* ---------- Botones del módulo ---------- */
.ap-btn-descargar,
.ap-btn-detalles,
.ap-btn-eliminar {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.9em;
    font-weight: bold;
    font-family: Arial, Helvetica, sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid transparent;
    line-height: 1.2;
}

.ap-btn-descargar {
    background: linear-gradient(135deg, #0099ff, #53baff);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 153, 255, 0.35);
}

.ap-btn-detalles { background: #fff; color: #0077cc; border-color: #b9dcff; }
.ap-btn-eliminar { background: #fff; color: #c0392b; border-color: #f3c0bb; }

.ap-btn-descargar:hover,
.ap-btn-detalles:hover,
.ap-btn-eliminar:hover { transform: translateY(-2px); }

.ap-btn-descargar--grande { padding: 12px 28px; font-size: 1em; }

/* ---------- Chips ---------- */
.ap-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.ap-chip {
    background: #eef7ff;
    border: 1px solid #cfe3f7;
    color: #0b4f8a;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.8em;
    white-space: nowrap;
}

.ap-chip--ok { background: #eaf8ee; border-color: #b6e3c2; color: #1e7a3c; }
.ap-chip--alerta { background: #fdeceb; border-color: #f3c0bb; color: #a93226; }

/* Icono grande del tipo cuando no hay portada */
.ap-icono {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    background: linear-gradient(135deg, #eef7ff, #dcefff);
}

/* ---------- Catálogo ---------- */
.ap-barra {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
}

.ap-tipos { display: flex; flex-wrap: wrap; gap: 8px; }

.ap-tipo {
    background: #eef7ff;
    border: 1px solid #b9dcff;
    color: #0b4f8a;
    border-radius: 20px;
    padding: 7px 14px;
    font-size: 0.9em;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.ap-tipo:hover { transform: translateY(-1px); }

.ap-tipo.activo {
    background: linear-gradient(135deg, #0099ff, #53baff);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 153, 255, 0.35);
}

.ap-buscar {
    flex: 1;
    min-width: 200px;
    max-width: 360px;
    border: 1.5px solid #cfe3f7;
    background: #f5f9ff;
    color: #1b2a3a;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.95em;
    outline: none;
}

.ap-buscar:focus { border-color: #0099ff; box-shadow: 0 0 0 4px rgba(0, 153, 255, 0.15); }

.ap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.ap-tarjeta {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 20px;
    box-shadow: 0 10px 32px rgba(0, 60, 120, 0.18);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ap-tarjeta:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0, 60, 120, 0.25); }

.ap-portada {
    display: block;
    aspect-ratio: 3 / 4;
    background: #eef7ff;
    overflow: hidden;
}

.ap-portada img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ap-cuerpo {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.ap-titulo {
    margin: 0;
    font-size: 1.05em;
    line-height: 1.3;
    color: #1b2a3a;
    text-align: left;
    overflow-wrap: anywhere;
}

.ap-autor { font-size: 0.82em; color: #5a6b7d; }

.ap-acciones { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

.ap-estado {
    text-align: center;
    color: #fff;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.35);
    margin: 18px 0;
}

/* ---------- Ventanas (detalles y editar) ---------- */
.ap-modal-caja {
    position: relative;
    background: #fff;
    color: #1b2a3a;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    padding: 26px;
    width: 560px;
    max-width: 92vw;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
    text-align: left;
}

.ap-modal-caja h2 { margin: 0 0 10px; color: #0077cc; font-size: 1.35em; text-align: left; }

.ap-modal-cerrar {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #8aa0b5;
    cursor: pointer;
}

.ap-modal-cabecera { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 14px; }

.ap-modal-portada {
    width: 110px;
    flex-shrink: 0;
    aspect-ratio: 3 / 4;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 60, 120, 0.2);
}

.ap-modal-portada img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-modal-portada .ap-icono { font-size: 44px; }

.ap-modal-descripcion { line-height: 1.6; margin: 0 0 14px; color: #33475b; white-space: pre-line; }

.ap-datos {
    list-style: none;
    padding: 0;
    margin: 0 0 18px;
    border-top: 1px solid #e3eef9;
}

.ap-datos li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #e3eef9;
    font-size: 0.92em;
}

.ap-datos strong { color: #0b4f8a; flex-shrink: 0; }
.ap-datos span { text-align: right; overflow-wrap: anywhere; color: #33475b; }

/* Reportar */
.ap-reporte { margin-top: 16px; text-align: center; }

.ap-reportar {
    background: none;
    border: 1px solid #d6dee7;
    color: #6b7b8c;
    border-radius: 12px;
    padding: 6px 14px;
    font-size: 0.82em;
    cursor: pointer;
}

.ap-reportar:hover { border-color: #e74c3c; color: #c0392b; }
.ap-reportar--enviar { background: #e74c3c; border-color: #e74c3c; color: #fff; }

#ap-reporte-form { gap: 8px; justify-content: center; flex-wrap: wrap; }

#ap-reporte-motivo {
    border-radius: 12px;
    padding: 6px 10px;
    border: 1.5px solid #cfe3f7;
    background: #f5f9ff;
    color: #1b2a3a;
    font-size: 0.85em;
    max-width: 100%;
}

.ap-reporte-mensaje { color: #b9770e; font-size: 0.88em; margin: 8px 0 0; }

/* ---------- Formularios claros (Aportar material y Editar) ---------- */
.ay-form .popup-field label {
    color: #0b4f8a;
    text-shadow: none;
}

.ay-form .popup-field input,
.ay-form .popup-field select,
.ay-form .popup-field textarea {
    background: #f5f9ff;
    border: 1.5px solid #cfe3f7;
    color: #1b2a3a;
}

.ay-form .popup-field input:focus,
.ay-form .popup-field textarea:focus { border-color: #0099ff; box-shadow: 0 0 0 4px rgba(0, 153, 255, 0.15); }

.ay-form .pf-check { color: #1b2a3a; text-shadow: none; }

.ay-form .popup-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }

.ap-modal-caja.ay-form form { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Mis aportes: filas ---------- */
.ap-fila { display: flex; gap: 16px; align-items: center; padding: 14px 16px; }

.ap-fila-portada {
    width: 64px;
    height: 85px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #eef7ff;
}

.ap-fila-portada img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-fila-portada .ap-icono { font-size: 30px; }

.ap-fila-cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }

.ap-fila-acciones { display: flex; gap: 8px; flex-shrink: 0; }
.ap-fila-acciones form { margin: 0; }

.ap-vacio { text-align: center; }
.ap-vacio p { font-size: 1.05em; }

/* ---------- Móvil ---------- */
@media (max-width: 600px) {
    .ap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .ap-cuerpo { padding: 10px 10px 12px; gap: 8px; }
    .ap-titulo { font-size: 0.92em; }
    .ap-chip { font-size: 0.72em; padding: 2px 8px; }
    .ap-autor { font-size: 0.72em; }
    .ap-acciones { flex-direction: column; }
    .ap-acciones .ap-btn-descargar,
    .ap-acciones .ap-btn-detalles { text-align: center; padding: 7px 8px; font-size: 0.8em; }
    .ap-icono { font-size: 44px; }
    .ap-buscar { max-width: none; }
    .ap-fila { flex-wrap: wrap; }
    .ap-fila-acciones { width: 100%; justify-content: flex-end; }
    .ap-modal-cabecera { flex-direction: column; align-items: center; text-align: center; }
    .ap-modal-caja h2 { text-align: center; }
}

@media (orientation: landscape) and (max-height: 500px) {
    .ap-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}


/* === BASE DEL MÓDULO (nació en /aportes/ayuda/) — tarjetas claras con texto oscuro, legibles sobre el degradado === */

.ay-contenedor {
    max-width: 820px;
    width: 94%;
    margin: 0 auto;
    padding-bottom: 60px;
    position: relative;
    z-index: 1;
    font-family: Arial, Helvetica, sans-serif;
    color: #1b2a3a;
    text-align: left;
}

.ay-hero {
    margin: 24px 0 18px;
    padding: 30px 28px;
    border-radius: 20px;
    background: linear-gradient(135deg, #0099ff, #53baff);
    box-shadow: 0 16px 48px rgba(0, 153, 255, 0.35);
    color: #fff;
    text-align: center;
}

.ay-hero h1 {
    margin: 0 0 8px;
    font-size: 2em;
    color: #fff;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.25);
}

.ay-hero p { margin: 0; font-size: 1.05em; line-height: 1.5; }

.ay-paso,
.ay-tarjeta {
    background: rgba(255, 255, 255, 0.94);
    border-radius: 20px;
    box-shadow: 0 10px 32px rgba(0, 60, 120, 0.18);
    padding: 22px 24px;
    margin-bottom: 16px;
}

.ay-paso { display: flex; gap: 18px; align-items: flex-start; }

.ay-numero {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0099ff, #53baff);
    color: #fff;
    font-size: 22px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 153, 255, 0.4);
}

.ay-cuerpo { min-width: 0; flex: 1; }

.ay-paso h2,
.ay-tarjeta h2 {
    margin: 6px 0 10px;
    font-size: 1.3em;
    color: #0077cc;
    text-align: left;
}

.ay-paso p,
.ay-tarjeta p { margin: 0 0 12px; line-height: 1.6; }

.ay-contenedor a:not(.ay-btn-hero):not(.ap-btn-descargar):not(.ap-portada) { color: #0077cc; font-weight: bold; }

.ay-contenedor code {
    background: #e8f4ff;
    color: #0077cc;
    padding: 1px 6px;
    border-radius: 6px;
}

.ay-opcional {
    font-size: 0.6em;
    vertical-align: middle;
    background: #e8f4ff;
    color: #0077cc;
    border-radius: 10px;
    padding: 3px 10px;
}

.ay-consejo {
    background: #eef7ff;
    border-left: 4px solid #0099ff;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.95em;
}

.ay-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }

.ay-chip {
    background: #eef7ff;
    border: 1px solid #b9dcff;
    color: #0b4f8a;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.9em;
}

/* Ilustraciones (simulan pantallas de Drive y postimages) */
.ay-dialogo {
    background: #fff;
    border: 1px solid #dfe6ee;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    padding: 18px;
    margin: 6px 0 14px;
    max-width: 520px;
    font-size: 0.92em;
}

.ay-dialogo-titulo { font-size: 1.15em; color: #1f1f1f; margin-bottom: 14px; }
.ay-dialogo-sub { color: #444; font-weight: bold; margin-bottom: 8px; }

.ay-acceso {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    position: relative;
}

.ay-globo {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #d6f0dc;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ay-acceso-nombre { font-weight: bold; color: #1f1f1f; }
.ay-acceso-desc { color: #666; font-size: 0.9em; }

.ay-dialogo-botones {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.ay-boton-copiar,
.ay-boton-hecho {
    border-radius: 20px;
    padding: 8px 18px;
    position: relative;
}

.ay-boton-copiar { border: 1px solid #747775; color: #0b57d0; }
.ay-boton-hecho { background: #0b57d0; color: #fff; }

.ay-fila-enlace {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
    flex-wrap: wrap;
}

.ay-etiqueta { width: 110px; color: #555; text-align: right; flex-shrink: 0; }

.ay-campo {
    flex: 1;
    min-width: 0;
    background: #e9ecef;
    border-radius: 6px;
    padding: 7px 10px;
    color: #333;
    overflow-wrap: anywhere;
    position: relative;
}

/* Lo que hay que mirar, resaltado como en las capturas viejas (sin flechas rojas) */
.ay-resalte { outline: 3px solid #ff9f1a; outline-offset: 2px; background-color: #fff7e8; }

.ay-marca {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ff9f1a;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    margin-left: 8px;
    flex-shrink: 0;
}

/* Qué se puede compartir */
.ay-columnas { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.ay-si, .ay-no { border-radius: 14px; padding: 12px 16px; }
.ay-si { background: #eaf8ee; border: 1px solid #b6e3c2; }
.ay-no { background: #fdeceb; border: 1px solid #f3c0bb; }
.ay-si h3, .ay-no h3 { margin: 0 0 8px; font-size: 1.05em; }
.ay-si ul, .ay-no ul { margin: 0; padding-left: 20px; line-height: 1.7; }

/* Rangos */
.ay-rangos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }

.ay-rango {
    background: #eef7ff;
    border-radius: 14px;
    padding: 12px 6px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9em;
}

.ay-rango-emoji { font-size: 28px; }

@media (max-width: 600px) {
    .ay-hero h1 { font-size: 1.5em; }
    .ay-paso { padding: 18px 16px; gap: 12px; }
    .ay-numero { width: 36px; height: 36px; font-size: 18px; }
    .ay-columnas { grid-template-columns: 1fr; }
    .ay-rangos { grid-template-columns: repeat(3, 1fr); }
    .ay-etiqueta { width: auto; text-align: left; }
}


/* === MI PERFIL (/profile/) — usa el mismo diseño claro del módulo Aportes === */

.ay-tarjeta .pf-nota { color: #1b2a3a; text-shadow: none; text-align: left; }

.ay-tarjeta.pf-peligro { border: 2px solid #f3c0bb; box-shadow: 0 10px 32px rgba(192, 57, 43, 0.15) !important; }
.ay-tarjeta.pf-peligro h2,
.pf-modal-peligro h2 { color: #c0392b; }

.pf-modal-peligro p { line-height: 1.6; margin: 0 0 6px; }
.pf-modal-peligro .popup-field label { text-align: left; }

/* "Cerrar sesión": solo en Mi Perfil, en la esquina del encabezado (se desplaza con la página) */
.pf-contenedor .ay-hero { position: relative; }

.pf-cerrar-sesion {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #fff !important;
    font-weight: bold;
    font-size: 0.85em;
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.pf-cerrar-sesion:hover { background: rgba(192, 57, 43, 0.85); border-color: transparent; }

@media (max-width: 600px) {
    .pf-contenedor .ay-hero { padding-top: 54px; }
}
