.app-overlay {
    --bg: #ffffff;
    --bg-card: #f8fafc;
    --bg-hover: #f1f5f9;
    --border: rgba(15, 23, 42, 0.08);
    --border-bright: rgba(37, 99, 235, 0.2);
    --text: #0f172a;
    --text-2: #475569;
    --accent: #2563eb;
    --cta: #0f172a; /* Slate 900 for Primary Button */
    --cta-dim: rgba(15, 23, 42, 0.05);
    --green: #10b981;
    --green-dim: rgba(16, 185, 129, 0.1);
    --curve: cubic-bezier(0.4, 0, 0.2, 1);

    position: fixed; inset: 0; z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    display: flex; flex-direction: column; align-items: center;
    opacity: 0; pointer-events: none; transform: translateY(20px) scale(0.98);
    transition: all 0.5s var(--curve);
    color: var(--text);
    font-family: var(--font-sans, 'Inter', sans-serif);
}
.app-overlay.open { opacity: 1; pointer-events: all; transform: translateY(0) scale(1); }

.app-header {
    width: 100%; max-width: 700px; display: flex; align-items: center; justify-content: space-between;
    padding: 32px 24px; margin-bottom: 20px;
}
.app-progress-container { width: 100%; height: 4px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; margin-right: 32px; }
.app-progress-bar { height: 100%; width: 0%; background: var(--cta); transition: width 0.6s var(--curve); }
.app-close {
    background: none; border: none; color: var(--text-2); font-size: 1.5rem; cursor: pointer; transition: color 0.2s;
}
.app-close:hover { color: #fff; }

.app-viewport {
    width: 100%; max-width: 700px; padding: 0 24px; position: relative; flex-grow: 1; display: flex; flex-direction: column; justify-content: center;
}
.app-step {
    position: absolute; left: 24px; right: 24px; top: 50%; transform: translateY(-50%) translateX(40px);
    opacity: 0; display: none; /* fix stacking visibility */ pointer-events: none; transition: all 0.5s var(--curve);
}
.app-step.active { opacity: 1; display: block; pointer-events: all; transform: translateY(-50%) translateX(0); }
.app-step.fade-out { opacity: 0; display: block; transform: translateY(-50%) translateX(-40px); }

.app-step h2 { font-size: 1.8rem; font-weight: 800; margin-bottom: 32px; letter-spacing: -0.02em; }

.app-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.app-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
    padding: 24px; text-align: left; cursor: pointer; transition: all 0.2s; color: var(--text);
    display: flex; flex-direction: column; gap: 8px; font-family: inherit; width: 100%;
}
.app-card:hover { background: var(--bg-hover); border-color: var(--border-bright); transform: translateY(-2px); }
.app-card:active { transform: scale(0.98); }
.app-card.selected { border-color: var(--cta); background: var(--cta-dim); }
.app-card span { font-size: 1.8rem; margin-bottom: 4px; }
.app-card strong { font-weight: 700; font-size: 1rem; }
.app-card p { color: var(--text-2); font-size: 0.85rem; margin: 0; line-height: 1.5; }

/* ===== DOMAIN CAPTURE ===== */
.domain-capture p { color: var(--text-2); margin-bottom: 32px; }
.input-group {
    display: flex; align-items: center; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: 12px; padding: 0 20px;
    margin-bottom: 24px; overflow: hidden; transition: border-color 0.2s;
}
.input-group:focus-within { border-color: var(--cta); }
.url-prefix { color: var(--text-2); font-family: var(--font-mono, monospace); padding-right: 8px; font-size: 1.05rem; }
.input-group input {
    background: none; border: none; color: var(--text); font-family: var(--font-mono, monospace); font-size: 1.05rem;
    padding: 24px 0; width: 100%; outline: none;
}
.error-msg { color: #f87171; font-size: 0.85rem; margin-top: 12px; display: none; }

/* ===== TERMINAL SCANNER ===== */
.terminal-box {
    background: #000; border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
    font-family: var(--font-mono, monospace); font-size: 0.85rem; height: 350px; display: flex; flex-direction: column;
}
.terminal-header {
    background: var(--bg-card); padding: 12px 20px; color: var(--text-2); font-size: 0.75rem; letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}
.terminal-body {
    padding: 24px; flex-grow: 1; overflow-y: auto; color: var(--green); white-space: pre-wrap;
    display: flex; flex-direction: column; gap: 8px;
}
.t-line { opacity: 0; animation: typeIn 0.3s forwards; }
.t-line.warn { color: #facc15; }
.t-line.err { color: #f87171; }
@keyframes typeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* ===== FINAL LEAD CAPTURE ===== */
.final-capture { text-align: center; }
.success-icon {
    width: 64px; height: 64px; background: var(--green-dim); color: var(--green);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 2rem; margin: 0 auto 24px;
}
.final-capture h2 { margin-bottom: 16px; font-size: 2rem; }
.final-capture p { color: var(--text-2); margin-bottom: 40px; font-size: 1.05rem; }

.lead-form { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 32px; text-align: left; }
.lead-form label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 12px; }
.lead-form input {
    width: 100%; background: var(--bg-primary, #ffffff); border: 1px solid var(--border); border-radius: 8px;
    padding: 16px 20px; color: var(--text); font-size: 1rem; font-family: inherit; outline: none; margin-bottom: 24px;
    transition: border-color 0.2s; box-sizing: border-box;
}
.lead-form input:focus { border-color: var(--accent); }

.w-full { width: 100%; display: flex; }
/* Reset main button inside overlay to avoid conflict with main page buttons */
.app-overlay .call-to-action-btn {
    display: flex; align-items: center; justify-content: center; gap: 16px;
    padding: 18px 32px; border-radius: 12px;
    background: var(--cta); color: #ffffff;
    font-size: 1.1rem; font-weight: 800; cursor: pointer; border: none;
    font-family: inherit; transition: all 0.3s var(--curve);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1); width: 100%; text-decoration: none;
}
.app-overlay .call-to-action-btn:hover {
    transform: translateY(-2px); box-shadow: 0 15px 35px rgba(15, 23, 42, 0.15);
}
.app-overlay .cta-green { background: var(--green); color: #ffffff; }
.app-overlay .cta-green:hover { box-shadow: 0 15px 35px rgba(16, 185, 129, 0.2); }
.app-close-text {
    display: block; width: 100%; text-align: center;
    color: var(--text-2); font-size: 0.9rem; margin-top: 16px;
    text-decoration: underline; cursor: pointer; border: none; background: none; font-family: inherit;
}
.app-close-text:hover { color: var(--text); }
