/* ================================================================
   VALYAI — MASTER STYLESHEET
   Mobile-first, custom CSS, CSS Variables, Grid + Flexbox
   ================================================================ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ================================================================
   CSS CUSTOM PROPERTIES
   ================================================================ */
:root {
    --primary:        #7c3aed;
    --primary-dark:   #6d28d9;
    --primary-light:  #a855f7;
    --accent:         #f5a623;
    --danger:         #ef4444;
    --success:        #22c55e;

    --bg:             #0f1117;
    --surface:        #1a1d2e;
    --surface-2:      #252836;
    --surface-3:      #2e3248;
    --border:         #2a2d3e;
    --border-light:   #333;

    --text:           #ffffff;
    --text-muted:     #9ca3af;
    --text-dim:       #6b7280;

    --sp-1:  4px;  --sp-2:  8px;  --sp-3:  12px; --sp-4:  16px;
    --sp-5:  20px; --sp-6:  24px; --sp-8:  32px; --sp-10: 40px;
    --sp-12: 48px; --sp-16: 64px;

    --radius-sm:   6px;
    --radius:      10px;
    --radius-lg:   14px;
    --radius-full: 9999px;

    --shadow-sm:   0 1px 4px rgba(0,0,0,.3);
    --shadow:      0 4px 20px rgba(0,0,0,.4);
    --shadow-lg:   0 8px 40px rgba(0,0,0,.5);
    --shadow-glow: 0 0 24px rgba(124,58,237,.35);

    --transition:      .2s ease;
    --transition-slow: .35s ease;

    /* Sidebar widths */
    --sidebar-w-mobile: 56px;
    --sidebar-w:        56px;
    --topbar-h:         52px;

    --max-w: 1100px;
}

/* ================================================================
   APP SHELL — Mobile first
   ================================================================ */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w-mobile);
    height: 100vh;
    background: var(--bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--sp-3) 0;
    z-index: 200;
    gap: 2px;
}

.sidebar__logo {
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: .85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--sp-3);
    flex-shrink: 0;
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    align-items: center;
}

.sidebar__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 44px;
    min-height: 44px;
    padding: var(--sp-1) 0;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    transition: all var(--transition);
    font-size: .55rem;
}
.sidebar__link:hover,
.sidebar__link--active { background: var(--surface); color: var(--text); }
.sidebar__icon  { font-size: 1rem; line-height: 1; }
.sidebar__label { font-size: .55rem; line-height: 1; text-align: center; }

.sidebar__bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.sidebar__link--upgrade { color: var(--primary); }
.sidebar__link--logout  { color: var(--danger); }
.sidebar__avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Page wrapper (everything beside sidebar) ── */
.page-wrapper {
    margin-left: var(--sidebar-w-mobile);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    flex: 1;
}

/* ── Topbar ── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--sp-3);
    height: var(--topbar-h);
    min-width: 0;
}

.topbar__title {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
}

.topbar__right {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-shrink: 0;
}

.topbar__bell {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: .95rem;
    padding: 4px;
    position: relative;
    flex-shrink: 0;
}
.topbar__bell::after {
    content: '';
    position: absolute;
    top: 2px; right: 2px;
    width: 6px; height: 6px;
    background: var(--danger);
    border-radius: 50%;
    border: 1px solid var(--bg);
}

/* ── Main content ── */
.main-content {
    flex: 1;
    padding: var(--sp-4) var(--sp-3);
    min-width: 0;
    overflow-x: hidden;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-1);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: .8rem;
    font-weight: 600;
    border: none;
    transition: all var(--transition);
    white-space: nowrap;
    cursor: pointer;
}
.btn--primary {
    width: 100%;
    background: var(--primary);
    color: #fff;
    padding: 11px 20px;
    font-size: .88rem;
}
.btn--primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-glow); }

.btn--upgrade {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    font-size: .72rem;
}
.btn--upgrade:hover { opacity: .9; }

.btn--outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}
.btn--outline:hover { background: var(--primary); color: #fff; }

.btn--danger-outline {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 9px 20px;
}
.btn--danger-outline:hover { background: var(--danger); color: #fff; }

.btn--plan  { width: 100%; padding: 11px; font-size: .85rem; border-radius: var(--radius-sm); }
.btn--starter { background: var(--surface-3); color: var(--text); border: 1px solid var(--border); }
.btn--starter:hover { background: var(--surface-2); }
.btn--pro     { background: var(--primary); color: #fff; }
.btn--pro:hover { background: var(--primary-dark); box-shadow: var(--shadow-glow); }
.btn--teams   { background: #1d4ed8; color: #fff; }
.btn--teams:hover { background: #1e40af; }
.btn--free-trial {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 28px;
    border-radius: var(--radius-full);
    font-size: .88rem;
}
.btn--free-trial:hover { border-color: var(--primary); color: var(--primary); }

/* ================================================================
   USER CHIP & DROPDOWN
   ================================================================ */
.user-chip {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    cursor: pointer;
    position: relative;
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
    user-select: none;
    flex-shrink: 0;
}
.user-chip:hover { background: var(--surface); }

.user-chip__avatar {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Hide name/plan on very small screens */
.user-chip__info  { display: none; }
.user-chip__chevron { font-size: .6rem; color: var(--text-dim); }

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 210px;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 300;
    overflow: hidden;
}
.user-dropdown.open { display: block; }

.user-dropdown__header {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-3);
    border-bottom: 1px solid var(--border);
}
.user-dropdown__avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: .85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.user-dropdown__name  { font-size: .82rem; font-weight: 600; }
.user-dropdown__email { font-size: .68rem; color: var(--text-muted); word-break: break-all; }
.user-dropdown__plan  { font-size: .65rem; color: var(--text-dim); }

.user-dropdown__link {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 9px var(--sp-3);
    font-size: .8rem;
    color: var(--text-muted);
    transition: background var(--transition), color var(--transition);
}
.user-dropdown__link:hover { background: var(--surface-2); color: var(--text); }
.user-dropdown__link--upgrade { color: var(--primary-light); font-weight: 600; }
.user-dropdown__link--danger  { color: var(--danger); }

/* ================================================================
   AUTH PAGES
   ================================================================ */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #f0f2f5;
    padding: var(--sp-4);
}
.auth-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--sp-6) var(--sp-5);
    width: 100%;
    max-width: 340px;
    box-shadow: var(--shadow-lg);
}
.auth-card__title {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--sp-1);
}
.auth-card__sub {
    font-size: .85rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: var(--sp-5);
}
.auth-footer {
    text-align: center;
    margin-top: var(--sp-3);
    font-size: .82rem;
    color: var(--text-muted);
}
.auth-footer a { color: var(--primary); }

.form-group   { margin-bottom: var(--sp-3); position: relative; }
.form-label   { display: block; font-size: .7rem; font-weight: 700; color: var(--text-dim); letter-spacing: .07em; text-transform: uppercase; margin-bottom: var(--sp-1); }
.form-input   { width: 100%; background: var(--surface-2); border: 1px solid var(--border-light); border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text); font-size: .88rem; outline: none; transition: border-color var(--transition); }
.form-input:focus { border-color: var(--primary); }
.form-input::placeholder { color: var(--text-dim); }
.form-input:disabled { opacity: .5; cursor: not-allowed; }

.pw-wrap { position: relative; }
.pw-wrap .form-input { padding-right: 52px; }
.pw-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-dim); font-size: .75rem; padding: 4px; }
.pw-toggle:hover { color: var(--text); }

.hcaptcha-box {
    background: var(--surface-2);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-4);
    font-size: .82rem;
    color: var(--text-muted);
    gap: var(--sp-2);
}
.hcaptcha-box label { display: flex; align-items: center; gap: var(--sp-2); cursor: pointer; }
.hcaptcha-logo  { width: 30px; height: 30px; background: linear-gradient(135deg,#00b0ff,#00e5ff); border-radius: 50%; flex-shrink: 0; }
.hcaptcha-brand { font-size: .6rem; color: var(--text-dim); text-align: center; }

/* ================================================================
   DASHBOARD — TOOL CARDS
   ================================================================ */
.page-greeting { font-size: clamp(1rem, 4vw, 1.4rem); font-weight: 700; margin-bottom: var(--sp-1); }
.page-sub      { font-size: .82rem; color: var(--text-muted); margin-bottom: var(--sp-5); }
.section-label { font-size: .65rem; font-weight: 700; color: var(--text-dim); letter-spacing: .09em; text-transform: uppercase; margin-bottom: var(--sp-3); }

/* Mobile: 2 columns */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-2);
    margin-bottom: var(--sp-5);
}

.tool-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: var(--sp-3);
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    border: 1px solid transparent;
    min-width: 0;
}
.tool-card:hover { background: var(--surface-2); transform: translateY(-2px); border-color: var(--border); }
.tool-card__icon { font-size: 1.2rem; margin-bottom: var(--sp-2); }
.tool-card__name { font-size: .78rem; font-weight: 600; color: var(--text); margin-bottom: 3px; line-height: 1.3; }
.tool-card__desc { font-size: .68rem; color: var(--text-muted); line-height: 1.4; }

/* ================================================================
   ACCORDION
   ================================================================ */
.accordion-item {
    background: var(--surface);
    border-radius: var(--radius);
    margin-bottom: var(--sp-2);
    overflow: hidden;
}
.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-3) var(--sp-3);
    cursor: pointer;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-muted);
    user-select: none;
    transition: background var(--transition);
}
.accordion-header:hover { background: var(--surface-2); color: var(--text); }
.accordion-header__left { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.accordion-header__count { font-size: .68rem; color: var(--text-dim); font-weight: 400; }
.accordion-chevron { font-size: .7rem; color: var(--text-dim); transition: transform var(--transition); flex-shrink: 0; }
.accordion-item.open .accordion-chevron { transform: rotate(180deg); }

.accordion-panel { display: none; padding: var(--sp-2) var(--sp-2) var(--sp-3); }
.accordion-item.open .accordion-panel { display: block; }

/* Mobile: 2 columns in accordion */
.accordion-tools {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-2);
}

.acc-tool {
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: var(--sp-2);
    cursor: pointer;
    position: relative;
    transition: background var(--transition);
    min-width: 0;
}
.acc-tool:hover { background: var(--surface-3); }
.acc-tool__icon { font-size: .95rem; margin-bottom: 4px; }
.acc-tool__name { font-size: .72rem; font-weight: 600; color: var(--text); margin-bottom: 2px; line-height: 1.3; }
.acc-tool__desc { font-size: .65rem; color: var(--text-muted); line-height: 1.3; }
.soon-badge {
    position: absolute; top: 5px; right: 5px;
    background: var(--surface-3); color: var(--text-dim);
    font-size: .55rem; padding: 2px 5px;
    border-radius: var(--radius-full); font-weight: 600;
}

/* ================================================================
   SETTINGS
   ================================================================ */
.settings-layout {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}
.settings-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--sp-1);
}
.settings-nav__link {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: .78rem;
    color: var(--text-muted);
    transition: all var(--transition);
    background: var(--surface);
}
.settings-nav__link:hover { background: var(--surface-2); color: var(--text); }
.settings-nav__link--active { background: var(--surface-2); color: var(--text); }
.settings-nav__link--danger { color: var(--danger); }
.settings-nav__link--danger:hover { background: rgba(239,68,68,.1); }
.settings-nav__icon { font-size: .85rem; }

.settings-panel { background: var(--surface); border-radius: var(--radius-lg); padding: var(--sp-4); }
.settings-panel__title { font-size: .95rem; font-weight: 700; margin-bottom: var(--sp-4); }

.plan-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--sp-2); margin-bottom: var(--sp-4); }
.stat-card  { background: var(--surface-2); border-radius: var(--radius); padding: var(--sp-2) var(--sp-3); text-align: center; }
.stat-card__val   { font-size: 1.2rem; font-weight: 700; }
.stat-card__label { font-size: .62rem; color: var(--text-muted); margin-top: 2px; }

.includes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); margin-top: var(--sp-3); }
.include-item  { display: flex; align-items: center; gap: var(--sp-2); font-size: .75rem; color: var(--text-muted); }
.include-item .tick  { color: var(--primary); }
.include-item .cross { color: var(--text-dim); }

.billing-empty { text-align: center; padding: var(--sp-8) 0; }
.billing-empty__icon { font-size: 2.5rem; margin-bottom: var(--sp-3); }
.billing-empty__text { font-size: .85rem; color: var(--text-muted); margin-bottom: var(--sp-5); line-height: 1.6; }

.brand-notice {
    background: rgba(245,166,35,.08); border: 1px solid rgba(245,166,35,.3);
    border-radius: var(--radius-sm); padding: var(--sp-3);
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--sp-2); font-size: .78rem; color: var(--accent); margin-bottom: var(--sp-4);
    flex-wrap: wrap;
}
.colors-row { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-2); }
.color-swatch { width: 24px; height: 24px; border-radius: var(--radius-sm); cursor: pointer; border: 2px solid transparent; transition: transform var(--transition); }
.color-swatch:hover  { transform: scale(1.15); }
.color-swatch.active { border-color: #fff; }
.fonts-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--sp-2); margin-top: var(--sp-2); }
.font-btn   { background: var(--surface-2); border: 2px solid transparent; border-radius: var(--radius-sm); padding: 7px; font-size: .72rem; color: var(--text-muted); text-align: center; transition: all var(--transition); cursor: pointer; }
.font-btn:hover  { border-color: var(--primary); color: var(--text); }
.font-btn.active { border-color: var(--primary); color: var(--text); background: var(--surface-3); }
.brand-preview { background: var(--surface-2); border-radius: var(--radius-sm); padding: var(--sp-3); margin-top: var(--sp-3); }
.brand-preview__label { font-size: .68rem; color: var(--text-dim); margin-bottom: var(--sp-2); }
.brand-preview__inner { display: flex; align-items: center; gap: var(--sp-2); }
.brand-preview__avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; font-size: .68rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }

.videos-empty { text-align: center; padding: var(--sp-12) 0; }
.videos-empty__icon { font-size: 3rem; margin-bottom: var(--sp-3); }
.videos-empty__text { font-size: .85rem; color: var(--text-muted); }

/* ================================================================
   PRICING PAGE
   ================================================================ */
.pricin