/* ============ MODAL ============ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 50;
    background: var(--overlay);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    padding: var(--space-sm);
    opacity: 0; pointer-events: none;
    transition: opacity 200ms ease;
}
.modal-overlay.is-open { opacity: 1; pointer-events: auto; }
.modal-card {
    position: relative;
    width: min(600px, 100%);
    max-height: min(680px, 92vh);
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--paper-raised);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    padding: var(--space-lg);
    transform: translateY(16px) scale(0.97);
    transition: transform 240ms ease;
}
.modal-overlay.is-open .modal-card { transform: translateY(0) scale(1); }
.modal-hex-watermark {
    position: absolute; top: -30px; right: -40px; width: 180px; height: 180px;
    fill: none; stroke: var(--accent); stroke-width: 1.2; opacity: 0.07;
    pointer-events: none;
}

.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-sm); }
.modal-head-main { display: flex; align-items: flex-start; gap: var(--space-sm); flex: 1; min-width: 0; }
.modal-icon-badge {
    width: 52px; height: 52px; flex-shrink: 0; border-radius: var(--radius-md);
    background: linear-gradient(160deg, var(--accent-soft), var(--paper));
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
}
.modal-icon-badge svg { width: 26px; height: 26px; }
.modal-title { margin-top: 0.35rem; font-size: clamp(1.2rem, 2.4vw, 1.4rem); }

/* ============ INDICADOR DE PASOS ============ */
.modal-stepper { display: flex; align-items: flex-start; margin-block: var(--space-lg); }
.step-node { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.step-circle {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 800; font-size: 0.95rem;
    border: 2px solid var(--border); color: var(--ink-faint);
    background: var(--paper-raised);
    transition: border-color 200ms ease, background 200ms ease, box-shadow 200ms ease, color 200ms ease;
}
.step-node.is-active .step-circle {
    border-color: var(--accent); background: var(--accent); color: var(--accent-ink);
    box-shadow: 0 8px 18px -6px rgba(0,71,171,0.55);
}
.step-caption { font-size: 0.72rem; color: var(--ink-faint); font-weight: 600; text-align: center; }
.step-node.is-active .step-caption { color: var(--accent); }
.step-connector { flex: 1; height: 2px; background: var(--border); margin: 19px 0.5rem 0; }

/* ============ TARJETA DE BÚSQUEDA (autocomplete, dentro del modal) ============ */
.search-card-label { font-size: 0.85rem; color: var(--ink-faint); margin-bottom: 0.6rem; font-weight: 600; }
.search-input {
    display: flex; align-items: center; gap: 0.7rem;
    border: 1.5px solid var(--accent); border-radius: var(--radius-sm);
    padding: 1rem 1.1rem; background: var(--paper);
    box-shadow: 0 0 0 4px var(--accent-soft);
}
.search-input svg { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; }
.search-input-field {
    flex: 1; min-width: 0; border: none; outline: none; background: transparent;
    font-family: var(--font-body); font-size: 1.05rem; color: var(--ink);
}
.search-input-field::placeholder { color: var(--ink-faint); }

.search-hint {
    display: block; margin-top: 0.5rem; font-size: 0.78rem; font-style: italic;
    color: var(--ink-faint); text-align: center;
}
.search-hint[hidden] { display: none; }

.search-results { margin-top: 0.7rem; display: flex; flex-direction: column; gap: 0.3rem; }
.search-result {
    display: flex; align-items: flex-start; gap: 0.7rem;
    padding: 0.75rem 0.7rem; border-radius: var(--radius-sm);
    border: 1px solid transparent;
}
.search-result.is-active { background: var(--accent-soft); border-color: var(--hero-line); }
.search-result-pin {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    background: var(--accent-soft); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
}
.search-result.is-active .search-result-pin { background: var(--accent); color: var(--accent-ink); }
.search-result-pin svg { width: 15px; height: 15px; }
.search-result-name { font-weight: 700; font-size: 0.95rem; color: var(--ink); }
.search-result-addr { font-size: 0.82rem; color: var(--ink-faint); margin-top: 0.1rem; }

.search-card-footer {
    margin-top: var(--space-sm); padding-top: var(--space-sm);
    border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.78rem; color: var(--ink-faint);
}
.search-card-footer svg { width: 14px; height: 14px; color: var(--accent); flex-shrink: 0; }

.search-manual { margin-top: 0.6rem; }
.search-manual-link {
    background: none; border: none; padding: 0; cursor: pointer;
    font-family: var(--font-body); font-size: 0.85rem; font-weight: 600;
    color: var(--accent); text-decoration: underline;
}

/* ============ REFUERZO DE CONFIANZA ============ */
.trust-row {
    display: flex; gap: 0.7rem; align-items: center;
    margin-top: var(--space-md); padding: var(--space-sm) var(--space-md);
    background: var(--accent-soft); border-radius: var(--radius-md);
}
.trust-row-badge {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    background: var(--paper-raised); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
}
.trust-row-badge svg { width: 17px; height: 17px; }
.trust-row p { font-size: 0.86rem; color: var(--ink); font-weight: 500; }

.modal-actions { margin-top: var(--space-lg); }
.modal-actions .btn { width: 100%; }

@media (max-width: 600px) {
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal-card { width: 100%; max-height: 90vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: var(--space-md); }
}
