/* ============================================================
   AllInOneDL  —  Premium Design
   ============================================================ */

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

:root {
    --bg:       #05050f;
    --bg2:      #0c0c1e;
    --bg3:      #111128;
    --card:     rgba(255,255,255,.03);
    --card-h:   rgba(255,255,255,.06);
    --border:   rgba(255,255,255,.07);
    --border-h: rgba(255,255,255,.14);
    --p1:       #8b5cf6;
    --p2:       #6366f1;
    --p3:       #38bdf8;
    --green:    #34d399;
    --gold:     #f59e0b;
    --red:      #f43f5e;
    --text:     #f1f5f9;
    --muted:    #64748b;
    --muted2:   #94a3b8;
    --r:        16px;
    --shadow:   0 24px 64px rgba(0,0,0,.6);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; max-width: 100%; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100vw;
    -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════
   LIGHT THEME OVERRIDES
══════════════════════════════════════════ */
[data-theme="light"] {
    --bg:       #f4f6fb;
    --bg2:      #eef0f7;
    --bg3:      #e2e6f0;
    --card:     rgba(0,0,0,.03);
    --card-h:   rgba(0,0,0,.06);
    --border:   rgba(0,0,0,.08);
    --border-h: rgba(0,0,0,.15);
    --text:     #0f172a;
    --muted:    #64748b;
    --muted2:   #475569;
    --shadow:   0 24px 64px rgba(0,0,0,.12);
}
[data-theme="light"] body::before {
    background:
        radial-gradient(ellipse 80% 50% at 10% 0%,   rgba(139,92,246,.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 90% 100%,  rgba(56,189,248,.05) 0%, transparent 60%);
}
[data-theme="light"] header {
    background: rgba(244,246,251,.88);
    box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 4px 20px rgba(0,0,0,.06);
}
[data-theme="light"] .url-input { color: var(--text); }
[data-theme="light"] .url-box::before { opacity: .25; }
[data-theme="light"] .qdl-panel { background: #fff; }
[data-theme="light"] .qdl-option:hover { background: rgba(139,92,246,.06); }
[data-theme="light"] .result-card { background: rgba(0,0,0,.02); }
[data-theme="light"] .stats-bar { background: rgba(0,0,0,.02); }
[data-theme="light"] .hmenu-panel {
    background: #fff;
    box-shadow: 0 16px 48px rgba(0,0,0,.15);
}
[data-theme="light"] .modal { background: #fff; color: #0f172a; }
[data-theme="light"] footer { background: #eaecf5; color: #475569; }
[data-theme="light"] .ad-block,
[data-theme="light"] .ad-block-horizontal { border-color: rgba(0,0,0,.1); }
[data-theme="light"] .hero h1 { color: #0f172a; }
[data-theme="light"] .hero h1 .grad { color: transparent; }
[data-theme="light"] .url-box { background: rgba(255,255,255,.8); border-color: rgba(0,0,0,.12); }
[data-theme="light"] .url-input { background: #fff; border-color: rgba(0,0,0,.12); color: #0f172a; }
[data-theme="light"] .btn-paste { background: rgba(0,0,0,.04); color: #475569; border-color: rgba(0,0,0,.12); }
[data-theme="light"] .btn-paste:hover { background: rgba(0,0,0,.08); color: #0f172a; }
[data-theme="light"] .feat-card { background: #fff; border-color: rgba(0,0,0,.08); }
[data-theme="light"] .plat { background: rgba(0,0,0,.04); color: #475569; }
[data-theme="light"] .user-dropdown { background: #fff; border-color: rgba(0,0,0,.1); }
[data-theme="light"] .lang-dropdown { background: #fff; }
[data-theme="light"] .theme-toggle { background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.1); color: #0f172a; }
[data-theme="light"] .modal-overlay { background: rgba(0,0,0,.4); }
[data-theme="light"] .auth-modal-inner { background: #fff; }
[data-theme="light"] .auth-field input { background: #f4f6fb; border-color: rgba(0,0,0,.12); color: #0f172a; }
[data-theme="light"] .stat-num { color: #0f172a; }
[data-theme="light"] .section-title { color: #0f172a; }

/* ── Ambient background ── */
body::before {
    content: '';
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background:
        radial-gradient(ellipse 80% 50% at 10% 0%,   rgba(139,92,246,.1) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 90% 100%,  rgba(56,189,248,.08) 0%, transparent 60%),
        radial-gradient(ellipse 40% 60% at 50% 50%,   rgba(99,102,241,.04) 0%, transparent 70%);
}

/* ── Layout ── */
.wrapper {
    display: grid;
    grid-template-columns: 180px 1fr 180px;
    min-height: 100vh;
    position: relative; z-index: 1;
    max-width: 100%;
}

.ad-left, .ad-right {
    position: sticky; top: 76px; align-self: start; padding: 16px 10px;
}
main { padding: 0 28px 80px; max-width: 900px; margin: 0 auto; width: 100%; }

/* ═══════════════════════════════════════════
   HEADER
═══════════════════════════════════════════ */
header {
    grid-column: 1 / -1;
    height: 72px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 40px;
    position: sticky; top: 0; z-index: 200;
    background: rgba(5, 5, 15, 0.8);
    backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
    border-bottom: 1px solid var(--border);
}
header::after {
    content: '';
    position: absolute; bottom: -1px; left: 10%; right: 10%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--p1), var(--p3), transparent);
    opacity: .4;
}

.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-icon {
    width: 40px; height: 40px; border-radius: 12px;
    background: linear-gradient(135deg, var(--p1), var(--p3));
    display: flex; align-items: center; justify-content: center; color: #fff;
    box-shadow: 0 0 24px rgba(139,92,246,.4);
    flex-shrink: 0;
}
.logo-text {
    font-size: 20px; font-weight: 900; letter-spacing: -.5px;
    background: linear-gradient(135deg, var(--p1), var(--p3));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

nav { display: flex; gap: 8px; align-items: center; }
.nav-link {
    color: var(--muted2); text-decoration: none; font-size: 14px; font-weight: 500;
    padding: 7px 16px; border-radius: 10px; transition: all .2s;
}
.nav-link:hover { color: #fff; background: var(--card-h); }

.btn-premium {
    display: flex; align-items: center; gap: 7px;
    padding: 9px 20px; border-radius: 24px; font-size: 13px; font-weight: 700;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #1a0a00 !important; text-decoration: none;
    box-shadow: 0 4px 20px rgba(245,158,11,.3);
    transition: all .2s;
}
.btn-premium:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 8px 28px rgba(245,158,11,.45); }
.premium-star { font-size: 15px; }

/* ═══════════════════════════════════════════
   HERO
═══════════════════════════════════════════ */
.hero { padding: 64px 0 40px; text-align: center; }

.hero-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(139,92,246,.12); border: 1px solid rgba(139,92,246,.25);
    border-radius: 24px; padding: 6px 16px; font-size: 13px; font-weight: 600;
    color: #a78bfa; margin-bottom: 24px; letter-spacing: .2px;
}
.hero-eyebrow span { width: 6px; height: 6px; background: var(--p1); border-radius: 50%;
    animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(.8)} }

.hero h1 {
    font-size: clamp(32px, 5.5vw, 54px);
    font-weight: 900; line-height: 1.1; letter-spacing: -1.5px;
    color: #fff; margin-bottom: 20px;
}
.hero h1 .grad {
    background: linear-gradient(135deg, var(--p1) 0%, var(--p3) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p {
    color: var(--muted2); font-size: 16px; line-height: 1.7;
    max-width: 500px; margin: 0 auto 40px; font-weight: 400;
}

/* ── URL Input Box ── */
.url-box {
    background: rgba(255,255,255,.025);
    border: 1px solid var(--border-h);
    border-radius: 20px; padding: 20px;
    box-shadow: 0 0 0 1px rgba(139,92,246,.1), var(--shadow);
    position: relative;
}
.url-box::before {
    content: '';
    position: absolute; inset: -1px; border-radius: 21px;
    background: linear-gradient(135deg, rgba(139,92,246,.3), rgba(56,189,248,.2));
    z-index: -1;
}

.input-row { display: flex; gap: 10px; }
.url-input {
    flex: 1; background: rgba(255,255,255,.05);
    border: 1px solid var(--border); border-radius: 12px;
    padding: 15px 20px; font-size: 15px; color: #fff;
    font-family: inherit; outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.url-input:focus { border-color: var(--p1); box-shadow: 0 0 0 3px rgba(139,92,246,.15); }
.url-input::placeholder { color: var(--muted); }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 24px;
    border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer;
    border: none; font-family: inherit; transition: all .2s; text-decoration: none; white-space: nowrap; }

.btn-primary {
    background: linear-gradient(135deg, var(--p1), var(--p2));
    color: #fff; box-shadow: 0 4px 20px rgba(139,92,246,.4);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(139,92,246,.55); }
.btn-primary:active { transform: translateY(0); }

.btn-paste {
    background: rgba(255,255,255,.05); color: var(--muted2);
    border: 1px solid var(--border); padding: 0 18px; font-size: 14px;
}
.btn-paste:hover { background: rgba(255,255,255,.09); color: #fff; border-color: var(--border-h); }

/* ── Platform chips ── */
.platforms { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 32px; }
.plat {
    display: flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,.03); border: 1px solid var(--border);
    border-radius: 22px; padding: 6px 14px; font-size: 12px; font-weight: 500; color: var(--muted2);
    transition: all .2s; cursor: default;
}
.plat:hover { background: rgba(139,92,246,.1); border-color: rgba(139,92,246,.3); color: #c4b5fd; }
.plat .ico { font-size: 14px; }

/* ═══════════════════════════════════════════
   RESULT CARD
═══════════════════════════════════════════ */
#result-section { display: none; margin-top: 32px; }

.result-card {
    background: rgba(255,255,255,.02);
    border: 1px solid var(--border-h);
    border-radius: 20px; padding: 24px;
    box-shadow: var(--shadow);
}

.result-top {
    display: flex; gap: 18px; align-items: flex-start; margin-bottom: 24px;
    padding-bottom: 24px; border-bottom: 1px solid var(--border);
}
.result-thumb {
    width: 148px; height: 92px; object-fit: cover;
    border-radius: 10px; flex-shrink: 0;
    background: var(--bg3); box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.result-info { flex: 1; min-width: 0; }
.result-info h3 {
    font-size: 16px; font-weight: 700; color: #fff; line-height: 1.4;
    margin-bottom: 10px; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.result-meta { display: flex; flex-wrap: wrap; gap: 12px; }
.result-meta span {
    display: flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 500; color: var(--muted2);
    background: rgba(255,255,255,.04); border: 1px solid var(--border);
    border-radius: 8px; padding: 4px 10px;
}

/* ═══════════════════════════════════════════
   QUALITY DROPDOWN
═══════════════════════════════════════════ */
.qdl-wrap {
    display: flex; gap: 12px; flex-wrap: wrap;
}
.qdl-col { position: relative; flex: 1; min-width: 200px; }

.qdl-main-btn {
    width: 100%; display: flex; align-items: center; gap: 14px;
    padding: 18px 22px; border-radius: 14px; border: 1px solid transparent;
    cursor: pointer; font-family: inherit; transition: all .2s; text-align: left;
}
.qdl-main-btn:disabled { opacity: .45; cursor: not-allowed; }

.qdl-video {
    background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(139,92,246,.12));
    border-color: rgba(139,92,246,.25);
}
.qdl-video:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(99,102,241,.2), rgba(139,92,246,.2));
    border-color: var(--p1); box-shadow: 0 8px 28px rgba(139,92,246,.15);
    transform: translateY(-2px);
}

.qdl-audio {
    background: linear-gradient(135deg, rgba(52,211,153,.08), rgba(56,189,248,.08));
    border-color: rgba(52,211,153,.25);
}
.qdl-audio:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(52,211,153,.16), rgba(56,189,248,.16));
    border-color: var(--green); box-shadow: 0 8px 28px rgba(52,211,153,.12);
    transform: translateY(-2px);
}

.qdl-icon { font-size: 28px; flex-shrink: 0; }
.qdl-text { display: flex; flex-direction: column; gap: 3px; }
.qdl-title { font-size: 16px; font-weight: 700; color: #fff; }
.qdl-sub   { font-size: 12px; color: var(--muted2); font-weight: 500; }

/* Dropdown panel */
.qdl-panel {
    display: none; position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    background: #0f0f23; border: 1px solid var(--border-h);
    border-radius: 16px; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.7); z-index: 50;
    animation: dropIn .18s ease;
}
.qdl-panel.open { display: block; }
@keyframes dropIn {
    from { opacity:0; transform:translateY(-8px); }
    to   { opacity:1; transform:translateY(0); }
}
.qdl-panel-title {
    font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
    color: var(--muted); font-weight: 700; padding: 14px 18px 10px;
    border-bottom: 1px solid var(--border);
}

.qdl-option {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 18px; cursor: pointer;
    transition: background .15s; border-bottom: 1px solid rgba(255,255,255,.03);
}
.qdl-option:last-child { border-bottom: none; }
.qdl-option:hover { background: rgba(139,92,246,.1); }
.qdl-option-locked { opacity: .65; cursor: default; }
.qdl-option-locked:hover { background: rgba(245,158,11,.05); }

.qopt-res  { font-size: 15px; font-weight: 800; color: #fff; min-width: 55px; }
.qopt-tag  {
    font-size: 11px; color: var(--muted2); font-weight: 600;
    background: rgba(255,255,255,.06); padding: 2px 8px; border-radius: 6px;
}
.qopt-size { font-size: 12px; color: var(--muted); margin-left: auto; }
.qopt-free {
    font-size: 10px; font-weight: 700;
    background: rgba(52,211,153,.15); color: var(--green);
    padding: 2px 9px; border-radius: 6px; margin-left: 6px;
}
.qopt-prem {
    font-size: 10px; font-weight: 700;
    background: rgba(245,158,11,.15); color: var(--gold);
    padding: 2px 9px; border-radius: 6px; margin-left: 6px;
}

/* ═══════════════════════════════════════════
   PROGRESS BAR
═══════════════════════════════════════════ */
.progress-wrap { margin-top: 20px; display: none; }
.progress-label { font-size: 13px; color: var(--muted2); margin-bottom: 8px; font-weight: 500; }
.progress-bar-bg {
    background: rgba(255,255,255,.06); border-radius: 99px;
    height: 6px; overflow: hidden;
}
.progress-bar-fill {
    height: 100%; border-radius: 99px;
    background: linear-gradient(90deg, var(--p1), var(--p3));
    width: 0%; transition: width .4s ease;
}

/* ═══════════════════════════════════════════
   PREMIUM UPSELL
═══════════════════════════════════════════ */
.premium-box {
    margin-top: 20px;
    background: linear-gradient(135deg, rgba(245,158,11,.06), rgba(251,191,36,.06));
    border: 1px solid rgba(245,158,11,.2);
    border-radius: 16px; padding: 20px 24px;
    display: flex; gap: 18px; align-items: center;
}
.premium-box .ico { font-size: 34px; flex-shrink: 0; }
.premium-box h4 { font-size: 15px; font-weight: 700; color: #fcd34d; margin-bottom: 5px; }
.premium-box p  { font-size: 13px; color: var(--muted2); line-height: 1.5; }
.btn-gold {
    background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #1a0a00;
    font-weight: 800; padding: 11px 22px; border-radius: 12px; font-size: 14px;
    flex-shrink: 0; border: none; cursor: pointer; font-family: inherit;
    transition: all .2s;
}
.btn-gold:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* ═══════════════════════════════════════════
   STATS BAR
═══════════════════════════════════════════ */
.stats-bar {
    display: flex; justify-content: center; gap: 0;
    margin: 48px 0; border: 1px solid var(--border);
    border-radius: 18px; background: rgba(255,255,255,.02); overflow: hidden;
}
.stat {
    flex: 1; text-align: center; padding: 28px 20px;
    border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }
.stat-num {
    font-size: 28px; font-weight: 900; letter-spacing: -1px;
    background: linear-gradient(135deg, var(--p1), var(--p3));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-lbl { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 500; }

/* ═══════════════════════════════════════════
   FEATURES
═══════════════════════════════════════════ */
.section-title {
    font-size: 24px; font-weight: 800; text-align: center;
    margin-bottom: 28px; color: #fff; letter-spacing: -.5px;
}
.section-title span {
    background: linear-gradient(135deg, var(--p1), var(--p3));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.features-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px; margin-bottom: 48px;
}
.feat-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 16px; padding: 22px;
    transition: all .22s;
}
.feat-card:hover {
    background: var(--card-h); border-color: var(--border-h);
    transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,.3);
}
.feat-icon { font-size: 26px; margin-bottom: 12px; }
.feat-card h4 { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 7px; }
.feat-card p  { font-size: 13px; color: var(--muted2); line-height: 1.55; }

/* ═══════════════════════════════════════════
   ADS
═══════════════════════════════════════════ */
.ad-block {
    background: rgba(255,255,255,.015); border: 1px dashed rgba(255,255,255,.08);
    border-radius: 12px; min-height: 260px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 11px; color: rgba(255,255,255,.12); text-align: center;
    padding: 12px; margin-bottom: 12px;
}
.ad-block-horizontal {
    background: rgba(255,255,255,.015); border: 1px dashed rgba(255,255,255,.08);
    border-radius: 12px; min-height: 90px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; color: rgba(255,255,255,.12); margin: 24px 0;
}

/* ═══════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════ */
footer {
    grid-column: 1 / -1;
    background: rgba(5,5,15,.9); border-top: 1px solid var(--border);
    padding: 32px 48px;
    display: flex; gap: 20px; flex-wrap: wrap;
    justify-content: space-between; align-items: center;
}
footer p { color: var(--muted); font-size: 13px; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 500; transition: color .2s; }
.footer-links a:hover { color: #fff; }

/* ═══════════════════════════════════════════
   TOAST
═══════════════════════════════════════════ */
.toast {
    position: fixed; bottom: 28px; right: 28px; z-index: 9999;
    background: #12122a; border: 1px solid var(--border-h);
    border-radius: 14px; padding: 14px 20px; font-size: 14px; font-weight: 500;
    box-shadow: 0 16px 48px rgba(0,0,0,.5);
    display: none; align-items: center; gap: 10px; max-width: 320px;
    animation: slideUp .25s ease;
}
.toast.show { display: flex; }
.toast.error   { border-color: rgba(244,63,94,.4); }
.toast.success { border-color: rgba(52,211,153,.4); }
@keyframes slideUp {
    from { transform:translateY(16px); opacity:0; }
    to   { transform:translateY(0);    opacity:1; }
}

/* ═══════════════════════════════════════════
   SPINNER
═══════════════════════════════════════════ */
.spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.15);
    border-top-color: #fff; border-radius: 50%;
    animation: spin .65s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════
   MODAL
═══════════════════════════════════════════ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(0,0,0,.75); backdrop-filter: blur(12px);
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
    background: #0f0f22; border: 1px solid var(--border-h);
    border-radius: 22px; padding: 40px; max-width: 480px; width: 100%;
    box-shadow: 0 32px 96px rgba(0,0,0,.7);
    animation: fadeIn .2s ease;
}
@keyframes fadeIn { from{opacity:0;transform:scale(.96)} to{opacity:1;transform:scale(1)} }
.modal h2 { font-size: 22px; font-weight: 900; margin-bottom: 18px; color: #fff; letter-spacing: -.4px; }
.modal p  { color: var(--muted2); font-size: 14px; line-height: 1.65; margin-bottom: 12px; }
.modal ul { color: var(--muted2); font-size: 14px; padding-left: 20px; line-height: 2.2; margin-bottom: 16px; }
.modal ul li { list-style: none; padding-left: 4px; }
.dl-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 20px; }

/* ═══════════════════════════════════════════
   SETUP OVERLAY (auto-install)
═══════════════════════════════════════════ */
#setup-overlay {
    font-family: 'Inter', system-ui, sans-serif;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 960px) {
    .wrapper { grid-template-columns: 1fr; width: 100%; }
    .ad-left, .ad-right { display: none; }
    footer { padding: 24px 20px; }
    header { width: 100%; max-width: 100vw; }
    main { max-width: 100%; padding: 0 16px 60px; }
}
/* ── Header right group ── */
.header-right { display: flex; align-items: center; gap: 8px; }

/* ── Language selector ── */
.lang-selector { position: relative; }

.lang-trigger {
    display: flex; align-items: center; gap: 6px;
    background: var(--card); border: 1px solid var(--border);
    border-radius: 10px; padding: 7px 12px; cursor: pointer;
    font-family: inherit; font-size: 13px; font-weight: 700;
    color: var(--muted2); transition: all .2s;
}
.lang-trigger:hover { background: var(--card-h); border-color: var(--border-h); color: var(--text); }
#hdr-flag { font-size: 16px; line-height: 1; }
#hdr-code { font-size: 12px; letter-spacing: .5px; }
.lang-trigger svg { opacity: .5; transition: transform .2s; }
.lang-trigger.open svg { transform: rotate(180deg); }

.lang-dropdown {
    display: none;
    position: absolute; top: calc(100% + 8px); right: 0;
    width: 260px;
    background: #0f0f22; border: 1px solid var(--border-h);
    border-radius: 14px; padding: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,.65); z-index: 300;
    animation: dropIn .18s ease;
    display: none;
}
.lang-dropdown.open { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }

[data-theme="light"] .lang-dropdown { background: #fff; }

.lang-opt {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px; border-radius: 9px; cursor: pointer;
    font-size: 13px; font-weight: 500; color: var(--muted2);
    border: none; background: transparent; font-family: inherit;
    transition: all .15s; text-align: left; width: 100%;
}
.lang-opt:hover { background: rgba(139,92,246,.1); color: var(--text); }
.lang-opt.active { background: rgba(139,92,246,.15); color: #c4b5fd; font-weight: 700; }
.lang-opt-flag { font-size: 18px; flex-shrink: 0; }
.lang-opt-name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Theme toggle ── */
.theme-toggle {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--card); border: 1px solid var(--border);
    cursor: pointer; font-size: 17px; display: flex;
    align-items: center; justify-content: center;
    transition: all .2s;
}
.theme-toggle:hover { background: var(--card-h); border-color: var(--border-h); }

/* ── Hero eyebrow fix ── */
.hero-eyebrow {
    display: inline-block;
    background: rgba(139,92,246,.12); border: 1px solid rgba(139,92,246,.25);
    border-radius: 24px; padding: 6px 18px;
    font-size: 13px; font-weight: 600; color: #a78bfa;
    margin-bottom: 22px; white-space: nowrap;
}

/* ══════════════════════════════════════════
   HAMBURGER & MOBILE DRAWER
══════════════════════════════════════════ */
.hamburger-btn {
    display: none;
    background: var(--card); border: 1px solid var(--border);
    border-radius: 10px; width: 40px; height: 40px;
    align-items: center; justify-content: center;
    color: var(--text); font-size: 18px; cursor: pointer;
    transition: background .2s;
}
.hamburger-btn:hover { background: var(--card-h); }

.mobile-drawer-overlay {
    display: none; position: fixed; inset: 0; z-index: 400;
    background: rgba(0,0,0,.5); backdrop-filter: blur(4px);
}
.mobile-drawer-overlay.open { display: block; }

.mobile-drawer {
    position: fixed; top: 0; right: -320px; bottom: 0;
    width: 300px; z-index: 401;
    background: var(--bg2); border-left: 1px solid var(--border);
    transition: right .3s cubic-bezier(.4,0,.2,1);
    display: flex; flex-direction: column;
}
.mobile-drawer.open { right: 0; }

.drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px; border-bottom: 1px solid var(--border);
}
.drawer-title { font-weight: 700; font-size: 16px; }
.drawer-close {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 8px; width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted2); cursor: pointer; font-size: 16px;
}

.drawer-body { padding: 16px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }

.drawer-user { display: flex; flex-direction: column; gap: 10px; }
.drawer-btn {
    width: 100%; padding: 12px; border-radius: 10px;
    font-size: 15px; font-weight: 600; cursor: pointer;
    font-family: inherit; border: none;
}
.drawer-btn-outline {
    background: transparent; border: 1px solid var(--border-h); color: var(--text);
}
.drawer-btn-fill {
    background: linear-gradient(135deg, var(--p1), var(--p2)); color: #fff;
}

.drawer-profile {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; background: var(--card); border-radius: 12px;
    margin-bottom: 4px;
}
.drawer-avatar { font-size: 36px; color: var(--muted2); }
.drawer-username { font-weight: 700; font-size: 15px; }
.drawer-premium-badge {
    font-size: 11px; font-weight: 700;
    background: linear-gradient(135deg,#f59e0b,#f97316);
    color: #fff; padding: 2px 8px; border-radius: 99px;
    display: inline-block; margin-top: 4px;
}

.drawer-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; border-radius: 10px;
    color: var(--muted2); text-decoration: none; font-size: 14px;
    font-weight: 500; transition: all .2s; cursor: pointer;
    background: transparent; border: none; font-family: inherit;
    width: 100%; text-align: left;
}
.drawer-item:hover { background: var(--card-h); color: var(--text); }
.drawer-item i { width: 18px; text-align: center; }

.drawer-divider { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

.drawer-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 14px;
}

[data-theme="light"] .mobile-drawer { background: #fff; }

@media (max-width: 768px) {
    .desktop-nav { display: none !important; }
    .hamburger-btn { display: flex; }
}

/* ── Step numbers ── */
.feat-icon.step-num {
    width: 48px; height: 48px; border-radius: 50%;
    background: linear-gradient(135deg, var(--p1), var(--p2));
    color: #fff; font-size: 20px; font-weight: 900;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 12px;
}

/* ── FA icon sizing in feat cards ── */
.feat-icon i { font-size: inherit; }

@media (max-width: 620px) {
    .input-row { flex-direction: column; }
    .input-row .btn { width: 100%; justify-content: center; padding: 14px; }
    .result-top { flex-direction: column; }
    .result-thumb { width: 100%; height: auto; aspect-ratio: 16/9; }
    .stats-bar { flex-direction: column; gap: 0; }
    .stat { border-right: none; border-bottom: 1px solid var(--border); }
    .stat:last-child { border-bottom: none; }
    .premium-box { flex-direction: column; }
    .hero { padding: 40px 0 28px; }
    .hero h1 { font-size: 26px; letter-spacing: -0.5px; }
    .hero p { font-size: 14px; }
    header { padding: 0 16px; gap: 8px; }
    .auth-btns { display: none; }
    .btn-auth-outline, .btn-auth-fill { font-size: 11px; padding: 5px 10px; }
    .btn-premium { padding: 7px 12px; font-size: 12px; }
    .lang-trigger { padding: 6px 8px; }
    #hdr-code { display: none; }
    .features-grid { grid-template-columns: 1fr; }
    .modal { padding: 24px 16px; margin: 16px; }
    .platforms { gap: 6px; }
    .plat { font-size: 11px; padding: 5px 10px; }
    main { padding: 0 16px 60px; }
    .url-box { padding: 14px; border-radius: 16px; }
}

/* ══════════════════════════════════════════
   AUTH HEADER BUTTONS
══════════════════════════════════════════ */
.auth-btns {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-auth-outline {
    background: transparent;
    border: 1px solid var(--border-h);
    color: var(--text);
    padding: 7px 16px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    white-space: nowrap;
}
.btn-auth-outline:hover {
    border-color: var(--p1);
    background: rgba(139,92,246,.08);
}

.btn-auth-fill {
    background: linear-gradient(135deg, var(--p1), var(--p2));
    border: none;
    color: #fff;
    padding: 7px 16px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .2s;
    white-space: nowrap;
}
.btn-auth-fill:hover { opacity: .88; }

/* ══════════════════════════════════════════
   USER MENU (logged-in)
══════════════════════════════════════════ */
.user-menu {
    position: relative;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 7px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    white-space: nowrap;
}
.user-trigger:hover {
    border-color: var(--p1);
    background: var(--card-h);
}
.user-trigger svg { transition: transform .2s; }
.user-trigger.open svg { transform: rotate(180deg); }

.user-avatar { font-size: 16px; width:28px; height:28px; display:flex; align-items:center; justify-content:center; border-radius:50%; overflow:hidden; flex-shrink:0; }

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--bg2);
    border: 1px solid var(--border-h);
    border-radius: 12px;
    padding: 8px;
    min-width: 170px;
    box-shadow: 0 16px 40px rgba(0,0,0,.5);
    z-index: 200;
}
.user-dropdown.open { display: block; }

.user-dd-name {
    padding: 8px 12px 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted2);
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}

.user-dd-item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--text);
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.user-dd-item:hover { background: var(--card-h); }

/* ══════════════════════════════════════════
   AUTH MODAL
══════════════════════════════════════════ */
.auth-modal-inner {
    max-width: 420px;
    width: 90%;
    padding: 36px 32px 32px;
    position: relative;
}

.auth-modal-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
    font-size: 18px;
    font-weight: 900;
}
.auth-logo-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--p1), var(--p3));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
}

.auth-tabs {
    display: flex;
    background: var(--bg3);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--muted2);
    padding: 9px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, color .2s;
}
.auth-tab.active {
    background: linear-gradient(135deg, var(--p1), var(--p2));
    color: #fff;
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }

.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted2);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.auth-field input {
    background: var(--bg3);
    border: 1px solid var(--border-h);
    color: var(--text);
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color .2s;
    outline: none;
}
.auth-field input:focus { border-color: var(--p1); }
.auth-field input::placeholder { color: var(--muted); }

.auth-error {
    font-size: 13px;
    color: var(--red);
    min-height: 18px;
    font-weight: 500;
}

.auth-submit {
    margin-top: 4px;
    width: 100%;
    padding: 13px;
    font-size: 15px;
    font-weight: 700;
}

.auth-switch {
    text-align: center;
    font-size: 13px;
    color: var(--muted2);
    margin-top: 4px;
}
.auth-switch button {
    background: none;
    border: none;
    color: var(--p1);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}
.auth-switch button:hover { text-decoration: underline; }

.user-dd-item[href] {
    display: block;
    text-decoration: none;
    color: var(--text);
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: background .15s;
}
.user-dd-item[href]:hover { background: var(--card-h); }

.modal-close-x {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
    transition: color .2s;
}
.modal-close-x:hover { color: var(--text); }

/* ══════════════════════════════════════════
   PREMIUM MODAL – Pricing Cards
══════════════════════════════════════════ */
.premium-modal-inner {
    max-width: 520px;
    padding: 36px 32px 28px;
    position: relative;
}
.pm-header { text-align: center; margin-bottom: 20px; }
.pm-star {
    font-size: 36px;
    color: var(--gold);
    filter: drop-shadow(0 0 12px #f59e0b88);
    display: block;
    margin-bottom: 8px;
}
.pm-header h2 { font-size: 22px; font-weight: 900; }
.pm-sub { color: var(--muted2); font-size: 14px; margin-top: 4px; }

.pm-features {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    margin-bottom: 24px;
}
.pm-features li {
    font-size: 13px;
    color: var(--muted2);
    display: flex;
    align-items: center;
    gap: 7px;
}
.pm-features li i { color: var(--p1); width: 14px; text-align: center; }

.pm-plans {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 18px;
}
.pm-plan {
    border: 1.5px solid var(--border);
    border-radius: 16px;
    padding: 20px 16px 16px;
    text-align: center;
    position: relative;
    transition: border-color .2s, transform .2s;
}
.pm-plan:hover { transform: translateY(-2px); }

.pm-plan-yearly {
    border-color: var(--gold);
    background: linear-gradient(135deg, rgba(245,158,11,.08), rgba(249,115,22,.04));
}
.pm-plan-monthly {
    background: var(--card);
}
.pm-badge-top {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 99px;
    white-space: nowrap;
    letter-spacing: .4px;
}
.pm-plan-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted2);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 8px;
}
.pm-price {
    font-size: 32px;
    font-weight: 900;
    color: var(--text);
    line-height: 1;
    margin-bottom: 4px;
}
.pm-price span {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted2);
}
.pm-price-note {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 14px;
    min-height: 28px;
    line-height: 1.5;
}
.pm-price-note s { color: var(--muted); }

.pm-btn-yearly {
    display: block;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff !important;
    font-size: 13px;
    font-weight: 700;
    padding: 9px 14px;
    border-radius: 10px;
    text-decoration: none;
    transition: opacity .2s;
}
.pm-btn-yearly:hover { opacity: .88; }

.pm-btn-monthly {
    display: block;
    background: linear-gradient(135deg, var(--p1), var(--p2));
    color: #fff !important;
    font-size: 13px;
    font-weight: 700;
    padding: 9px 14px;
    border-radius: 10px;
    text-decoration: none;
    transition: opacity .2s;
}
.pm-btn-monthly:hover { opacity: .88; }

.pm-note {
    font-size: 12px;
    color: var(--muted);
    text-align: center;
    line-height: 1.6;
    padding: 10px 12px;
    background: var(--card);
    border-radius: 10px;
    border: 1px solid var(--border);
}
.pm-note i { color: var(--p3); margin-right: 4px; }
.pm-note strong { color: var(--text); }

@media (max-width: 480px) {
    .pm-plans { grid-template-columns: 1fr; }
    .pm-features { grid-template-columns: 1fr; }
    .premium-modal-inner { padding: 28px 18px 22px; }
}
