/* ASOT — estilos de la interfaz */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(180deg, #062f4c 0%,  #0d3b5c 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.header {
    position: relative;
    height: 120px;
    color: white;
    display: flex;
    align-items: center;
    padding: 0;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0d3b5c;
    z-index: 1;
}

.header::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 60%;
    background: #e4e2df;
    clip-path: polygon(15% 0%, 100% 0%, 100% 100%, 0% 100%);
    z-index: 2;
}

.header-content {
    position: relative;
    z-index: 3;
    padding: 0 30px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.header h1 {
    font-size: 2em;
    margin-bottom: 4px;
    font-weight: 700;
    letter-spacing: 1px;
    color: white;
}

.header p {
    font-size: 0.85em;
    font-weight: 300;
    opacity: 0.95;
    color: rgba(255,255,255,0.9);
}

.content {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 600px;
    gap: 0;
}

.main {
    padding: 0;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.datos-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.datos-checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s;
}

.datos-checkbox-item:hover {
    background: #fce8e8;
}

.datos-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #00f7ff;
}

.datos-checkbox-item .dato-label {
    cursor: pointer;
    margin: 0;
    font-size: 0.85em;
    line-height: 16px;
    flex: 1;
    color: #333;
}

.search-box {
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e8ecf1;
    border-radius: 6px;
    font-size: 0.9em;
    transition: all 0.3s;
    background: white;
}

.search-box input:focus {
    outline: none;
    border-color: #b8243d;
    box-shadow: 0 0 0 3px rgba(184, 36, 61, 0.1);
}

.category-filter {
    margin-bottom: 20px;
}

.servicios-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
    padding: 25px;
    align-content: start;
}

.servicios-vacio {
    grid-column: 1 / -1;
    padding: 40px;
    color: #666;
    font-size: 0.9em;
    text-align: center;
    border: 1px dashed #e8ecf1;
}


.btn-volver {
    background: none;
    border: none;
    color: #b8243d;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    padding: 0 0 12px 0;
    display: block;
    font-family: inherit;
    transition: opacity 0.2s;
}

.btn-volver:hover {
    opacity: 0.7;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.detail-header {
    border-bottom: 3px solid #b8243d;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.detail-header h2 {
    color: #0d3b5c;
    margin-bottom: 8px;
    font-size: 1.8em;
    font-weight: 700;
}

.detail-category {
    display: inline-block;
    background: #b8243d;
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.75em;
    margin-top: 5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section {
    margin-bottom: 25px;
}

.section h3 {
    color: #0d3b5c;
    font-size: 1em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #b8243d;
    font-weight: 700;
}

.info-item {
    padding: 12px;
    background: #f8fafb;
    border-radius: 6px;
    font-size: 0.95em;
    line-height: 1.5;
    color: #333;
    border-left: 3px solid #b8243d;
}

.list-item {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
    color: #555;
    font-size: 0.95em;
}

.list-item:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #b8243d;
    font-weight: bold;
}

.contact-item {
    background: #f8fafb;
    border: 1px solid #e8ecf1;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    border-left: 3px solid #b8243d;
}

.contact-item strong {
    color: #0d3b5c;
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.contact-detail {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 4px;
}

.contact-detail a {
    color: #b8243d;
    text-decoration: none;
    font-weight: 500;
}

.contact-detail a:hover {
    text-decoration: underline;
}

.tab-group {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: #f8fafb;
    border: 1px solid #e8ecf1;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    color: #555;
    transition: all 0.25s;
    font-size: 0.9em;
    font-family: inherit;
}

.tab-btn .tab-icon {
    font-size: 1.1em;
    line-height: 1;
}

.tab-btn:hover:not(.active) {
    background: #fce8e8;
    color: #8a1a2d;
    border-color: #b8243d;
}

.tab-btn.active {
    background: #b8243d;
    color: white;
    border-color: #b8243d;
    box-shadow: 0 4px 12px rgba(184, 36, 61, 0.25);
    transform: translateY(-1px);
}

.tab-content[hidden] {
    display: none !important;
}

.tab-content:not([hidden]) {
    display: block;
}

.empty-state {
    text-align: center;
    padding: 60px 40px;
    color: #999;
}

.empty-state-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95em;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background: #b8243d;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #8a1a2d;
    box-shadow: 0 4px 12px rgba(184, 36, 61, 0.3);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 6px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #b8243d;
}

.modal-header h2 {
    color: #0d3b5c;
    font-weight: 700;
}

.close {
    font-size: 28px;
    line-height: 1;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s;
    background: none;
    border: none;
    padding: 4px 8px;
    margin: 0;
}

.close:hover {
    color: #0d3b5c;
}

.form-section {
    border: 1px solid #e8ecf1;
    border-left: 4px solid #b8243d;
    padding: 14px 16px 6px;
    margin-bottom: 18px;
    background: #fcfdfe;
}

.form-section legend {
    padding: 0 8px;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #0d3b5c;
    font-weight: 700;
}

.form-status {
    margin: 12px 0 0;
    font-size: 0.9em;
    color: #0d3b5c;
    min-height: 1.2em;
}

.form-status.form-status-error {
    color: #b00020;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #0d3b5c;
    font-size: 0.9em;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #e8ecf1;
    border-radius: 6px;
    font-size: 0.9em;
    font-family: inherit;
    transition: all 0.3s;
    background: white;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #b8243d;
    box-shadow: 0 0 0 3px rgba(184, 36, 61, 0.1);
}

.preview {
    background: #f8fafb;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #b8243d;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    font-size: 0.8em;
    color: #333;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.button-group .btn {
    flex: 1;
}

.btn-secondary {
    background: white;
    border: 2px solid #0d3b5c;
    color: #0d3b5c;
}

.btn-secondary:hover {
    background: #e3f2fd;
}

@media (max-width: 768px) {
    .content {
        grid-template-columns: 1fr;
    }

    .header h1 {
        font-size: 1.5em;
    }

    .header::after {
        width: 50%;
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    z-index: 10000;
    padding: 12px 16px;
    background: #b8243d;
    color: white;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
}

.skip-link:focus {
    left: 12px;
    top: 12px;
}

.tab-btn:focus-visible,
.category-btn:focus-visible,
.dato-card:focus-visible,
.servicio-card:focus-visible,
.close:focus-visible,
.btn-volver:focus-visible {
    outline: 3px solid #b8243d;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   Rediseño 2026-05: Home asistente (4 estados)
   ============================================================ */

/* El layout pasa a una columna única (ya no hay sidebar) */
.content {
    display: block;
}

.main {
    padding: 36px 32px 48px;
    max-height: none;
    overflow: visible;
}

.estado {
    animation: estadoFadeIn 0.25s ease;
}

@keyframes estadoFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Estado A: Home ---- */
.home-pregunta {
    text-align: center;
    margin: 12px auto 36px;
    max-width: 720px;
}

.home-pregunta h2 {
    font-size: 1.85em;
    font-weight: 700;
    color: #0d3b5c;
    margin-bottom: 8px;
}

.home-pregunta p {
    color: #5a6573;
    font-size: 1em;
}

.datos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 780px;
    margin: 0 auto 32px;
}

@media (max-width: 700px) {
    .datos-grid { grid-template-columns: repeat(2, 1fr); }
}

.dato-card {
    position: relative;
    background: white;
    border: 2px solid #e1e8ef;
    border-radius: 12px;
    padding: 22px 18px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font: inherit;
    color: #1a202c;
    text-align: center;
}

.dato-card:hover {
    border-color: #0d3b5c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 59, 92, 0.1);
}

.dato-card.activo {
    border-color: #b8243d;
    background: linear-gradient(135deg, #fff 0%, #fef3f5 100%);
    box-shadow: 0 4px 12px rgba(184, 36, 61, 0.15);
}

.dato-card.activo::after {
    content: "✓";
    position: absolute;
    top: 8px;
    right: 12px;
    color: #b8243d;
    font-weight: bold;
    font-size: 1.1em;
}

.dato-emoji {
    font-size: 2.2em;
    line-height: 1;
}

.dato-card .dato-label {
    font-size: 0.95em;
    font-weight: 500;
    color: #0d3b5c;
    line-height: 1.3;
}

.separador {
    text-align: center;
    color: #888;
    margin: 28px auto;
    position: relative;
    font-size: 0.85em;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    max-width: 720px;
}

.separador::before, .separador::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 38%;
    height: 1px;
    background: #e1e8ef;
}

.separador::before { left: 0; }
.separador::after { right: 0; }

.busqueda-directa {
    max-width: 500px;
    margin: 0 auto 28px;
}

.busqueda-directa input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ef;
    border-radius: 8px;
    font-size: 0.95em;
    font: inherit;
    outline: none;
    transition: border-color 0.15s;
    background: white;
}

.busqueda-directa input:focus {
    border-color: #0d3b5c;
}

.ver-todos-link {
    display: block;
    margin: 0 auto;
    color: #0d3b5c;
    background: none;
    border: none;
    font: inherit;
    font-size: 0.95em;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 4px;
    padding: 8px 12px;
}

.ver-todos-link:hover {
    color: #b8243d;
}

/* ---- Estado B: Resultados ---- */
.chips-bar {
    background: white;
    border: 1px solid #e1e8ef;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.chips-bar-label {
    font-weight: 600;
    color: #0d3b5c;
    font-size: 0.9em;
}

.chips-list {
    display: contents;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #0d3b5c;
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85em;
    font-weight: 500;
}

.chip button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1em;
    line-height: 1;
    padding: 0;
    opacity: 0.8;
}

.chip button:hover { opacity: 1; }

.chip-add {
    background: transparent;
    color: #0d3b5c;
    border: 1.5px dashed #0d3b5c;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 0.85em;
    cursor: pointer;
    font: inherit;
    font-weight: 500;
}

.chip-add:hover {
    background: #0d3b5c;
    color: white;
}

.info-block, .servicios-block {
    background: white;
    border: 1px solid #e1e8ef;
    border-radius: 10px;
    padding: 22px 24px;
    margin-bottom: 20px;
}

.block-title {
    font-size: 0.85em;
    font-weight: 600;
    color: #b8243d;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 14px;
}

.cant-sugeridos {
    opacity: 0.65;
    font-weight: 500;
}

.info-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.info-tag {
    background: #eef4fa;
    color: #0d3b5c;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
}

.servicios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.servicio-card {
    background: white;
    border: 1.5px solid #e1e8ef;
    border-radius: 10px;
    padding: 16px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    font: inherit;
    color: #1a202c;
}

.servicio-card:hover {
    border-color: #b8243d;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(184, 36, 61, 0.12);
}

.servicio-card .servicio-icono,
.servicio-card .servicio-icono-fallback {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: #f0f4f8;
    object-fit: contain;
}

.servicio-card .servicio-icono-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4em;
}

.servicio-card .servicio-nombre {
    font-size: 0.88em;
    font-weight: 600;
    color: #0d3b5c;
    line-height: 1.3;
}

.servicio-card .servicio-categoria {
    font-size: 0.72em;
    color: #5a6573;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.empezar-de-nuevo {
    display: block;
    margin: 24px auto 0;
    color: #5a6573;
    background: none;
    border: none;
    font: inherit;
    font-size: 0.9em;
    cursor: pointer;
    padding: 6px 12px;
}

.empezar-de-nuevo:hover { color: #b8243d; }

/* ---- Estado C: Catálogo completo ---- */
.catalogo-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.catalogo-header h2 {
    color: #0d3b5c;
    font-size: 1.4em;
    font-weight: 700;
}

.catalogo-controles {
    background: white;
    border: 1px solid #e1e8ef;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 20px;
}

.catalogo-controles .search-box {
    margin-bottom: 14px;
}

.catalogo-controles .search-box input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e1e8ef;
    border-radius: 8px;
    font: inherit;
    font-size: 0.95em;
    outline: none;
}

.catalogo-controles .search-box input:focus {
    border-color: #0d3b5c;
}

.catalogo-controles .category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.catalogo-controles .category-btn {
    background: white;
    border: 1.5px solid #e1e8ef;
    color: #0d3b5c;
    padding: 5px 12px;
    border-radius: 16px;
    font: inherit;
    font-size: 0.82em;
    cursor: pointer;
    transition: all 0.15s;
}

.catalogo-controles .category-btn:hover {
    border-color: #0d3b5c;
}

.catalogo-controles .category-btn.active {
    background: #0d3b5c;
    color: white;
    border-color: #0d3b5c;
}

/* La lista del catálogo reusa los tiles existentes, sólo ajusto contenedor */
#estadoCatalogo .servicios-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

/* ---- Estado D: Detalle (se hereda casi todo del CSS viejo) ---- */
.detail-panel.estado:not([hidden]) {
    display: block;
    padding: 30px;
    animation: fadeIn 0.3s;
}
#estadoHome[hidden], #estadoResultados[hidden], #estadoCatalogo[hidden] { display: none; }

/* ---- Modal: bloque email + botón copiar ---- */
.input-with-action {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.input-with-action input {
    flex: 1;
    min-width: 0;
}

.btn-copy {
    background: #0d3b5c;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0 14px;
    font: inherit;
    font-size: 0.88em;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.btn-copy:hover { background: #1a5a85; }
.btn-copy:active { background: #062f4c; }

.form-hint {
    font-size: 0.82em;
    color: #5a6573;
    margin-top: 6px;
    min-height: 1.2em;
}

.form-hint-ok { color: #2d7a4c; }
.form-hint-error { color: #b8243d; }
