@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
    --bg-body: #030712;
    --bg-panel: #0f172a;
    --bg-panel-alt: #111b2f;
    --bg-card: #131f3c;
    --bg-soft: rgba(148, 163, 184, 0.08);
    --border-soft: rgba(148, 163, 184, 0.15);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #38bdf8;
    --accent-strong: #22d3ee;
    --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #6366f1 100%);
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --card-shadow: 0 30px 80px rgba(3, 7, 18, 0.65);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: radial-gradient(circle at top, #0f172a 0%, #030712 60%);
    min-height: 100vh;
    padding: 24px;
    color: var(--text-primary);
}

.container {
    max-width: 960px;
    margin: 0 auto;
    background: var(--bg-panel);
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-soft);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(99, 102, 241, 0.25));
    padding: 28px 36px;
    border-bottom: 1px solid var(--border-soft);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-left {
    flex: 1;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.contact-button {
    width: auto;
    padding: 10px 18px;
    font-size: 0.95rem;
    background: rgba(34, 211, 238, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.5);
    border-radius: 12px;
    color: var(--text-primary);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.contact-button:hover {
    background: rgba(34, 211, 238, 0.25);
    border-color: rgba(34, 211, 238, 0.8);
    transform: translateY(-1px);
}

.header-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 6px;
}

.header p {
    color: var(--text-secondary);
}

.site-url-header {
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(16px);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.95rem;
    border: 1px solid var(--border-soft);
    max-width: 320px;
    word-break: break-word;
}

.site-url-header.hidden {
    display: none;
}

.content {
    padding: 40px 42px 48px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.step {
    margin-bottom: 36px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.step.visible {
    opacity: 1;
    transform: translateY(0);
}

.step.fade-out {
    opacity: 0;
    transform: translateY(10px);
}

.step.hidden {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-soft);
}

.step-number {
    background: var(--accent-gradient);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    box-shadow: 0 10px 30px rgba(34, 211, 238, 0.35);
}

.step-title {
    font-size: 1.4rem;
}

.step-subtitle {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 22px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

input[type="url"],
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    background: rgba(15, 23, 42, 0.65);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(34, 211, 238, 0.15);
}

input.error-state,
textarea.error-state {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.1);
}

input.error-state:focus,
textarea.error-state:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
}

.url-error-message {
    margin-top: 8px;
    padding: 10px 14px;
    background: rgba(248, 113, 113, 0.1);
    border-left: 3px solid var(--danger);
    border-radius: 8px;
    color: var(--danger);
    font-size: 0.9rem;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 8px;
}

.url-error-message::before {
    content: "⚠️";
    font-size: 1rem;
}

button {
    background: radial-gradient(circle at 20% 20%, #38bdf8, #6366f1);
    color: #fff;
    border: none;
    padding: 14px 24px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 18px 30px rgba(14, 165, 233, 0.35);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.progress-container {
    margin: 24px 0;
    padding: 20px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-soft);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    width: 0%;
    transition: width 0.4s ease;
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-weight: 500;
}

.cat-animation {
    text-align: center;
    margin-top: 24px;
}

.cat-animation img {
    max-width: 220px;
    height: auto;
}

.cat-animation.hidden {
    display: none;
}

.recommendations-animation {
    text-align: center;
    margin: 28px 0;
}

.recommendations-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.recommendations-animation img {
    max-width: 200px;
    height: auto;
}

.recommendations-animation.hidden {
    display: none;
}

.loading-spinner {
    display: inline-flex;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(56, 189, 248, 0.35);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin-right: 8px;
}

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

.result-card,
.position-info,
.lead-form,
.recommendations-summary,
.recommendation-card,
.demo-note,
.manual-review-alert {
    background: var(--bg-panel-alt);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-soft);
    box-shadow: 0 10px 40px rgba(8, 15, 40, 0.35);
}

.result-card {
    margin-top: 20px;
}

.keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 18px 0;
}

.keyword-badge {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent);
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.95rem;
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.position-info {
    margin-top: 18px;
    border-left: 4px solid var(--accent);
}

.position-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 600;
    margin: 6px 6px 0 0;
}

.position-good { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.position-medium { background: rgba(251, 191, 36, 0.15); color: var(--warning); }
.position-bad { background: rgba(248, 113, 113, 0.15); color: var(--danger); }
.position-unavailable { background: rgba(148, 163, 184, 0.15); color: var(--text-secondary); }

.checking-indicator {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--accent);
    font-weight: 600;
    margin-top: 18px;
}

.recommendations-summary {
    margin-top: 20px;
}

.recommendations-summary .summary-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 10px;
}

.recommendations-grid {
    display: grid;
    gap: 18px;
    margin-top: 22px;
}

.recommendation-card {
    border-left: 3px solid var(--accent);
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.recommendation-card h4 {
    margin-bottom: 12px;
}

.recommendation-meta,
.recommendation-meta-inline {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.recommendation-meta-inline {
    margin-bottom: 10px;
}

.recommendation-meta .meta-label,
.recommendation-meta-inline strong {
    color: var(--text-primary);
}

.recommendation-card.pending {
    opacity: 0;
    transform: translateY(12px);
}

.recommendation-text p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.manual-review-alert {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-top: 20px;
    border-left: 3px solid var(--warning);
}

.manual-review-icon {
    font-size: 1.8rem;
}

.manual-review-title {
    font-weight: 600;
    margin-bottom: 6px;
}

.manual-review-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.manual-review-alert.hidden {
    display: none;
}

.features-subtitle {
    margin-top: 32px;
    color: var(--text-secondary);
    font-size: 1rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin: 32px 0;
}

.feature-card {
    background: var(--bg-panel-alt);
    border-radius: 18px;
    padding: 26px;
    border: none;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 8px 20px rgba(4, 6, 16, 0.35);
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 40px rgba(4, 6, 16, 0.6);
}

.feature-icon {
    font-size: 2.6rem;
    margin-bottom: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    text-shadow: 0 10px 25px rgba(34, 211, 238, 0.35);
}

.lead-form {
    margin-top: 26px;
}

.lead-form form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px 18px;
}

.lead-form .form-group {
    margin-bottom: 0;
}

.lead-form .form-group.full-width {
    grid-column: 1 / -1;
}

.lead-form button {
    grid-column: 1 / -1;
}

.consent-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(15, 23, 42, 0.65);
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.checkbox input {
    margin-top: 3px;
}

.checkbox.optional span {
    color: var(--text-secondary);
}

.error {
    background: rgba(248, 113, 113, 0.08);
    border-left: 4px solid var(--danger);
    color: var(--danger);
    margin-top: 16px;
}

.success {
    background: rgba(52, 211, 153, 0.08);
    border-left: 4px solid var(--success);
    color: var(--success);
    margin-top: 16px;
}

.collapse-button {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-primary);
    border: 1px solid var(--border-soft);
    padding: 12px 18px;
    border-radius: 12px;
    margin-top: 24px;
}

.collapse-button:hover {
    background: rgba(148, 163, 184, 0.25);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.collapsible-content.expanded {
    max-height: 5000px;
}

.demo-complete {
    margin-bottom: 32px;
    background: linear-gradient(135deg, rgba(15, 118, 232, 0.15), rgba(99, 102, 241, 0.15));
    border-radius: 20px;
    padding: 28px;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.demo-complete-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.demo-complete-left {
    flex: 1 1 320px;
}

.demo-complete-right {
    flex: 1 1 220px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.18);
    color: var(--success);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    margin-bottom: 16px;
}

.demo-complete h2 {
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.demo-complete p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.demo-complete-list {
    margin-top: 16px;
    padding-left: 18px;
    color: var(--text-primary);
    line-height: 1.6;
}

.demo-note {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.demo-note-icon {
    font-size: 1.9rem;
    text-shadow: 0 12px 25px rgba(34, 211, 238, 0.35);
}

.demo-note-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.demo-note-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.code-block {
    margin: 18px 0;
    border-radius: 14px;
    background: #050b16;
    border: 1px solid rgba(59, 130, 246, 0.35);
    overflow: hidden;
    position: relative;
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
}

.code-language {
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.copy-snippet {
    width: auto;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    border: 1px solid rgba(59, 130, 246, 0.4);
    background: rgba(56, 189, 248, 0.08);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.copy-snippet:hover {
    background: rgba(56, 189, 248, 0.2);
}

.code-block pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #f8fafc;
}

.code-block code {
    display: block;
    white-space: pre;
}

.code-block-message {
    padding: 18px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.code-block.empty .copy-snippet {
    opacity: 0.5;
    pointer-events: none;
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--text-primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 9999;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.toast.hidden {
    opacity: 0;
    pointer-events: none;
}

.contact-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.contact-modal.hidden {
    display: none;
}

.contact-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 18, 0.7);
    backdrop-filter: blur(6px);
}

.contact-modal-content {
    position: relative;
    background: var(--bg-panel);
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    padding: 30px;
    width: min(320px, 90vw);
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    z-index: 1;
}

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

.contact-caption {
    font-weight: 600;
    margin: 0;
    text-align: left;
}

.contact-close {
    border: none;
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.contact-close:hover {
    background: rgba(148, 163, 184, 0.3);
    color: var(--text-primary);
}

.contact-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--accent-gradient);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 15px 25px rgba(34, 211, 238, 0.35);
}

.contact-subtext {
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .container {
        border-radius: 18px;
    }

    .content {
        padding: 28px 20px 32px;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
}
