:root {
    --st-bg: #0a0e17;
    --st-surface: #111827;
    --st-surface-2: #1a2236;
    --st-border: #2a3550;
    --st-border-strong: #475569;
    --st-text: #f1f5f9;
    --st-muted: #a3b1c6;
    --st-primary: #3b82f6;
    --st-primary-hover: #2563eb;
    --st-success: #10b981;
    --st-success-hover: #059669;
    --st-danger: #f87171;
    --st-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

[hidden] {
    display: none !important;
}

body {
    background-color: var(--st-bg);
    color: var(--st-text);
    line-height: 1.6;
}

i.fas, i.far {
    font-family: "Font Awesome 6 Free";
}

/* ---------- layout ---------- */

.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 24px 16px;
    text-align: center;
}

.breadcrumb {
    font-size: 14px;
    color: #fff;
    margin-bottom: 10px;
}

h1 {
    font-size: clamp(1.6rem, 5vw, 2rem);
    margin-bottom: 24px;
    font-weight: 700;
}

.tool-box {
    background: var(--st-surface);
    border: 2px dashed var(--st-border);
    border-radius: var(--st-radius);
    padding: 40px 20px;
    margin-bottom: 30px;
    transition: border-color .2s, background .2s;
}

.tool-box:hover,
.tool-box.is-dragover {
    border-color: var(--st-primary);
    background: var(--st-surface-2);
}

.step-icon {
    display: block;
    margin-bottom: 20px;
    font-size: 50px;
    color: var(--st-primary);
}

.step-icon.is-success {
    margin-bottom: 15px;
    color: var(--st-success);
}

.step-title {
    margin: 0 0 10px;
    color: var(--st-primary);
    word-break: break-word;
}

.step-title.is-done {
    margin: 15px 0;
    color: var(--st-text);
}

.step-note {
    margin-top: 10px;
    font-size: 12px;
    color: var(--st-muted);
}

/* ---------- buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--st-primary);
    color: #fff;
    border: 1px solid var(--st-primary);
    border-radius: 8px;
    padding: 14px 28px;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .15s;
}

.btn:hover {
    background: var(--st-primary-hover);
    border-color: var(--st-primary-hover);
    transform: translateY(-1px);
}

.btn.is-success {
    background: var(--st-success);
    border-color: var(--st-success);
}

.btn.is-success:hover {
    background: var(--st-success-hover);
    border-color: var(--st-success-hover);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    background: var(--st-surface-2);
    color: #e2e8f0;
    border: 1px solid var(--st-border-strong);
    border-radius: 8px;
    padding: 10px 22px;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}

.btn-outline:hover {
    background: #223049;
    border-color: #60a5fa;
    color: #fff;
}

.btn-outline.is-danger {
    background: rgba(248, 113, 113, .1);
    border-color: rgba(248, 113, 113, .55);
    color: #fca5a5;
}

.btn-outline.is-danger:hover {
    background: rgba(248, 113, 113, .2);
    border-color: var(--st-danger);
    color: #fff;
}

.btn:focus-visible,
.btn-outline:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
}

/* ---------- image preview (checkerboard shows transparency) ---------- */

.preview {
    display: block;
    max-width: 100%;
    max-height: 320px;
    margin: 0 auto 20px;
    border: 1px solid var(--st-border);
    border-radius: 8px;
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #cbd5e1 25%, transparent 25%, transparent 75%, #cbd5e1 75%),
        linear-gradient(45deg, #cbd5e1 25%, transparent 25%, transparent 75%, #cbd5e1 75%);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}

/* ---------- processing ---------- */

.loader {
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
    border: 4px solid var(--st-border);
    border-top-color: var(--st-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.status-text {
    color: var(--st-muted);
}

.progress-bar {
    width: 100%;
    max-width: 400px;
    height: 10px;
    margin: 20px auto;
    background: var(--st-bg);
    border: 1px solid var(--st-border);
    border-radius: 20px;
    overflow: hidden;
}

.progress-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    transition: width .3s ease;
}

/* ---------- SEO content ---------- */

.seo-content {
    max-width: 680px;
    margin: 40px auto 10px;
    text-align: left;
    line-height: 1.7;
}

.seo-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 32px 0 12px;
}

.seo-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 20px 0 6px;
}

.seo-content p,
.seo-content li {
    color: var(--st-muted);
    font-size: .95rem;
}

.seo-content p {
    margin-bottom: 10px;
}

.seo-content ol,
.seo-content ul {
    padding-left: 22px;
    margin-bottom: 8px;
}

.seo-content li {
    margin-bottom: 6px;
}

.seo-content strong {
    color: #e2e8f0;
    font-weight: 600;
}

/* ---------- responsive / motion ---------- */

@media (max-width: 480px) {
    .tool-box {
        padding: 28px 14px;
    }

    .btn {
        padding: 13px 18px;
        font-size: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .loader {
        animation-duration: 3s;
    }

    .btn,
    .btn-outline,
    .tool-box {
        transition: none;
    }
}

/* outline buttons: same light blue tint as option cards */
button.btn-outline:not(:hover) {
    background: rgba(59, 130, 246, .12);
    border-color: rgba(59, 130, 246, .45);
    color: #e2e8f0;
}
button.btn-outline:hover:not(:disabled) {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

/* ---------- shared image stage: shine runs inside the image only ---------- */

.scan-wrap {
    position: relative;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 20px;
}

.scan-clip {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    line-height: 0;
}

.scan-clip .preview {
    margin: 0;
}

.scan-shine {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-100%);
    background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .6) 50%, transparent 65%);
}

.scan-wrap.is-scanning .scan-shine {
    opacity: 1;
    animation: scanShine 1.6s ease-in-out infinite;
}

#processingView.is-processing .progress-bar {
    display: none;
}

@keyframes scanShine {
    to { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
    .scan-wrap.is-scanning .scan-shine {
        animation: none;
    }
}

/* ST-TEXT-RESPONSIVE */
.description,
.seo-content {
    box-sizing: border-box;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    max-width: 1100px;
    margin-left: 0;
    margin-right: 0;
    padding-left: clamp(16px, 4vw, 40px);
    padding-right: clamp(16px, 4vw, 40px);
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
}
.seo-content { margin-top: 40px; margin-bottom: 10px; }
.description { margin-top: 0; margin-bottom: 25px; }
.seo-content h2 { font-size: clamp(1.1rem, 2.2vw, 1.4rem); }
.seo-content p, .seo-content li { font-size: clamp(.9rem, 1.4vw, 1rem); }
@media (min-width: 900px) {
    .seo-content ol, .seo-content ul { padding-left: 28px; }
}
