/* ═══════════════════════════════════════════════════════
   soueu.digital — Hexa Labs Design System
   ═══════════════════════════════════════════════════════ */

:root {
    /* ── Brand ── */
    --primary:          #8B3FE8;
    --primary-dark:     #7530CC;
    --primary-light:    #F5F0FE;
    --gradient-brand:   linear-gradient(135deg, #8B3FE8 0%, #5B6EF7 100%);
    --gradient-hover:   linear-gradient(135deg, #9B52F0 0%, #6B7EFF 100%);
    --gradient-subtle:  linear-gradient(135deg, rgba(139,63,232,.1) 0%, rgba(91,110,247,.1) 100%);
    --gradient-vibrant: linear-gradient(135deg, #7B2FD8 0%, #4B5EE7 50%, #3EA8F7 100%);
    --shadow-glow:      0 4px 24px rgba(139,63,232,.25);
    --shadow-glow-brand:0 4px 24px rgba(139,63,232,.3), 0 0 60px rgba(91,110,247,.1);

    /* ── Purple scale ── */
    --purple-50:  #F5F0FE; --purple-100: #EBE0FD; --purple-200: #D4BEFB;
    --purple-300: #B98DF7; --purple-400: #A05DF2; --purple-500: #8B3FE8;
    --purple-600: #7530CC; --purple-700: #5E25A3; --purple-800: #491D80; --purple-900: #371666;

    /* ── Blue scale ── */
    --blue-50:  #EEF1FE; --blue-100: #DCE2FD; --blue-200: #B8C4FB;
    --blue-300: #8DA0F8; --blue-400: #6E84F5; --blue-500: #5B6EF7;
    --blue-600: #4A5AD4; --blue-700: #3A47AB; --blue-800: #2D3785; --blue-900: #222A66;

    /* ── Neutral scale ── */
    --neutral-0: #FFF;     --neutral-50: #F7F7F9;  --neutral-100: #EEEFF2;
    --neutral-150: #E2E4E9; --neutral-200: #D1D4DB; --neutral-300: #A1A6B4;
    --neutral-400: #7C8294; --neutral-500: #5E6478; --neutral-600: #464C5E;
    --neutral-700: #353A4A; --neutral-800: #282D3A; --neutral-850: #1F232E;
    --neutral-900: #171A23; --neutral-950: #0F1118;

    /* ── Semantic ── */
    --success:     #10B981; --success-light: #d1fae5;
    --warning:     #F59E0B; --warning-light: #fef3c7;
    --error:       #EF4444; --error-light:   #fee2e2;
    --info:        #3B82F6; --info-light:    #dbeafe;

    /* ── Surfaces — light theme (default) ── */
    --bg:          #F4F5F8;
    --surface:     #FFFFFF;
    --surface-elevated: #FFFFFF;
    --border:      rgba(0,0,0,.08);
    --border-dark: rgba(0,0,0,.14);
    --border-focus: var(--primary);
    --overlay:     rgba(0,0,0,.45);

    /* ── Text ── */
    --text:        #171A23;
    --text-muted:  #5E6478;
    --text-light:  #7C8294;
    --text-disabled:#A1A6B4;

    /* ── Typography scale ── */
    --text-xs: 0.6875rem; --text-sm: 0.8125rem; --text-base: 0.9375rem;
    --text-lg: 1.0625rem; --text-xl: 1.25rem;
    --leading-tight: 1.15; --leading-snug: 1.3;
    --leading-normal: 1.55; --leading-relaxed: 1.7;

    /* ── Spacing (8px base) ── */
    --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
    --space-4: 1rem;    --space-5: 1.25rem; --space-6: 1.5rem;
    --space-8: 2rem;    --space-10: 2.5rem; --space-12: 3rem;
    --space-16: 4rem;   --space-20: 5rem;   --space-24: 6rem;

    /* ── Radius ── */
    --radius-sm:   6px;
    --radius:      10px;
    --radius-lg:   14px;
    --radius-xl:   20px;
    --radius-full: 9999px;

    /* ── Shadows ── */
    --shadow-xs:   0 1px 2px rgba(0,0,0,.04);
    --shadow-sm:   0 1px 2px rgba(0,0,0,.04), 0 1px 4px rgba(0,0,0,.04);
    --shadow:      0 2px 8px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
    --shadow-lg:   0 8px 24px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.06);
    --shadow-xl:   0 16px 48px rgba(0,0,0,.12);

    /* ── Motion ── */
    --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms; --duration-normal: 250ms; --duration-slow: 400ms;

    /* ── Layout ── */
    --nav-h:       64px;

    /* ── Typography ── */
    --font:        'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-brand:  'Outfit', sans-serif;
    --font-mono:   'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

/* ── Dark Mode ────────────────────────────────────────── */
[data-theme="dark"] {
    --bg:              #0F1118;
    --surface:         #171A23;
    --surface-elevated:#1F232E;
    --border:          rgba(255,255,255,.06);
    --border-dark:     rgba(255,255,255,.12);
    --overlay:         rgba(15,17,24,.8);

    --text:            #F1F2F5;
    --text-muted:      #A1A6B4;
    --text-light:      #7C8294;
    --text-disabled:   #5E6478;

    --primary-light:   rgba(139,63,232,.15);
    --gradient-subtle: linear-gradient(135deg, rgba(139,63,232,.12) 0%, rgba(91,110,247,.12) 100%);

    --shadow-xs:   0 1px 2px rgba(0,0,0,.3);
    --shadow-sm:   0 2px 4px rgba(0,0,0,.25);
    --shadow:      0 4px 12px rgba(0,0,0,.3);
    --shadow-lg:   0 8px 24px rgba(0,0,0,.35);
    --shadow-xl:   0 16px 48px rgba(0,0,0,.4);

    --success-light: rgba(16,185,129,.12);
    --warning-light: rgba(245,158,11,.12);
    --error-light:   rgba(239,68,68,.12);
    --info-light:    rgba(59,130,246,.12);
}
[data-theme="dark"] .navbar { background: rgba(23,26,35,.85); }
[data-theme="dark"] code { background: #1F232E; color: var(--purple-300); }
[data-theme="dark"] .alert-info    { background: var(--info-light);    border-color: rgba(59,130,246,.25); color: #60A5FA; }
[data-theme="dark"] .alert-success { background: var(--success-light); border-color: rgba(16,185,129,.25); color: #34D399; }
[data-theme="dark"] .alert-warning { background: var(--warning-light); border-color: rgba(245,158,11,.25); color: #FBBF24; }
[data-theme="dark"] .alert-error   { background: var(--error-light);   border-color: rgba(239,68,68,.25); color: #F87171; }
[data-theme="dark"] .badge-live      { background: var(--success-light); color: #34D399; }
[data-theme="dark"] .badge-building  { background: var(--warning-light); color: #FBBF24; }
[data-theme="dark"] .badge-error     { background: var(--error-light);   color: #F87171; }
[data-theme="dark"] .badge-draft     { background: rgba(255,255,255,.06); color: #7C8294; }
[data-theme="dark"] .badge-suspended { background: var(--primary-light);  color: #B98DF7; }

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) {
        --bg:              #0F1118;
        --surface:         #171A23;
        --surface-elevated:#1F232E;
        --border:          rgba(255,255,255,.06);
        --border-dark:     rgba(255,255,255,.12);
        --text:            #F1F2F5;
        --text-muted:      #A1A6B4;
        --text-light:      #7C8294;
    }
}

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

html { font-size: 16px; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: .9375rem;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-brand);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.15;
}

/* ── Utility ─────────────────────────────────────────── */

.text-center { text-align: center; }

code {
    font-family: var(--font-mono);
    font-size: .875em;
    background: #f1f5f9;
    padding: .1em .4em;
    border-radius: 4px;
    color: var(--primary-dark);
}

/* ── Buttons ─────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.25rem;
    border-radius: var(--radius);
    font-size: .9375rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .15s ease;
    white-space: nowrap;
    user-select: none;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-primary  { background: var(--gradient-brand); color: #fff; border-color: transparent; box-shadow: 0 1px 2px rgba(139,63,232,.2); }
.btn-primary:hover:not(:disabled) { background: var(--gradient-hover); box-shadow: var(--shadow-glow); }

.btn-outline  { background: transparent; color: var(--primary); border-color: rgba(139,63,232,.35); }
.btn-outline:hover:not(:disabled) { background: var(--primary-light); border-color: var(--primary); }

.btn-ghost    { background: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--border); color: var(--text); }

.btn-danger   { background: var(--error); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }

.btn-github   { background: #24292e; color: #fff; }
.btn-github:hover:not(:disabled) { background: #1a1e22; }

.btn-full     { width: 100%; justify-content: center; }
.btn-sm       { padding: .35rem .75rem; font-size: .875rem; }

.btn-icon {
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; border: none; background: transparent;
    cursor: pointer; font-size: 1.2rem; color: var(--text-muted);
    transition: background .15s;
}
.btn-icon:hover { background: var(--border); }

.btn-back {
    display: inline-flex; align-items: center; gap: .25rem;
    color: var(--text-muted); text-decoration: none; font-size: .875rem;
    margin-bottom: .75rem;
}
.btn-back:hover { color: var(--text); }

.github-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* ── App Shell ───────────────────────────────────────── */

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ── Navbar ──────────────────────────────────────────── */

.navbar {
    height: var(--nav-h);
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1.5rem;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 1px 0 rgba(0,0,0,.06);
}

.brand-link {
    display: flex; align-items: center; gap: .5rem;
    text-decoration: none; color: var(--text);
    font-family: var(--font-brand);
    font-weight: 700; font-size: 1.1rem;
    letter-spacing: -.02em;
}
.brand-icon {
    width: 28px; height: 28px;
    background: var(--gradient-brand);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem; color: #fff;
    box-shadow: 0 2px 8px rgba(139,63,232,.3);
}

.navbar-menu { display: flex; gap: .25rem; margin-left: .5rem; }

.nav-link {
    padding: .4rem .75rem; border-radius: var(--radius);
    text-decoration: none; color: var(--text-muted);
    font-size: .9375rem; font-weight: 500; transition: all .15s;
}
.nav-link:hover { color: var(--text); background: rgba(0,0,0,.04); }
.nav-link.active { color: var(--primary); background: var(--primary-light); font-weight: 600; }

.navbar-end { margin-left: auto; display: flex; align-items: center; gap: .75rem; }

.credit-badge {
    display: flex; align-items: center; gap: .25rem;
    background: var(--gradient-subtle); color: var(--primary-dark);
    border: 1px solid rgba(139,63,232,.2);
    padding: .25rem .65rem; border-radius: 99px;
    font-size: .8125rem; font-weight: 600;
    font-family: var(--font-brand);
}
.credit-icon { font-size: .875rem; }

.user-menu { position: relative; cursor: pointer; }

.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--gradient-brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: .875rem; font-weight: 600; overflow: hidden;
    box-shadow: 0 0 0 2px rgba(139,63,232,.2);
    font-family: var(--font-brand);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-dropdown {
    position: absolute; right: 0; top: calc(100% + .5rem);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    min-width: 200px; padding: .5rem 0; z-index: 200;
}
.user-info { padding: .75rem 1rem; }
.user-name  { font-weight: 600; font-size: .9375rem; }
.user-email { color: var(--text-muted); font-size: .8125rem; }
.user-plan  { margin-top: .25rem; font-size: .8125rem; color: var(--text-muted); }
.user-dropdown hr { border: none; border-top: 1px solid var(--border); margin: .5rem 0; }

.dropdown-item {
    display: block; width: 100%;
    padding: .5rem 1rem; background: none; border: none;
    text-align: left; font-size: .9375rem; cursor: pointer;
    color: var(--text); transition: background .15s;
}
.dropdown-item:hover { background: var(--bg); }
.dropdown-item.danger { color: var(--error); }

/* ── Main content ────────────────────────────────────── */

.main-content { flex: 1; }
.main-content.with-nav { padding-top: 0; }

/* ── Auth Layout ─────────────────────────────────────── */

.auth-shell {
    min-height: 100vh; background: var(--bg);
    display: flex; flex-direction: column; align-items: center;
}
.auth-brand {
    padding: 2rem 0 0;
}
.auth-main {
    flex: 1; display: flex; align-items: flex-start;
    justify-content: center; padding: 2rem 1rem;
    width: 100%;
}
.auth-footer { padding: 1.5rem; color: var(--text-light); font-size: .8125rem; }

.auth-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow);
    padding: 2.5rem; width: 100%; max-width: 440px;
}
.auth-title    { font-size: 1.75rem; font-weight: 700; margin-bottom: .25rem; }
.auth-subtitle { color: var(--text-muted); margin-bottom: 1.5rem; }
.auth-divider  {
    display: flex; align-items: center; gap: .75rem;
    margin: 1.25rem 0; color: var(--text-light); font-size: .875rem;
}
.auth-divider::before, .auth-divider::after {
    content: ''; flex: 1; border-top: 1px solid var(--border);
}
.auth-link  { text-align: center; margin-top: 1.25rem; font-size: .9375rem; color: var(--text-muted); }
.auth-link a { color: var(--primary); text-decoration: none; font-weight: 500; }
.auth-terms { font-size: .8125rem; color: var(--text-muted); text-align: center; margin-top: .75rem; }
.auth-terms a { color: var(--primary); }

/* Email confirmation */
.email-icon { font-size: 3rem; margin-bottom: 1rem; }
.confirm-instructions { color: var(--text-muted); margin-bottom: 1.5rem; }
.confirm-actions { display: flex; flex-direction: column; gap: .75rem; }
.confirm-tip { font-size: .8125rem; color: var(--text-light); margin-top: 1.25rem; }

/* ── Form ─────────────────────────────────────────────── */

.form-group  { margin-bottom: 1.125rem; }
.form-label  {
    display: flex; justify-content: space-between; align-items: center;
    font-size: .875rem; font-weight: 500; color: var(--text); margin-bottom: .375rem;
}
.form-label-link { font-weight: 400; color: var(--primary); text-decoration: none; font-size: .8125rem; }
.form-input {
    width: 100%; padding: .6rem .875rem;
    border: 1px solid var(--border-dark); border-radius: var(--radius);
    font-size: .9375rem; color: var(--text); background: var(--surface);
    font-family: var(--font);
    transition: border-color .15s, box-shadow .15s;
    outline: none; appearance: none;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(139,63,232,.12); }
.form-hint { font-size: .8125rem; color: var(--text-muted); margin-top: .3rem; display: block; }

/* ── Alerts ──────────────────────────────────────────── */

.alert {
    display: flex; align-items: flex-start; gap: .5rem;
    padding: .75rem 1rem; border-radius: var(--radius);
    font-size: .9375rem; margin-bottom: 1rem; border: 1px solid;
}
.alert-icon { font-size: 1rem; margin-top: .05rem; flex-shrink: 0; }
.alert-close { margin-left: auto; background: none; border: none; cursor: pointer; opacity: .7; font-size: 1.1rem; }

.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* ── Badges ──────────────────────────────────────────── */

.badge {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .2rem .6rem; border-radius: 99px;
    font-size: .75rem; font-weight: 600; letter-spacing: .02em;
    text-transform: uppercase;
}
.badge-live     { background: #d1fae5; color: #065f46; }
.badge-building { background: #fef3c7; color: #92400e; }
.badge-error    { background: #fee2e2; color: #991b1b; }
.badge-draft    { background: #f1f5f9; color: #64748b; }
.badge-suspended{ background: #f3e8ff; color: #6b21a8; }

@keyframes pulse-ring {
    0%   { opacity: 1; }
    50%  { opacity: .4; }
    100% { opacity: 1; }
}
.badge.pulse { animation: pulse-ring 1.5s ease-in-out infinite; }

/* ── Spinner ─────────────────────────────────────────── */

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

.spinner {
    display: inline-block;
    width: 24px; height: 24px;
    border: 3px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }

.loading-page {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    min-height: 40vh; gap: 1rem;
}
.loading-msg { color: var(--text-muted); font-size: .9375rem; }

/* ── Modal ───────────────────────────────────────────── */

.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 1rem;
}
.modal-box {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem; width: 100%; max-width: 480px;
}
.modal-lg { max-width: 760px; display: flex; gap: 2rem; padding: 0; overflow: hidden; }
.modal-template-preview { width: 45%; background: #f1f5f9; }
.modal-template-preview img { width: 100%; height: 100%; object-fit: cover; }
.modal-template-form { flex: 1; padding: 2rem; }
.modal-title { font-size: 1.25rem; font-weight: 600; margin-bottom: .5rem; }
.modal-body  { color: var(--text-muted); margin-bottom: 1.5rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1.5rem; }
.modal-template-category { color: var(--text-muted); font-size: .875rem; margin-bottom: 1.5rem; }

/* ── Page layout ─────────────────────────────────────── */

.page-container { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem; }
.page-header    { margin-bottom: 2rem; }
.page-title     { font-size: 1.875rem; font-weight: 800; margin-bottom: .375rem; font-family: var(--font-brand); letter-spacing: -.03em; }
.page-subtitle  { color: var(--text-muted); font-size: .9375rem; }

/* ── Dashboard ───────────────────────────────────────── */

.dashboard-page { max-width: 1100px; margin: 0 auto; padding: var(--space-8) var(--space-6); }

.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-8);
    gap: var(--space-4);
}

.dash-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 var(--space-2) 0;
}

.dash-subtitle {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.dash-plan-badge {
    display: inline-flex;
    align-items: center;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: .2rem .55rem;
    border-radius: var(--radius-full);
}

.dash-plan-usage {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.dash-limit-tag {
    font-size: .72rem;
    font-weight: 600;
    color: var(--error);
    background: var(--error-light);
    padding: .15rem .5rem;
    border-radius: var(--radius-full);
}

.dash-actions {
    flex-shrink: 0;
    padding-top: .25rem;
}

/* ── Sites grid ─────────────────────────────────────── */

.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4);
}

/* ── Site card ──────────────────────────────────────── */

.site-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    transition: all 250ms cubic-bezier(.16, 1, .3, 1);
}
.site-card:hover {
    border-color: var(--border-dark);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.site-card-body { flex: 1; }

.site-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
}

.site-card-name {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.site-card-url {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.site-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
}

.site-card-date {
    font-size: var(--text-xs);
    color: var(--text-light);
}

.site-card-action {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--primary);
    transition: color 150ms;
}
.site-card:hover .site-card-action {
    color: var(--primary-dark);
}

/* ── Empty state ─────────────────────────────────────── */

.empty-state {
    text-align: center; padding: 4rem 2rem;
    max-width: 480px; margin: 0 auto;
}
.empty-icon  { font-size: 3.5rem; margin-bottom: 1rem; }
.empty-state h2 { font-size: 1.375rem; margin-bottom: .5rem; }
.empty-state p  { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ── Plans ───────────────────────────────────────────── */

.plans-page   { max-width: 960px; margin: 0 auto; padding: 3rem 1.5rem; }
.plans-header { text-align: center; margin-bottom: 3rem; }
.plans-header h1 { font-size: 2.25rem; font-weight: 700; margin-bottom: .5rem; }
.plans-header p  { color: var(--text-muted); font-size: 1.0625rem; }

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem; align-items: start;
}
.plans-grid-3 { max-width: 900px; margin-inline: auto; }

.plan-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem; position: relative;
    transition: transform .2s, box-shadow .2s;
    display: flex; flex-direction: column;
}
.plan-card:not(.plan-current):hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(139, 63, 232, .15);
}
.plan-featured {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary), var(--shadow);
}
.plan-featured:hover {
    box-shadow: 0 0 0 2px var(--primary), 0 12px 32px rgba(139, 63, 232, .25);
}
.plan-badge {
    position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
    background: var(--primary); color: #fff;
    padding: .25rem .9rem; border-radius: 99px;
    font-size: .8125rem; font-weight: 600; white-space: nowrap;
}
.plan-header { margin-bottom: 1.5rem; }
.plan-name   { font-size: 1.25rem; font-weight: 600; margin-bottom: .75rem; }
.plan-price  { display: flex; align-items: baseline; gap: .25rem; flex-wrap: wrap; }
.plan-currency { font-size: 1.25rem; font-weight: 600; color: var(--text-muted); margin-top: .3rem; }
.plan-amount   { font-size: 3rem; font-weight: 700; line-height: 1; }
.plan-period   { color: var(--text-muted); }
.plan-plus-domain { font-size: .8125rem; color: var(--text-muted); width: 100%; margin-top: .25rem; }

.plan-features { list-style: none; margin: 1.5rem 0; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.feature-item  { display: flex; align-items: flex-start; gap: .5rem; font-size: .9375rem; line-height: 1.4; }
.feature-check { color: var(--success); font-weight: 700; flex-shrink: 0; }
.feature-x     { color: var(--text-light); flex-shrink: 0; }
.feature-unavailable { color: var(--text-light); text-decoration: line-through; }
.feature-highlight { color: var(--primary); font-weight: 500; }

.plans-note { text-align: center; color: var(--text-muted); font-size: .875rem; margin-top: 2rem; }
.plans-header { text-align: center; }
.plans-dashboard-btn { margin-top: 1.25rem; display: inline-block; }

/* ── Novo site ───────────────────────────────────────── */

.novo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem; margin-top: 1rem;
}
.novo-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xl); padding: 2rem 1.75rem;
    text-decoration: none; color: var(--text);
    display: flex; flex-direction: column; gap: .875rem;
    transition: border-color .2s, box-shadow .2s, transform .2s;
    box-shadow: var(--shadow-sm);
}
.novo-card:hover {
    border-color: rgba(139,63,232,.4);
    box-shadow: var(--shadow), 0 0 0 4px rgba(139,63,232,.06);
    transform: translateY(-2px);
}
.novo-card-icon {
    width: 52px; height: 52px;
    background: var(--gradient-subtle);
    border: 1px solid rgba(139,63,232,.15);
    border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
}
.novo-card-title { font-size: 1.2rem; font-weight: 700; font-family: var(--font-brand); letter-spacing: -.02em; }
.novo-card-desc  { color: var(--text-muted); font-size: .9375rem; line-height: 1.6; flex: 1; }

/* ── Templates ───────────────────────────────────────── */

.category-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.5rem; }
.tab {
    padding: .35rem .9rem; border-radius: 99px;
    font-size: .8125rem; font-weight: 500; cursor: pointer;
    border: 1px solid var(--border-dark); background: var(--surface); color: var(--text-muted);
    transition: all .15s;
}
.tab:hover { border-color: rgba(139,63,232,.3); color: var(--primary); background: var(--primary-light); }
.tab.active { background: var(--gradient-brand); border-color: transparent; color: #fff; box-shadow: 0 2px 8px rgba(139,63,232,.25); }

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.template-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
    cursor: pointer; transition: border-color .2s, box-shadow .2s, transform .2s;
    position: relative; box-shadow: var(--shadow-sm);
}
.template-card:hover { border-color: rgba(139,63,232,.4); box-shadow: var(--shadow); transform: translateY(-2px); }
.template-card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(139,63,232,.15); }
.template-preview { aspect-ratio: 4/3; overflow: hidden; background: var(--bg); }
.template-preview img { width: 100%; height: 100%; object-fit: cover; }
.template-preview-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; font-weight: 700;
    background: var(--gradient-subtle); color: rgba(139,63,232,.3);
}
.template-info    { padding: .75rem 1rem; }
.template-category {
    font-size: .6875rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--primary);
}
.template-name    { font-size: .9375rem; font-weight: 600; margin-top: .15rem; font-family: var(--font-brand); }
.template-selected-badge {
    position: absolute; top: .6rem; right: .6rem;
    background: var(--gradient-brand); color: #fff;
    padding: .2rem .55rem; border-radius: 99px;
    font-size: .7rem; font-weight: 700; letter-spacing: .02em;
    box-shadow: 0 2px 8px rgba(139,63,232,.3);
}

/* ── Upload ──────────────────────────────────────────── */

.upload-form-container { max-width: 580px; }
.upload-zone {
    border: 2px dashed rgba(139,63,232,.25);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem; text-align: center;
    transition: border-color .2s, background .2s;
    cursor: default;
    background: var(--surface);
}
.upload-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(139,63,232,.08);
}
.upload-zone.has-file  { border-style: solid; border-color: var(--success); }
.upload-placeholder    { display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.upload-icon           { font-size: 3rem; }
.upload-or             { color: var(--text-light); font-size: .875rem; }
.upload-hint           { font-size: .8125rem; color: var(--text-light); }
.upload-file-info      { display: flex; align-items: center; gap: .75rem; text-align: left; }
.upload-file-icon      { font-size: 2rem; }
.upload-file-name      { font-weight: 500; }
.upload-file-size      { font-size: .8125rem; color: var(--text-muted); }

/* ── Site detail ─────────────────────────────────────── */

.site-detail-header { display: flex; justify-content: space-between; align-items: flex-start; }
.site-slug          { font-family: var(--font-mono); font-size: .875rem; color: var(--text-muted); }

.detail-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem; margin-bottom: 1.25rem;
}
.section-title { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.section-desc  { color: var(--text-muted); font-size: .9375rem; margin-bottom: 1rem; }

.url-rows   { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1rem; }
.url-row    { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.url-label  { display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: var(--text-muted); min-width: 220px; }
.url-badge  { font-size: .7rem; font-weight: 700; padding: .1rem .4rem; border-radius: 4px; }
.url-badge.free   { background: #d1fae5; color: #065f46; }
.url-badge.custom { background: var(--primary-light); color: var(--primary-dark); }
.url-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.site-url-pending { color: var(--text-light); font-family: var(--font-mono); font-size: .9375rem; }

.build-summary { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.build-time    { font-size: .875rem; color: var(--text-muted); }
.build-trigger { font-size: .875rem; color: var(--text-light); }
.build-logs    { margin-top: .75rem; }
.build-logs summary { cursor: pointer; font-size: .875rem; color: var(--text-muted); }
.log-output {
    background: #0f172a; color: #94a3b8;
    font-family: var(--font-mono); font-size: .8125rem;
    padding: 1rem; border-radius: var(--radius);
    margin-top: .5rem; overflow-x: auto; max-height: 300px;
    white-space: pre-wrap; word-break: break-all;
}

.builds-table { display: flex; flex-direction: column; gap: .5rem; }
.build-row    {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    padding: .5rem .75rem; background: var(--bg); border-radius: var(--radius);
    font-size: .875rem;
}
.build-sha { font-family: var(--font-mono); font-size: .8125rem; color: var(--text-muted); }
.build-date { color: var(--text-muted); margin-left: auto; }

/* Danger zone */
.danger-zone   { border-color: #fecaca; }
.section-title.danger { color: var(--error); }
.danger-action {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.danger-action p { font-size: .875rem; color: var(--text-muted); margin-top: .15rem; }

/* ── Domains ─────────────────────────────────────────── */

.badge-free { background: #d1fae5; color: #065f46; font-size: .7rem; font-weight: 700; padding: .1rem .4rem; border-radius: 4px; }
.badge-pro  { background: var(--primary-light); color: var(--primary-dark); font-size: .7rem; font-weight: 700; padding: .1rem .4rem; border-radius: 4px; margin-left: .4rem; }

.section-locked { opacity: .75; }

.domain-display { display: flex; align-items: center; gap: 1rem; }
.domain-code { font-size: 1rem; padding: .4rem .8rem; }

.upgrade-banner {
    background: #fffbeb; border: 1px solid #fde68a;
    border-radius: var(--radius); padding: 1rem 1.25rem;
    display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
    margin-bottom: 1rem;
}
.upgrade-banner p { flex: 1; margin: 0; font-size: .9375rem; }

.domain-status-card {
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 1.25rem; margin-bottom: 1rem;
}
.domain-status-card.status-active  { border-color: var(--success); background: #ecfdf5; }
.domain-status-card.status-error   { border-color: var(--error); background: #fef2f2; }
.domain-status-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
/* Aviso de pré-requisito Cloudflare */
.domain-cf-notice {
    display: flex; align-items: flex-start; gap: .75rem;
    background: #eff6ff; border: 1px solid #bfdbfe;
    border-radius: var(--radius); padding: .875rem 1rem;
    font-size: .875rem; color: #1e40af; line-height: 1.5;
}
.domain-cf-notice a { color: #1d4ed8; text-decoration: underline; }
.domain-cf-icon { font-size: 1.25rem; line-height: 1; flex-shrink: 0; }

/* Bloco de provisionamento pendente */
.cname-instructions {
    display: flex; align-items: center; gap: .75rem;
    margin: .75rem 0; font-size: .9rem; color: var(--text-muted);
}
.domain-active-msg { color: var(--success); font-size: .9375rem; margin: .5rem 0; }
.domain-error-msg  { color: var(--error); font-size: .875rem; margin: .5rem 0; }

/* ── Landing page ────────────────────────────────────── */

.landing {
    max-width: 760px; margin: 6rem auto; text-align: center; padding: 2rem;
}
.landing h1 { font-size: 3.25rem; font-weight: 800; margin-bottom: 1rem; letter-spacing: -.02em; }
.landing-sub { font-size: 1.25rem; color: var(--text-muted); margin-bottom: 2.5rem; max-width: 520px; margin-left: auto; margin-right: auto; }
.cta-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Not found ───────────────────────────────────────── */

.not-found { text-align: center; padding: 5rem 2rem; }
.not-found h1 { font-size: 6rem; font-weight: 800; color: var(--border-dark); line-height: 1; }
.not-found p  { color: var(--text-muted); margin: .75rem 0 2rem; font-size: 1.125rem; }

/* ── Plan current state ──────────────────────────────── */

.plan-current {
    border: 2px solid var(--primary);
    background: color-mix(in srgb, var(--primary) 4%, var(--surface));
}
.plan-badge-current {
    background: var(--primary);
    color: white;
}
.plan-free-label {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
}

/* ── Upload Progress ─────────────────────────────────── */

.upload-progress-page {
    max-width: 520px;
    margin: 4rem auto;
    padding: 0 1rem;
}

.progress-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.progress-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 0;
    border-left: 2px solid var(--border);
    padding-left: 1.5rem;
    position: relative;
}

.progress-step:last-child { border-left-color: transparent; }

.progress-step.active  { border-left-color: var(--primary); }
.progress-step.done    { border-left-color: var(--success); }
.progress-step.pending { border-left-color: var(--border); opacity: .5; }

.step-icon-wrap {
    position: absolute;
    left: -13px;
    top: 1.25rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    background: var(--surface);
    border: 2px solid var(--border);
    color: var(--text-muted);
}

.progress-step.active .step-icon-wrap  { border-color: var(--primary); color: var(--primary); }
.progress-step.done   .step-icon-wrap  { border-color: var(--success); background: var(--success); color: white; }

.step-spinner {
    width: 14px; height: 14px;
    border: 2px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.step-check { font-size: .9rem; }
.step-num   { font-size: .75rem; }

.step-body { flex: 1; min-width: 0; }

.step-label {
    font-weight: 600;
    color: var(--text);
    margin-bottom: .25rem;
}
.progress-step.pending .step-label { color: var(--text-muted); }

.step-progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin: .5rem 0 .25rem;
}

.step-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width .3s ease;
}

.step-pct      { font-size: .8rem; color: var(--primary); font-weight: 600; }
.step-done-text { font-size: .85rem; color: var(--text-muted); }
.step-hint     { font-size: .85rem; color: var(--text-muted); margin-top: .25rem; }
.step-elapsed  { font-size: .8rem; color: var(--text-light); margin-top: .25rem; }

/* ── Deploy Monitor (Detalhes) ───────────────────────── */

.deploy-monitor {
    background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 100%);
    border: 1px solid #c7d2fe;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.deploy-monitor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.deploy-monitor-title {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--primary-dark);
}

.deploy-spinner {
    width: 18px; height: 18px;
    border: 2.5px solid #c7d2fe;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    flex-shrink: 0;
}

.deploy-elapsed {
    font-size: .8rem;
    color: var(--text-muted);
    font-feature-settings: "tnum";
}

.deploy-steps {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: 1.25rem;
}

.deploy-step {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .9rem;
    color: var(--text-muted);
}

.ds-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--border-dark);
    flex-shrink: 0;
    transition: background .3s;
}

.deploy-step.ds-done .ds-dot  { background: var(--success); }
.deploy-step.ds-active .ds-dot { background: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.2); animation: pulse-dot 1.2s ease-in-out infinite; }
.deploy-step.ds-done  { color: var(--text); }
.deploy-step.ds-active { color: var(--primary-dark); font-weight: 500; }

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,.4); }
    50%       { box-shadow: 0 0 0 5px rgba(99,102,241,.0); }
}

.deploy-logs {
    background: #0f172a;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.deploy-logs summary {
    color: #94a3b8;
    font-size: .8rem;
    cursor: pointer;
    margin-bottom: .5rem;
    user-select: none;
}

.log-live {
    color: #a5f3fc;
    font-size: .78rem;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.deploy-hint {
    font-size: .82rem;
    color: #6366f1;
    text-align: center;
    margin-top: .5rem;
}

.url-status-tag {
    font-size: .7rem;
    background: var(--border);
    color: var(--text-muted);
    padding: .1rem .4rem;
    border-radius: 4px;
    margin-left: .4rem;
}

/* ── Plan badges ─────────────────────────────────────── */

.plan-badge,
.dash-plan-badge {
    display: inline-flex;
    align-items: center;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: .2rem .55rem;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.plan-badge-starter {
    background: #dbeafe;
    color: #1d4ed8;
}

.plan-badge-pro {
    background: #ede9fe;
    color: #6d28d9;
}

.plan-badge-free,
.plan-badge-grátis {
    background: #d1fae5;
    color: #065f46;
}

/* ── ConfirmModal required-input section ─────────────── */

.modal-required-input {
    margin: .75rem 0 .5rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.modal-input-instruction {
    font-size: .85rem;
    color: var(--text-muted);
    margin: 0;
}

.modal-slug-copy {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .45rem .75rem;
}

.modal-slug-value {
    flex: 1;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: .85rem;
    color: var(--text);
    user-select: all;
}

.btn-copy-slug {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: .9rem;
    padding: .2rem .45rem;
    transition: background .15s, color .15s;
    line-height: 1;
    flex-shrink: 0;
}

.btn-copy-slug:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-color: var(--primary);
}

.input-error {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 2px rgba(239,68,68,.15);
}

.modal-input-hint-error {
    font-size: .78rem;
    color: var(--error);
    margin: 0;
}

/* ── Upload deploy — file tree ───────────────────────── */

.upload-deploy-container {
    max-width: 680px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.upload-hint-sub {
    font-size: .8rem;
    color: var(--text-light);
    margin: .1rem 0 0;
}

/* Header da árvore */
.ft-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .6rem;
}

.ft-count {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text);
}

.ft-remove-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: .82rem;
    cursor: pointer;
    padding: 0;
}
.ft-remove-btn:hover { color: var(--error); text-decoration: underline; }

/* Lista de arquivos */
.ft-list {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    max-height: 340px;
    overflow-y: auto;
}

.ft-row {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .48rem .75rem;
    border-bottom: 1px solid var(--border);
    font-size: .82rem;
}
.ft-row:last-child { border-bottom: none; }

.ft-folder {
    background: var(--surface);
    font-weight: 500;
}

.ft-indent {
    padding-left: 2.5rem;
}

.ft-expand-icon {
    font-size: .65rem;
    color: var(--text-light);
    flex-shrink: 0;
    width: 10px;
}

.ft-type-icon {
    font-size: .85rem;
    flex-shrink: 0;
    line-height: 1;
}

.ft-name {
    flex: 1;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'SFMono-Regular', Consolas, monospace;
}

.ft-size {
    color: var(--text-muted);
    font-size: .76rem;
    white-space: nowrap;
    min-width: 52px;
    text-align: right;
}

/* Ícones de status */
.ft-status {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 50%;
}

.ft-pending {
    border: 1.5px solid var(--border-dark);
}

.ft-uploading {
    border: 2px solid var(--primary);
    border-top-color: transparent;
    animation: ft-spin .65s linear infinite;
}

.ft-done {
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.ft-done::after {
    content: '✓';
    color: #fff;
    font-size: .58rem;
    font-weight: 900;
    line-height: 1;
}

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

/* Banner todos enviados */
.ft-all-done-banner {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    padding: .55rem 1rem;
    font-size: .84rem;
    font-weight: 500;
    margin-bottom: .65rem;
}

.ft-all-done-icon {
    font-size: 1rem;
    font-weight: 700;
}

/* URL preview abaixo do campo nome do site */
.ft-url-preview {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-top: .5rem;
    padding: .5rem .75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .875rem;
}

.ft-url-label {
    color: var(--text-light);
    white-space: nowrap;
    flex-shrink: 0;
}

.ft-url-value {
    font-family: monospace;
    font-size: .85rem;
    word-break: break-all;
}

.ft-url-slug {
    color: var(--primary);
    font-weight: 600;
}

.ft-url-domain {
    color: var(--text-muted);
}

.ft-url-placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.slug-status {
    font-size: var(--text-xs);
    font-weight: 600;
    margin-left: var(--space-2);
}
.slug-checking { color: var(--text-muted); }
.slug-available { color: var(--success); }
.slug-taken { color: var(--error); }

.slug-preview {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
    font-size: var(--text-sm);
    font-family: var(--font-mono);
}

.input-error {
    border-color: var(--error) !important;
}
.input-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .15) !important;
}

/* Badges de tipos de arquivo aceitos */
.upload-types {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    margin-top: .25rem;
}

.upload-type-badge {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: .15rem .45rem;
    font-size: .75rem;
    font-family: monospace;
    color: var(--text-muted);
    font-weight: 500;
}

.upload-buttons {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-3);
}

.upload-type-sep {
    font-size: .75rem;
    color: var(--text-light);
}

/* Barra de processamento no servidor */
.ft-server-bar {
    display: flex;
    align-items: center;
    gap: .65rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .6rem 1rem;
    font-size: .82rem;
    color: var(--text-muted);
    margin-top: .75rem;
}

/* Botão de ação da árvore */
.ft-action-btn {
    margin-top: 1rem;
}

/* ── Secondary Button ────────────────────────────────── */

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-dark);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg); border-color: var(--primary); }

/* ── Avatar Sizes ────────────────────────────────────── */

.avatar-xs { width: 24px; height: 24px; font-size: .625rem; }
.avatar-sm { width: 32px; height: 32px; font-size: .75rem; }
.avatar-md { width: 40px; height: 40px; font-size: .875rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1rem; }
.avatar-xl { width: 64px; height: 64px; font-size: 1.25rem; }

/* ── Skeleton Loader ─────────────────────────────────── */

@keyframes skeleton-pulse {
    0%   { opacity: 1; }
    50%  { opacity: .4; }
    100% { opacity: 1; }
}
.skeleton {
    background: var(--border);
    border-radius: var(--radius);
    animation: skeleton-pulse 1.8s ease-in-out infinite;
}
.skeleton-text   { height: .875rem; width: 80%; border-radius: 4px; margin-bottom: .5rem; }
.skeleton-title  { height: 1.25rem; width: 60%; border-radius: 4px; margin-bottom: .75rem; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-card   { height: 120px; border-radius: var(--radius-lg); }
.skeleton-btn    { height: 40px; width: 120px; border-radius: var(--radius); }

/* ── Progress Bar ────────────────────────────────────── */

.progress {
    height: 6px; background: var(--border);
    border-radius: var(--radius-full); overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: var(--gradient-brand);
    border-radius: var(--radius-full);
    transition: width var(--duration-normal) var(--ease-out);
}
.progress-lg { height: 10px; }

/* ── Badge variants (Hexa Labs) ──────────────────────── */

.badge-brand   { background: rgba(139,63,232,.12); color: var(--primary); }
.badge-success { background: var(--success-light);  color: var(--success); }
.badge-warning { background: var(--warning-light);  color: var(--warning); }
.badge-danger  { background: var(--error-light);    color: var(--error); }
.badge-info    { background: var(--info-light);     color: var(--info); }
.badge-neutral { background: rgba(0,0,0,.06);       color: var(--text-muted); }
[data-theme="dark"] .badge-neutral { background: rgba(255,255,255,.08); }

/* ── Tabs (Hexa Labs) ────────────────────────────────── */

.tabs {
    display: flex; gap: var(--space-1);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-6);
}
.tab {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm); font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer; transition: all var(--duration-fast);
    background: none; border-top: none; border-left: none; border-right: none;
}
.tab:hover { color: var(--text); }
.tab.active {
    color: var(--primary); border-bottom-color: var(--primary);
    font-weight: 600;
}

/* ── Theme Toggle ────────────────────────────────────── */

.theme-toggle {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer; font-size: 1.1rem;
    color: var(--text-muted);
    transition: all var(--duration-fast);
}
.theme-toggle:hover { background: var(--border); color: var(--text); }

/* ── Collection management ───────────────────────────── */

.collection-header {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.collection-usage-badge {
    display: inline-flex; align-items: center;
    padding: .2rem .7rem; border-radius: 99px;
    font-size: .8125rem; font-weight: 600;
    background: var(--primary-light); color: var(--primary);
}
.collection-add-btn {
    margin-bottom: 1.25rem;
}
.collection-list {
    display: flex; flex-direction: column; gap: .75rem;
}
.collection-item-card {
    display: flex; align-items: center; gap: 1rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem 1.25rem;
    transition: border-color .15s, box-shadow .15s;
}
.collection-item-card:hover {
    border-color: var(--border-dark);
    box-shadow: var(--shadow-xs);
}
.collection-item-reorder {
    display: flex; flex-direction: column; gap: .2rem;
    flex-shrink: 0;
}
.btn-reorder {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 24px;
    background: transparent; border: 1px solid var(--border);
    border-radius: var(--radius-sm); cursor: pointer;
    color: var(--text-muted); font-size: .7rem;
    transition: all .15s;
}
.btn-reorder:hover:not(:disabled) {
    background: var(--border); color: var(--text);
}
.btn-reorder:disabled {
    opacity: .3; cursor: not-allowed;
}
.collection-item-content {
    flex: 1; min-width: 0;
}
.collection-item-title {
    font-weight: 600; font-size: .9375rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.collection-item-subtitle {
    color: var(--text-muted); font-size: .8125rem;
    margin-top: .2rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.collection-item-date {
    color: var(--text-light); font-size: .75rem; margin-top: .3rem;
}
.collection-item-actions {
    display: flex; gap: .5rem; flex-shrink: 0;
}
.btn-danger-text {
    color: var(--error) !important;
}
.btn-danger-text:hover:not(:disabled) {
    background: var(--error-light) !important;
}
.collection-textarea {
    resize: vertical; min-height: 80px;
    font-family: var(--font);
}
.field-required {
    color: var(--error); margin-left: .2rem; font-weight: 700;
}
.form-actions {
    display: flex; gap: .75rem; justify-content: flex-end;
    margin-top: 1.5rem; padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 640px) {
    .plans-grid   { grid-template-columns: 1fr; }
    .novo-grid    { grid-template-columns: 1fr; }
    .modal-lg     { flex-direction: column; max-width: 100%; max-height: 90vh; overflow-y: auto; }
    .modal-template-preview { width: 100%; aspect-ratio: 16/9; }
    .modal-template-form    { padding: 1.5rem; }
    .landing h1   { font-size: 2.25rem; }
    .navbar       { padding: 0 1rem; }
    .page-container { padding: 1.5rem 1rem; }
    .collection-item-card { flex-wrap: wrap; }
    .collection-item-actions { width: 100%; justify-content: flex-end; }
}
