/* =========================================================
   Osserva Onboarding Insights: WordPress embed stylesheet
   Ported from onboarding.css (Osserva Public Design System).
   Everything is scoped under .osv-ob so the theme is untouched,
   and the reset below shields the widget from theme styles.
   ========================================================= */

.osv-ob {
    /* Design tokens: copied from the OppFinder simulator (onboarding.css :root) */
    --surface: #ffffff;
    --surface-muted: #faf9f8;
    --border: #E5E0DA;
    --border-light: #EFECE8;
    --text: #2D2522;
    --text-secondary: #5A4E48;
    --text-muted: #8C7B73;
    --accent: #F03010;
    --accent-text: #B92B0C;
    --accent-hover: #E80038;
    --accent-subtle: #FDF2EE;
    --accent-border: #F8D5CD;
    --success: #16a34a;
    --success-subtle: #dcfce7;
    --success-border: #bbf7d0;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --shadow-sm: 0 1px 2px 0 rgba(45, 37, 34, 0.04);
    --shadow-card: 0 1px 3px 0 rgba(45, 37, 34, 0.06), 0 4px 12px -2px rgba(45, 37, 34, 0.03);

    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text);
    font-size: 14px;
    line-height: 1.55;
    text-align: left;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.osv-ob.osv-ob--inter {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Defensive reset against theme styles */
.osv-ob *, .osv-ob *::before, .osv-ob *::after { box-sizing: border-box; }
.osv-ob h2, .osv-ob p, .osv-ob form, .osv-ob table { margin: 0; padding: 0; }
.osv-ob button, .osv-ob input, .osv-ob textarea {
    font-family: inherit;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.4;
    box-shadow: none;
    max-width: 100%;
}
.osv-ob button { text-decoration: none; }
.osv-ob table { border: 0; margin: 0; table-layout: auto; }
.osv-ob th, .osv-ob td { border-left: 0; border-right: 0; border-top: 0; vertical-align: top; }
.osv-ob [hidden] { display: none !important; }

.osv-ob .screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.osv-ob .osv-ob-hp {
    position: absolute !important;
    left: -9999px;
    width: 1px; height: 1px;
    overflow: hidden;
}

.osv-ob .onboarding-container {
    width: 100%;
    max-width: 760px;
}

.osv-ob .onboarding-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
}

.osv-ob .onboarding-header {
    margin-bottom: 24px;
    text-align: center;
}

.osv-ob .onboarding-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.osv-ob .onboarding-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.osv-ob .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 640px) {
    .osv-ob .form-row {
    grid-template-columns: 1fr;
}
}

.osv-ob .form-group {
    margin-bottom: 16px;
    position: relative;
}

.osv-ob .form-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.osv-ob .form-label-hint {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
}

.osv-ob .form-input, .osv-ob .form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.osv-ob .form-input:focus, .osv-ob .form-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(240, 48, 16, 0.12);
}

.osv-ob .form-input:disabled, .osv-ob .form-textarea:disabled {
    background: #f8f6f4;
    color: var(--text-secondary);
    cursor: not-allowed;
    border-color: var(--border-light);
}

.osv-ob .form-textarea {
    resize: vertical;
    min-height: 90px;
}

.osv-ob .btn-submit {
    background: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    min-height: 46px;
    transition: background 0.2s, opacity 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.osv-ob .btn-submit:hover:not(:disabled) {
    background: var(--accent-hover);
}

.osv-ob .btn-submit:active:not(:disabled) {
    transform: translateY(1px);
}

.osv-ob .btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.osv-ob .callout-box {
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.osv-ob .callout-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.osv-ob .callout-info {
    background: var(--accent-subtle);
    color: var(--accent-text);
    border: 1px solid var(--accent-border);
}

.osv-ob .callout-link {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    margin-left: 4px;
}

.osv-ob .progress-stepper {
    background: #faf8f6;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
    margin: 20px 0;
}

.osv-ob .stepper-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.osv-ob .step-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.osv-ob .step-row.active {
    color: var(--text);
    font-weight: 600;
}

.osv-ob .step-row.completed {
    color: var(--success);
}

.osv-ob .step-indicator {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
}

.osv-ob .step-row.active .step-indicator {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-subtle);
}

.osv-ob .step-row.completed .step-indicator {
    border-color: var(--success-border);
    color: var(--success);
    background: var(--success-subtle);
}

.osv-ob .step-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(93, 82, 75, 0.08);
    border-radius: 4px;
    padding: 2px 7px;
    margin-left: 8px;
    line-height: 1.3;
    vertical-align: middle;
}

.osv-ob .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: osv-ob-spin 0.8s linear infinite;
}

.osv-ob .spinner-accent {
    width: 14px;
    height: 14px;
    border: 2px solid var(--accent-border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: osv-ob-spin 0.8s linear infinite;
}

.osv-ob .btn-ai-generate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    min-width: 104px;
    padding: 4px 10px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.osv-ob .btn-ai-generate:hover:not(:disabled) {
    background: rgba(240, 48, 16, 0.05);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 1px 3px rgba(240, 48, 16, 0.12);
}

.osv-ob .btn-ai-generate:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: none;
}

.osv-ob .btn-ai-generate:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    background: #f8f6f4;
}

.osv-ob .btn-ai-spinner {
    width: 13px;
    height: 13px;
    border: 2px solid rgba(240, 48, 16, 0.2);
    border-top-color: var(--accent);
    border-right-color: var(--accent);
    border-radius: 50%;
    animation: osv-ob-btnAiSpin 0.7s linear infinite;
    display: inline-block;
    box-sizing: border-box;
    vertical-align: middle;
}

@keyframes osv-ob-btnAiSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.osv-ob .field-msg {
    font-size: 11px;
    margin-top: 5px;
    line-height: 1.4;
}

.osv-ob .field-msg-error {
    color: #ef4444;
}

.osv-ob .field-msg-success {
    color: #22c55e;
}

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

.osv-ob .pin-gate-wrap {
    text-align: center;
    padding: 10px 0;
}

.osv-ob .pin-gate-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--accent-subtle);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.osv-ob .pin-gate-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.osv-ob .pin-gate-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.osv-ob .pin-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 260px;
    margin: 0 auto 14px;
}

.osv-ob .pin-input {
    letter-spacing: 0.35em;
    font-size: 20px;
    text-align: center;
    font-family: var(--font-mono);
    font-weight: 700;
    padding: 10px;
    width: 100%;
}

.osv-ob .btn-unlock {
    background: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    min-height: 42px;
    width: 100%;
    transition: background 0.2s, opacity 0.2s;
}

.osv-ob .btn-unlock:hover:not(:disabled) {
    background: var(--accent-hover);
}

.osv-ob .btn-unlock:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.osv-ob .insight-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}

.osv-ob .insight-card:last-child {
    margin-bottom: 0;
}

.osv-ob .insight-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.osv-ob .insight-title-group {
    display: flex;
    flex-direction: column;
}

.osv-ob .insight-date {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 3px;
}

.osv-ob .badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.osv-ob .badge-score {
    background: var(--accent-subtle);
    color: var(--accent-text);
    border: 1px solid var(--accent-border);
}

.osv-ob .badge-success {
    background: var(--success-subtle);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.osv-ob .btn-enrich {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.osv-ob .btn-enrich:hover:not(:disabled) {
    background: var(--accent);
    color: #ffffff;
}

.osv-ob .btn-enrich:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.osv-ob .contacts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 14px;
}

.osv-ob .contacts-table th, .osv-ob .contacts-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.osv-ob .contacts-table th {
    color: var(--text-secondary);
    font-weight: 600;
    background: #fbf9f7;
}

.osv-ob .locked-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.osv-ob .insights-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.osv-ob .insights-header-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.osv-ob .badge-neutral {
    background: rgba(93, 82, 75, 0.08);
    color: var(--text);
}

.osv-ob .insight-target-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.osv-ob .insight-signal-desc {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
    margin-top: 6px;
}

.osv-ob .insight-quote {
    margin: 10px 0 12px 0;
    padding: 10px 14px;
    background: #fbf9f7;
    border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
    max-height: 140px;
    overflow-y: auto;
    word-break: break-word;
}

.osv-ob .insight-quote-title {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 4px;
    font-style: normal;
}

.osv-ob .insight-source-link {
    margin-top: 6px;
    font-size: 12px;
}

.osv-ob .insight-source-link a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.osv-ob .insight-source-link a:hover {
    text-decoration: underline;
}

.osv-ob .insight-eval {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text);
    line-height: 1.45;
    background: var(--accent-subtle);
    border: 1px solid var(--accent-border);
    padding: 10px 14px;
    border-radius: 8px;
}

.osv-ob .insight-eval-title {
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 3px;
}

.osv-ob .insight-actions {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
}

.osv-ob .contacts-section {
    margin-top: 14px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.osv-ob .contacts-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.osv-ob .duplicate-error-wrap {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.osv-ob .duplicate-error-link {
    margin-top: 6px;
}

/* ---------- WordPress-specific additions ---------- */

.osv-ob .onboarding-container { margin: 0 auto; }

.osv-ob .form-label > label { cursor: pointer; }

.osv-ob .form-input.is-invalid,
.osv-ob .form-textarea.is-invalid { border-color: #ef4444; }

.osv-ob .osv-ob-testing-flag {
    width: 100%;
    max-width: 760px;
    margin: 0 auto 10px;
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
    background: #fffbeb;
    border: 1px dashed #f59e0b;
    border-radius: 8px;
    padding: 6px 12px;
    text-align: center;
}

.osv-ob .osv-ob-linkbtn {
    background: none;
    border: 0;
    padding: 4px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: underline;
    cursor: pointer;
}
.osv-ob .osv-ob-linkbtn:hover { color: var(--accent); }

.osv-ob .contacts-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.osv-ob .contacts-table td { word-break: break-word; }
.osv-ob .contacts-table a { color: var(--accent); text-decoration: none; }

.osv-ob .insight-quote, .osv-ob .insight-signal-desc { overflow-wrap: anywhere; }
.osv-ob .insight-source-link a { overflow-wrap: anywhere; }

@media (max-width: 640px) {
    .osv-ob .onboarding-card { padding: 20px 16px; }
    .osv-ob .insight-card { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .osv-ob .spinner, .osv-ob .spinner-accent, .osv-ob .btn-ai-spinner { animation-duration: 2s; }
}

.osv-ob [data-role="pin-gate-error"] {
    max-width: 320px;
    margin: 0 auto 16px;
    justify-content: center;
    text-align: center;
}

@media (max-width: 640px) {
    .osv-ob .form-row .form-group { margin-bottom: 0; }
}

.osv-ob .step-label {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

/* Cloudflare Turnstile slots (empty and collapsed when Turnstile is off) */
.osv-ob .osv-ob-captcha {
    display: flex;
    justify-content: center;
    max-width: 100%;
    overflow: hidden;
}
.osv-ob .osv-ob-captcha:empty { display: none; }
.osv-ob .osv-ob-captcha--run { margin: 16px 0 6px; }
.osv-ob .pin-input-group .osv-ob-captcha { margin: 4px 0 6px; }


/* =========================================================
   Osserva Production Theme Overrides (Synced from osserva.io)
   ========================================================= */
.osv-ob .onboarding-card {
    border-radius: 0px !important;
    padding: 16px 30px !important;
}

.osv-ob .onboarding-title,
.osv-ob .onboarding-subtitle {
    display: none !important;
}

.osv-ob .onboarding-card .onboarding-header {
    text-align: center;
    margin-bottom: 16px;
}

.osv-ob .onboarding-card .onboarding-header:before {
    content: "Run three (3) insights for free";
    font-family: 'Inter', sans-serif !important;
    color: #fff;
    background: #228b49;
    padding: 5px 12px;
    border-radius: 10px;
    font-weight: 400 !important;
    font-size: 14px !important;
    display: inline-block;
}

.osv-ob .btn-submit {
    background: #5d524b !important;
}
.osv-ob .btn-submit:hover:not(:disabled) {
    background: #4a413b !important;
}

.osv-ob .form-row {
    margin-bottom: 8px !important;
}

.osv-ob .form-label {
    margin-bottom: 2px !important;
}

.osv-ob-captcha {
    margin: 6px 0 6px !important;
}

.osv-ob .insight-card {
    border-left: 4px solid #5d524b !important;
}

.osv-ob .btn-enrich {
    border: 1px solid #5d524b !important;
    color: #5d524b !important;
}
