/* ═══════════════════════════════════════════
   SiteDiv Tools — Core Styles
   Works standalone, no theme dependency required
   ═══════════════════════════════════════════ */

.sdt-wrap {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    color: #334155;
    line-height: 1.6;
    max-width: 960px;
    margin: 0 auto;
}

.sdt-wrap *, .sdt-wrap *::before, .sdt-wrap *::after {
    box-sizing: border-box;
}

/* ── Tool Card ── */
.sdt-tool-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

@media (max-width: 640px) {
    .sdt-tool-card { padding: 1.5rem; border-radius: 16px; }
}

/* ── Inputs ── */
.sdt-input,
.sdt-textarea,
.sdt-select {
    width: 100%;
    padding: 0.875rem 1.125rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: #1e293b;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.2s;
    outline: none;
}

.sdt-input:focus,
.sdt-textarea:focus,
.sdt-select:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

.sdt-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.sdt-label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.sdt-field {
    margin-bottom: 1.25rem;
}

.sdt-field-row {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.sdt-field-row .sdt-input {
    flex: 1;
}

/* ── Buttons ── */
.sdt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1;
    border-radius: 999px;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    white-space: nowrap;
}

.sdt-btn-primary {
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: #fff;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.25);
}

.sdt-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.35);
    color: #fff;
}

.sdt-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.sdt-btn-ghost {
    background: transparent;
    color: #475569;
    border-color: #e2e8f0;
}

.sdt-btn-ghost:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #1e293b;
}

.sdt-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
}

/* ── Results ── */
.sdt-results {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.sdt-results-heading {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 1rem;
    font-family: 'Sora', system-ui, sans-serif;
}

/* ── Score Display ── */
.sdt-score-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc, #fff);
    border-radius: 16px;
    margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
    .sdt-score-circle { flex-direction: column; gap: 1rem; padding: 1.5rem; text-align: center; }
}

.sdt-score-number {
    font-family: 'Sora', system-ui, sans-serif;
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sdt-score-label {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.sdt-score-grade {
    font-family: 'Sora', system-ui, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

/* ── Checklist ── */
.sdt-check-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sdt-check-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: 0.9rem;
}

.sdt-check-item.pass {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.sdt-check-item.fail {
    background: #fef2f2;
    border-color: #fecaca;
}

.sdt-check-item.warn {
    background: #fffbeb;
    border-color: #fde68a;
}

.sdt-check-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.sdt-check-item.pass .sdt-check-icon { background: #22c55e; color: #fff; }
.sdt-check-item.fail .sdt-check-icon { background: #ef4444; color: #fff; }
.sdt-check-item.warn .sdt-check-icon { background: #f59e0b; color: #fff; }

.sdt-check-content {
    flex: 1;
    min-width: 0;
}

.sdt-check-title {
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 0.25rem;
    font-size: 0.92rem;
}

.sdt-check-detail {
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.5;
    word-break: break-word;
}

/* ── Info Grid ── */
.sdt-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.sdt-info-card {
    padding: 1rem 1.125rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.sdt-info-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.sdt-info-value {
    font-family: 'Sora', system-ui, sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
}

/* ── Generated Suggestions ── */
.sdt-suggestion {
    padding: 1rem 1.125rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    transition: all 0.2s;
}

.sdt-suggestion:hover {
    border-color: #0ea5e9;
    background: #f0f9ff;
}

.sdt-suggestion-text {
    flex: 1;
    color: #1e293b;
    font-size: 0.92rem;
    line-height: 1.5;
}

.sdt-copy-btn {
    flex-shrink: 0;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #0ea5e9;
    background: #fff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.sdt-copy-btn:hover {
    background: #0ea5e9;
    color: #fff;
}

.sdt-copy-btn.copied {
    background: #22c55e;
    border-color: #22c55e;
    color: #fff;
}

/* ── Char Counter ── */
.sdt-counter {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.4rem;
}

.sdt-counter.warn { color: #f59e0b; }
.sdt-counter.over { color: #ef4444; font-weight: 600; }
.sdt-counter.good { color: #22c55e; }

/* ── Loading ── */
.sdt-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 1rem;
    color: #64748b;
    font-size: 0.9rem;
}

.sdt-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: #0ea5e9;
    border-radius: 50%;
    animation: sdt-spin 0.8s linear infinite;
}

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

/* ── Disclaimer ── */
.sdt-disclaimer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    font-size: 0.82rem;
    color: #92400e;
    margin-top: 1.25rem;
}

/* ── Error ── */
.sdt-error {
    padding: 1rem 1.25rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #991b1b;
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* ── Intro ── */
.sdt-intro {
    margin-bottom: 1.5rem;
}

.sdt-intro-title {
    font-family: 'Sora', system-ui, sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.5rem;
}

.sdt-intro-desc {
    color: #64748b;
    font-size: 0.95rem;
    margin: 0;
}

/* ── Tabs ── */
.sdt-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: #f1f5f9;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.sdt-tab {
    flex: 1;
    padding: 0.625rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.sdt-tab.active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ═══════════════════════════════════════════
   CTA BLOCK — Below every tool (v2: more engaging)
   ═══════════════════════════════════════════ */

.sdt-cta-block {
    margin-top: 2.5rem;
    padding: 3rem 3.25rem;
    background: linear-gradient(135deg, #050a18 0%, #0f172a 50%, #1e1b4b 100%);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.sdt-cta-glow {
    position: absolute;
    top: -50%;
    right: -10%;
    width: 70%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(14, 165, 233, 0.22), transparent 60%);
    pointer-events: none;
    z-index: -1;
}

.sdt-cta-block::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -10%;
    width: 50%;
    height: 150%;
    background: radial-gradient(ellipse at center, rgba(249, 115, 22, 0.12), transparent 60%);
    pointer-events: none;
    z-index: -1;
}

.sdt-cta-inner {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3rem;
    align-items: center;
}

@media (max-width: 720px) {
    .sdt-cta-block { padding: 2.25rem 1.75rem; }
    .sdt-cta-inner { grid-template-columns: 1fr; gap: 2rem; }
}

.sdt-cta-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #7dd3fc;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.9rem;
}

.sdt-cta-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: sdt-pulse 2s infinite;
}

@keyframes sdt-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.sdt-cta-heading {
    font-family: 'Sora', system-ui, sans-serif;
    font-size: 1.65rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 0.75rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    max-width: 560px;
}

@media (max-width: 720px) {
    .sdt-cta-heading { font-size: 1.35rem; }
}

.sdt-cta-desc {
    font-size: 0.95rem;
    color: #cbd5e1;
    margin: 0 0 1.5rem;
    line-height: 1.6;
    max-width: 520px;
}

.sdt-cta-proof {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem 1.5rem;
    margin-top: 0.75rem;
}

.sdt-cta-proof-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: #94a3b8;
    font-weight: 500;
}

.sdt-cta-proof-item svg {
    color: #22c55e;
    flex-shrink: 0;
}

.sdt-cta-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-end;
}

@media (max-width: 720px) {
    .sdt-cta-actions { align-items: stretch; }
}

.sdt-btn-cta {
    padding: 1rem 1.75rem;
    font-size: 0.92rem;
    font-weight: 700;
}

.sdt-btn-cta.sdt-btn-primary {
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.sdt-btn-cta.sdt-btn-primary:hover {
    box-shadow: 0 12px 32px rgba(14, 165, 233, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.sdt-cta-block .sdt-btn-ghost {
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.03);
}

.sdt-cta-block .sdt-btn-ghost:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sdt-cta-micro {
    font-size: 0.72rem;
    color: #64748b;
    text-align: right;
    margin-top: 0.25rem;
    letter-spacing: 0.01em;
}

@media (max-width: 720px) {
    .sdt-cta-micro { text-align: center; }
}

/* ── Progress Bar ── */
.sdt-progress {
    width: 100%;
    height: 8px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.sdt-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0ea5e9, #6366f1);
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.sdt-progress-fill.red { background: linear-gradient(90deg, #ef4444, #f97316); }
.sdt-progress-fill.yellow { background: linear-gradient(90deg, #f59e0b, #eab308); }
.sdt-progress-fill.green { background: linear-gradient(90deg, #22c55e, #10b981); }

/* ═══════════════════════════════════════════
   SAVE RESULT BLOCK (above CTA)
   ═══════════════════════════════════════════ */

.sdt-save-block {
    margin-top: 1.5rem;
    background: linear-gradient(135deg, #f0f9ff, #fdf4ff);
    border: 1px solid #bae6fd;
    border-radius: 16px;
    padding: 1.5rem 1.75rem;
}

.sdt-save-inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sdt-save-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    color: #0369a1;
}

.sdt-save-header svg {
    flex-shrink: 0;
}

.sdt-save-title {
    font-family: 'Sora', system-ui, sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0c4a6e;
    line-height: 1.3;
}

.sdt-save-subtitle {
    font-size: 0.85rem;
    color: #0284c7;
    margin-top: 0.15rem;
}

.sdt-save-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sdt-save-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.sdt-save-form .sdt-input {
    flex: 1;
    min-width: 220px;
}

.sdt-save-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: #0284c7;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.5rem 0;
    font-family: inherit;
    font-weight: 600;
    transition: color 0.15s;
    width: 100%;
    flex-basis: 100%;
}

.sdt-save-back:hover { color: #0369a1; }

.sdt-save-success {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    color: #065f46;
    font-size: 0.9rem;
}

.sdt-save-success > svg + span,
.sdt-save-success > :first-child {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.sdt-save-permalink {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.sdt-save-permalink .sdt-input {
    flex: 1;
    font-size: 0.82rem;
    padding: 0.5rem 0.75rem;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}

@media (max-width: 640px) {
    .sdt-save-block { padding: 1.25rem; }
    .sdt-save-actions .sdt-btn,
    .sdt-save-form .sdt-btn { flex: 1; }
}

/* ═══════════════════════════════════════════
   EXIT INTENT MODAL
   ═══════════════════════════════════════════ */

.sdt-exit-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 24, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-family: 'DM Sans', system-ui, sans-serif;
}

.sdt-exit-overlay.visible {
    opacity: 1;
}

.sdt-exit-modal {
    background: #fff;
    border-radius: 20px;
    padding: 2.5rem 2rem 2rem;
    max-width: 440px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sdt-exit-overlay.visible .sdt-exit-modal {
    transform: translateY(0) scale(1);
}

.sdt-exit-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.15s;
}

.sdt-exit-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.sdt-exit-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #f0f9ff, #fdf4ff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sdt-exit-title {
    font-family: 'Sora', system-ui, sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.5rem;
}

.sdt-exit-desc {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.55;
    margin: 0 0 1.5rem;
}

.sdt-exit-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sdt-exit-actions .sdt-btn {
    width: 100%;
    justify-content: center;
}
