/* ── Reset & Variables ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #0a0e0a;
    --bg-app: #0d120e;
    --surface: rgba(200,255,0,0.03);
    --surface-hover: rgba(200,255,0,0.06);
    --border: rgba(200,255,0,0.08);
    --border-hover: rgba(200,255,0,0.2);
    --text: #e8e8ec;
    --text-muted: #8a9a7b;
    --text-dim: #4a5a3a;
    --accent: #c8ff00;
    --accent-dim: rgba(200,255,0,0.1);
    --danger: #ff4444;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Outfit', sans-serif;
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── Glass Panel ── */
.glass-panel {
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.glass-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* ── Navigation ── */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px 24px;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-radius: var(--radius-md);
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
    cursor: pointer;
}

.logo-accent { color: var(--accent); }

#nav-cta {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#nav-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(200,255,0,0.3);
}

/* ── Hero ── */
#hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: flex-end;
    padding: 0 24px 60px;
    overflow: hidden;
}

.hero-bg-video {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero-bg-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-bg-video::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10,14,10,0.97) 0%, rgba(10,14,10,0.3) 50%, rgba(10,14,10,0.5) 100%);
}

.hero-content {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 40px;
    flex-wrap: wrap;
}

.hero-text-block { max-width: 600px; }

#hero-title {
    font-family: var(--font-body);
    font-size: clamp(36px, 6vw, 72px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: 20px;
    color: var(--accent);
    word-break: keep-all;
    overflow-wrap: normal;
    white-space: normal;
}

#hero-subtitle {
    font-size: 16px;
    color: #ffffff;
    line-height: 1.6;
    margin-bottom: 12px;
    max-width: 480px;
}

#hero-subtitle-2 {
    font-size: 14px;
    color: #ffffff;
    line-height: 1.6;
    margin-bottom: 32px;
    max-width: 480px;
    opacity: 0;
    transition: opacity 0.8s ease 0.9s;
    font-weight: 500;
}

.hero-tag {
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 300;
    letter-spacing: 3px;
    color: #ffffff;
}

/* Hero Animations */
.char-anim {
    display: inline-block;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.char-anim.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-node { opacity: 0; transition: opacity 0.8s ease 0.6s; }
.fade-node.visible { opacity: 1; }

/* ── Buttons ── */
.btn-primary {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 14px 36px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(200,255,0,0.3);
}

.btn-back {
    background: none;
    border: none;
    color: var(--text-dim);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    margin-top: 24px;
    padding: 8px 0;
    transition: color 0.2s;
}

.btn-back:hover { color: var(--text); }

/* ── App Root with Animated Gradient ── */
#app-root {
    min-height: 100vh;
    padding: 120px 24px 60px;
    position: relative;
    background: var(--bg-app);
    overflow: hidden;
}

#app-root::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(200,255,0,0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(200,255,0,0.03) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 80%, rgba(100,180,0,0.02) 0%, transparent 50%);
    animation: ambientDrift 20s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

#app-root::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 70% 30%, rgba(200,255,0,0.025) 0%, transparent 40%),
        radial-gradient(circle at 30% 70%, rgba(150,220,0,0.02) 0%, transparent 35%);
    animation: ambientDrift2 25s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

@keyframes ambientDrift {
    0% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(2%, -3%) rotate(1deg); }
    66% { transform: translate(-1%, 2%) rotate(-0.5deg); }
    100% { transform: translate(3%, 1%) rotate(0.5deg); }
}

@keyframes ambientDrift2 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-2%, 3%) scale(1.05); }
    100% { transform: translate(1%, -2%) scale(0.98); }
}

.app-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ── Steps ── */
.step { display: none; animation: stepIn 0.4s cubic-bezier(0.16,1,0.3,1) forwards; }
.step.active { display: block; }

@keyframes stepIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent);
    margin-bottom: 8px;
    font-weight: 500;
}

.step-title {
    font-family: var(--font-display);
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 32px;
}

.sub-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-dim);
    margin: 28px 0 14px;
}

/* ── Categories ── */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.cat-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 16px 12px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-transform: capitalize;
}

.cat-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    color: var(--text);
    transform: translateY(-2px);
}

.cat-btn.selected {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Location Methods ── */
.method-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.method-card {
    padding: 32px 24px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.method-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(49, 48, 48, 0.4);
}

.method-icon { font-size: 28px; margin-bottom: 16px; }
.method-label { font-size: 16px; font-weight: 600; margin-bottom: 6px; color: #ffffff; }
.method-desc { font-size: 12px; color: var(--text-dim); line-height: 1.5; }

.loc-info {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-dim);
}

/* ── Country Grid ── */
.country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.country-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideUpStagger 0.4s ease forwards;
    opacity: 0;
}

.country-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    color: var(--text);
    transform: translateY(-2px);
}

.country-btn.selected {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

.country-flag { font-size: 22px; }

@keyframes slideUpStagger {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Area Type & Area Grid ── */
.area-type-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.area-type-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.area-type-btn:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.area-type-btn.selected {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

.area-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}

.area-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    animation: slideUpStagger 0.3s ease forwards;
    opacity: 0;
}

.area-btn:hover {
    border-color: var(--border-hover);
    color: var(--text);
    transform: translateY(-1px);
}

.area-btn.selected {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Results ── */
.step-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.result-badge {
    background: var(--accent-dim);
    color: var(--accent);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-body);
    letter-spacing: 0.5px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.biz-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: all 0.25s;
}

.biz-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(200,255,0,0.06);
}

.biz-card h3 {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}

.biz-card p {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.5;
    margin-bottom: 3px;
}

.biz-card .biz-type {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 10px;
    border-radius: 6px;
    background: var(--surface-hover);
    font-size: 10px;
    color: var(--text-muted);
    text-transform: capitalize;
}

.no-results {
    text-align: center;
    color: var(--text-dim);
    padding: 60px 0;
    font-size: 14px;
}

/* ── Chat ── */
.biz-header {
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.biz-header h3 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 4px;
}

.biz-header p {
    font-size: 12px;
    color: var(--text-dim);
}

.chat-container {
    border-radius: var(--radius-lg);
    height: 500px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.06) transparent;
}

.chat-scroll::-webkit-scrollbar { width: 4px; }
.chat-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 10px; }

.msg {
    max-width: 85%;
    padding: 14px 18px;
    font-size: 13px;
    line-height: 1.6;
    border-radius: var(--radius-md);
    animation: msgIn 0.3s ease;
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg-user {
    align-self: flex-end;
    background: var(--accent);
    color: #000;
    border-radius: var(--radius-md) var(--radius-md) 4px var(--radius-md);
}

.msg-ai {
    align-self: flex-start;
    background: var(--surface-hover);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 4px;
}

.chat-bar {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

#chat-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(200,255,0,0.08);
}

#chat-input::placeholder { color: var(--text-dim); }

.btn-send {
    background: var(--accent);
    color: #000;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(200,255,0,0.3);
}

.btn-send:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Copy button */
.copy-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 14px;
    background: rgba(200,255,0,0.08);
    color: var(--accent);
    border: 1px solid rgba(200,255,0,0.15);
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.copy-btn:hover { background: rgba(200,255,0,0.15); }

/* ── Error Toast ── */
.error-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,68,68,0.15);
    border: 1px solid rgba(255,68,68,0.3);
    color: var(--danger);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    z-index: 200;
    backdrop-filter: blur(12px);
}

/* ── Loader ── */
.loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,14,10,0.9);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.results-hint {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 16px;
    font-family: var(--font-body);
}

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

.hidden { display: none !important; }

/* ── Responsive ── */
/* ── Mobile Responsive (iPhone 14 Pro: 393px viewport) ── */
@media (max-width: 768px) {
    /* Nav */
    #main-nav { padding: 10px 12px; }
    .nav-inner { padding: 8px 12px; }
    .nav-logo { font-size: 14px; }
    #nav-cta { padding: 6px 14px; font-size: 11px; }

    /* Hero */
    #hero-section { padding: 0 16px 32px; }
    .hero-content { flex-direction: column; align-items: flex-start; gap: 20px; }
    .hero-text-block { max-width: 100%; }

    #hero-title {
        font-size: 32px !important;
        letter-spacing: -1px;
        line-height: 1.15;
    }
    #hero-title div { white-space: normal !important; }

    #hero-subtitle { font-size: 14px; max-width: 100%; }
    #hero-subtitle-2 { font-size: 12px; max-width: 100%; }
    .btn-primary { padding: 12px 28px; font-size: 13px; width: 100%; text-align: center; }
    .hero-tag { font-size: 12px; letter-spacing: 1.5px; padding: 10px 16px; }
    #hero-badge { width: 100%; display: flex; justify-content: center; }

    /* App */
    #app-root { padding: 80px 14px 40px; }

    /* Steps */
    .step-title { font-size: 22px; letter-spacing: -0.5px; margin-bottom: 20px; }
    .step-label { font-size: 10px; letter-spacing: 2px; }
    .sub-title { font-size: 11px; margin: 20px 0 10px; }

    /* Categories */
    .cat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .cat-btn { padding: 14px 8px; font-size: 12px; }

    /* Location Methods */
    .method-grid { grid-template-columns: 1fr; gap: 10px; }
    .method-card { padding: 24px 18px; }
    .method-icon { font-size: 24px; margin-bottom: 10px; }
    .method-label { font-size: 15px; }
    .method-desc { font-size: 11px; }

    /* Countries */
    .country-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .country-btn { padding: 12px 14px; font-size: 13px; }
    .country-flag { font-size: 20px; }

    /* Area Types */
    .area-type-grid { gap: 6px; }
    .area-type-btn { padding: 8px 14px; font-size: 12px; }

    /* Areas */
    .area-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    .area-btn { padding: 10px 10px; font-size: 11px; }

    /* Results */
    .step-header { flex-direction: column; gap: 8px; }
    .results-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .biz-card { padding: 16px; }
    .biz-card h3 { font-size: 14px; }
    .biz-card p { font-size: 11px; }
    .result-badge { font-size: 10px; padding: 4px 10px; }

    /* Chat */
    .biz-header { padding: 14px; }
    .biz-header h3 { font-size: 14px; }
    .biz-header p { font-size: 11px; }

    .chat-container { height: calc(100vh - 280px); min-height: 350px; border-radius: var(--radius-md); }
    .chat-scroll { padding: 14px; gap: 10px; }

    .msg {
        max-width: 92%;
        padding: 12px 14px;
        font-size: 12px;
        line-height: 1.55;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .chat-bar { padding: 10px; gap: 8px; }
    #chat-input { padding: 10px 12px; font-size: 13px; }
    .btn-send { width: 40px; height: 40px; }
    .btn-send svg { width: 16px; height: 16px; }

    .copy-btn { font-size: 9px; padding: 3px 10px; }

    /* Back buttons */
    .btn-back { font-size: 12px; margin-top: 18px; }

    /* Error toast */
    .error-toast {
        left: 14px;
        right: 14px;
        transform: none;
        font-size: 12px;
        padding: 10px 16px;
    }
}

/* Extra small (iPhone SE, older devices) */
@media (max-width: 375px) {
    #hero-title { font-size: 28px !important; }
    .cat-grid { grid-template-columns: repeat(2, 1fr); }
    .area-grid { grid-template-columns: 1fr; }
    .step-title { font-size: 20px; }
    .method-card { padding: 20px 14px; }
}