/* ============================================
   Onboarding Widget Styles
   Extracted from inline styles in onboarding-widget.js
   ============================================ */

/* --- Keyframes --- */
@keyframes ob-spin {
    to { transform: rotate(360deg); }
}

/* --- Loading State --- */
.onboarding-loading {
    text-align: center;
    padding: 40px;
}

.onboarding-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: ob-spin 1s linear infinite;
    margin: 0 auto 16px;
}

.onboarding-loading p {
    color: #6b7280;
}

/* --- Error State --- */
.onboarding-error {
    text-align: center;
    padding: 40px;
    color: #991b1b;
}

.onboarding-error i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.onboarding-error .btn-retry {
    margin-top: 16px;
    padding: 10px 20px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* --- Progress Bar --- */
.ob-progress {
    margin-bottom: 10px;
}

.ob-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.ob-progress-track {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.ob-progress-fill {
    height: 100%;
    background: #2563eb;
    transition: width 0.3s;
}

/* --- Step Title & Description --- */
.ob-step-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.ob-step-desc {
    color: #6b7280;
    margin-bottom: 24px;
}

/* --- Step Content --- */
.ob-step-content {
    margin-bottom: 16px;
}

/* --- Step Actions --- */
.ob-step-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* --- Buttons --- */
.btn-back {
    padding: 12px 24px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.btn-next {
    padding: 12px 24px;
    background: var(--accent);
    color: var(--text-secondary);
    border: none;
    border-radius: 26px;
    cursor: pointer;
    font-weight: 500;
    transition:all ease 1s;
}

.btn-next[disabled]{opacity:0.1}

/* --- Question Text --- */
.preview-question-text {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--accent);
}

/* --- Options Grid --- */
.options-grid {
    display: grid;
    gap: 12px;
    background-color: var(--bg-panel);
    padding: 10px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

/* --- Option Card --- */
.option-card {
    display: flex;
    align-items: center;
    padding: 16px;
    border: solid 2px var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-card.selected {
    border-color: var(--accent);
    background-color: var(--bg-dark);
}

.option-card input[type="radio"],
.option-card input[type="checkbox"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
}

.option-card .option-label {
    font-size: 16px;
}

/* --- Form Inputs (text, email, tel) --- */
.preview-input,
.preview-field input[type="text"],
.preview-field input[type="email"],
.preview-field input[type="tel"],
.preview-field input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 26px;
    border: 1px solid var(--border);
    background: var(--bg-lighter);
    outline: none;
}

.preview-input.error,
.preview-field input.error {
    border-color: #ef4444;
}

/* --- Textarea --- */
.preview-textarea,
.preview-field textarea {
    width: 100%;
    padding: 12px 16px;
    border: solid 2px var(--border);
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
    outline: none;
}

.preview-textarea.error,
.preview-field textarea.error {
    border-color: #ef4444;
}

/* --- Data Collection --- */
.preview-data-collection {
    display: grid;
    gap: 5px;
    margin-top: 16px;
    background-color: var(--bg-panel);
    padding: 10px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

/* --- Field Label --- */
.preview-field > label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-muted);
}

.required-mark {
    color: #ef4444;
}

/* --- Checkbox Field --- */
.preview-field-checkbox label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.preview-field-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    cursor: pointer;
    accent-color: #2563eb;
}

.preview-field-checkbox .checkbox-label {
    font-size: 14px;
    user-select: none;
}

/* --- Completion Step (inline) --- */
.preview-completion {
    text-align: center;
    padding: 20px 0;
}

.preview-completion i {
    font-size: 48px;
    color: #10b981;
    margin-bottom: 16px;
    display: block;
}

.preview-completion p {
    font-size: 18px;
}

/* --- Subtitle (shared pattern) --- */
.ob-subtitle {
    color: var(--accent);
    margin-bottom: 16px;
    font-size: 15px;
    margin-top: 0;
}

/* --- Address Search --- */
.address-input-wrap {
    position: relative;
}

.address-input-wrap > .fa-map-marker-alt {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 16px;
    z-index: 1;
}

.address-search-input {
    width: 100%;
    padding: 14px 16px 14px 40px;
    transition: border-color 0.2s;
    font-size: 16px;
    border-radius: 26px;
    border: 1px solid var(--border);
    background: var(--bg-lighter);
    outline: none;
}

.address-search-input.validated {
    border-color: var(--success-text);
}

.address-search-input.error {
    border-color: #ef4444;
}

.address-search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-panel);
    border: solid 1px var(--border);
    border-radius: 10px;
    margin-top: 4px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.address-hint {
    margin-top: 8px;
    font-size: 13px;
    color: #9ca3af;
}

.address-hint.validated {
    color: var(--success-text);
}

.address-hint.error {
    color: #ef4444;
}

/* --- Address Result Item --- */
.address-result-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.address-result-item:hover {
    background: #f9fafb;
}

.address-result-item i {
    color: #2563eb;
    margin-top: 3px;
    flex-shrink: 0;
}

.address-result-item .result-text {
    font-size: 14px;
    color: #111827;
    line-height: 1.4;
}

/* --- Module Block --- */
.block-options-grid {
    display: grid;
    gap: 12px;
    background-color: var(--bg-panel);
    padding: 10px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.block-option-card {
    display: flex;
    align-items: center;
    padding: 18px;
    border: solid 2px var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    gap: 14px;
}

.block-option-card.selected {
    border-color: var(--accent);
    background-color: var(--accent-dim);
}

.block-option-card input[type="radio"] {
    display: none;
}

.block-option-icon {
    width: 44px;
    height: 44px;
    background: var(--accent-dim);
    border-radius: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.block-option-icon i {
    font-size: 18px;
    color: #2563eb;
}

.block-option-text {
    flex: 1;
    min-width: 0;
}

.block-option-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

.block-option-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.block-check {
    width: 24px;
    height: 24px;
    border: solid 2px var(--border);
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.block-check.checked {
    border-color: var(--accent);
    background: var(--accent);
}

.block-check.checked i {
    color: var(--text-secondary);
    font-size: 12px;
}

/* --- Module Search --- */
.module-search-wrap {
    position: relative;
}

.module-search-wrap > .fa-search {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 16px;
}

.module-search-input {
    width: 100%;
    padding: 14px 16px 14px 40px;
    transition: border-color 0.2s;
    font-size: 16px;
    border-radius: 26px;
    border: 1px solid var(--border);
    background: var(--bg-lighter);
    outline: none;
}

.module-search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-top: 4px;
    max-height: 320px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* --- Skip Button --- */
.btn-skip-search {
    display: block;
    margin-top: 16px;
    width: 100%;
    padding: 12px;
    background: none;
    border: 1px dashed var(--text-muted);
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

/* --- Search Status Messages --- */
.search-status-msg {
    padding: 12px;
    text-align: center;
    font-size: 14px;
}

.search-status-msg.loading {
    color: #9ca3af;
}

.search-status-msg.empty {
    color: #9ca3af;
}

.search-status-msg.error {
    color: #ef4444;
}

.module-search-chips {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

/* --- Enhanced Search Result Item --- */
.module-search-result-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--bg-dark, #e5e7eb);
    transition: background 0.15s;
}

.module-search-result-item:last-child {
    border-bottom: none;
}

.module-search-result-item:hover {
    background: #f9fafb;
}

.ob-result-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.ob-result-rif {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent, #4F46E5);
    background: var(--accent-dim, rgba(79, 70, 229, 0.1));
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.ob-result-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main, #111827);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ob-result-address {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ob-result-address i {
    font-size: 10px;
    opacity: 0.6;
}

.ob-result-pills,
.search-chip-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* Property pills */
.ob-prop-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}

.ob-prop-pill i { font-size: 9px; }

.ob-prop-pill--type { background: rgba(99, 102, 241, 0.1); color: #6366f1; border-color: rgba(99, 102, 241, 0.15); }
.ob-prop-pill--contract { background: rgba(16, 185, 129, 0.1); color: #10b981; border-color: rgba(16, 185, 129, 0.15); }
.ob-prop-pill--size { background: rgba(245, 158, 11, 0.1); color: #d97706; border-color: rgba(245, 158, 11, 0.15); }
.ob-prop-pill--rooms { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; border-color: rgba(139, 92, 246, 0.15); }
.ob-prop-pill--baths { background: rgba(6, 182, 212, 0.1); color: #0891b2; border-color: rgba(6, 182, 212, 0.15); }
.ob-prop-pill--price { background: rgba(34, 197, 94, 0.1); color: #16a34a; border-color: rgba(34, 197, 94, 0.15); }
.ob-prop-pill--energy { background: rgba(132, 204, 22, 0.1); color: #65a30d; border-color: rgba(132, 204, 22, 0.15); }
.ob-prop-pill--location { background: rgba(244, 63, 94, 0.1); color: #e11d48; border-color: rgba(244, 63, 94, 0.15); }

/* --- Search Chip --- */
.search-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--accent-dim);
    border: 1px solid var(--accent-dim-2);
    border-radius: 20px;
    font-size: 13px;
    color: var(--accent);
    max-width: 100%;
}

.search-chip--rich {
    flex-direction: column;
    align-items: stretch;
    border-radius: 12px;
    padding: 10px 14px;
    gap: 8px;
    max-width: 100%;
}

.search-chip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.search-chip-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent, #4F46E5);
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-chip-label i {
    font-size: 12px;
    flex-shrink: 0;
}

.search-chip-rif {
    font-weight: 400;
    font-size: 12px;
    opacity: 0.7;
}

.search-chip i {
    font-size: 11px;
    flex-shrink: 0;
}

.search-chip .chip-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chip-remove {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0 2px;
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
}

/* --- Field Error --- */
.field-error {
    color: var(--danger);
    font-size: 14px;
    margin-bottom: 12px;
    text-align: center;
    width: 100%;
}

/* --- Completion Screen --- */
.onboarding-complete {
    text-align: center;
    padding: 10px 0;
}

.onboarding-complete-icon {
    width: 40px;
    height: 40px;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.onboarding-complete-icon i {
    font-size: 36px;
    color: var(--accent);
}

.onboarding-complete h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--accent);
}

.onboarding-complete p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.onboarding-complete .ref-id {
    font-size: 14px;
    color: var(--accent-dim-2);
}

.onboarding-complete-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.btn-summary {
    padding: 12px 24px;
    background: var(--accent);
    color: var(--text-secondary);
    border: none;
    border-radius: 26px;
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-summary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.onboarding-summary {
    margin-top: 20px;
    text-align: left;
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    max-height: 50vh;
    min-height: 200px;
    overflow-y: auto;
    width: -webkit-fill-available;
}

.summary-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.summary-card {
    background: var(--bg-panel);
    border: solid 1px var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-card-header {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.summary-card-content {
    color: var(--text-muted);
    word-break: break-word;
}

.summary-row {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border-light);
    border-radius: 10px;
}

.summary-label {
    font-weight: 600;
    color: var(--text-primary);
}

.summary-value {
    color: var(--text-muted);
    word-break: break-word;
}

.summary-sublist {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-kv {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.summary-kv-label {
    font-weight: 600;
    color: var(--text-primary);
}

.summary-kv-value {
    color: var(--text-muted);
    word-break: break-word;
}

.summary-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.summary-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--accent-dim);
    border: 1px solid var(--accent-dim-2);
    border-radius: 999px;
    font-size: 12px;
    color: var(--accent);
}

.summary-empty {
    color: var(--text-muted);
    text-align: center;
}
