* { box-sizing: border-box; }
html, body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

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

/* ============================================================
   DEMOCRATA — DESIGN SYSTEM v2.0
   El Juego Legislativo de Argentina
   ============================================================ */

:root {
    /* Core Colors */
    --bg:           #05070a;
    --bg-surface:   #0d1117;
    --bg-elevated:  #161b22;

    /* Glass System */
    --glass-1: rgba(22, 27, 34, 0.6);
    --glass-2: rgba(30, 35, 45, 0.5);
    --glass-border: rgba(255, 255, 255, 0.07);
    --glass-border-hover: rgba(212, 175, 55, 0.35);

    /* Gold — Premium */
    --gold:         #D4AF37;
    --gold-light:   #F3E5AB;
    --gold-dark:    #9a7d1c;
    --gold-glow:    rgba(212, 175, 55, 0.45);

    /* Cyan — Tech / Alerts */
    --cyan:         #00e5ff;
    --cyan-glow:    rgba(0, 229, 255, 0.35);

    /* Semantic */
    --approve:      #22c55e;
    --approve-glow: rgba(34, 197, 94, 0.4);
    --reject:       #ef4444;
    --reject-glow:  rgba(239, 68, 68, 0.4);
    --warning:      #f59e0b;
    --info:         #3b82f6;

    /* Text */
    --text:         #e2e8f0;
    --text-muted:   #64748b;
    --text-dim:     #334155;

    /* Sidebar width — always enough for full menu text */
    --sidebar-width: 270px;

    /* Spacing Scale */
    --space-xs: 0.4rem;
    --space-sm: 0.75rem;
    --space-md: 1.25rem;
    --space-lg: 2rem;
    --space-xl: 3rem;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-pill: 100px;

    /* Transitions */
    --ease-fast:   0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-elastic: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html, body {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 15px;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

a { color: var(--gold); text-decoration: none; transition: color var(--ease-fast); }
a:hover { color: var(--gold-light); }

/* ─── App Shell ─── */
.democrata-app {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 100vw;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(212,175,55,0.06) 0%, transparent 70%),
        radial-gradient(ellipse 50% 80% at 98% 50%, rgba(0,229,255,0.03) 0%, transparent 60%),
        var(--bg);
}

/* ─── Sidebar ─── */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--glass-1);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--glass-border);
    box-shadow: 4px 0 32px rgba(0,0,0,0.5);
    position: relative;
    z-index: 200;
    overflow: hidden;
}

/* Gold line accent at the top of sidebar */
.sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.6;
}

.brand-header {
    padding: 1.5rem 1.4rem 1.2rem;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.brand-icon {
    font-size: 1.75rem;
    line-height: 1;
}

.brand-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--gold-light) 20%, var(--gold) 80%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-tagline {
    font-size: 0.68rem;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 0.15rem;
    padding-left: 2.4rem;
}

/* ─── Nav Menu ─── */
.nav-scrollable {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.2rem 0.8rem;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border) transparent;
}

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 0.8rem 0.8rem 0.4rem;
}

.nav-link {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.72rem 0.8rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--ease-spring);
    white-space: normal;
    word-break: keep-all;
    overflow: visible;
    position: relative;
    margin-bottom: 0.2rem;
}

.nav-link .nav-icon {
    font-size: 1.05rem;
    flex-shrink: 0;
    margin-top: 1px;
    transition: transform var(--ease-spring), color var(--ease-fast);
}

.nav-link .nav-label { flex: 1; line-height: 1.3; }
.nav-link .nav-sub {
    font-size: 0.68rem;
    color: var(--text-dim);
    font-weight: 400;
    display: block;
    margin-top: 1px;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255,255,255,0.04);
    transform: translateX(4px);
}
.nav-link:hover .nav-icon {
    transform: scale(1.15);
    color: var(--gold);
}

.nav-link.active {
    color: var(--gold);
    background: linear-gradient(90deg, rgba(212,175,55,0.12), transparent);
    border-left: 3px solid var(--gold);
    padding-left: calc(0.8rem - 3px);
}
.nav-link.active .nav-icon { color: var(--gold); }
.nav-link.active .nav-sub { color: rgba(212,175,55,0.6); }

.nav-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 0.8rem 0.5rem;
}

/* ─── Main Area ─── */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-width: 0;
    overflow: hidden;
}

/* ─── HUD Top Bar ─── */
.top-hud {
    height: 72px;
    flex-shrink: 0;
    padding: 0 2rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(5,7,10,0.7);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 100;
}

.hud-xp-track {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--glass-1);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--glass-border);
}

.hud-level-badge {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.8rem;
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #000;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    white-space: nowrap;
}

.hud-xp-bar-wrap {
    width: 100px;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
}

.hud-xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold));
    border-radius: 3px;
    box-shadow: 0 0 8px var(--gold-glow);
    transition: width 0.8s var(--ease-elastic);
}

.hud-xp-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gold-light);
    white-space: nowrap;
}

.hud-user-pill {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--glass-1);
    padding: 0.45rem 0.9rem 0.45rem 0.5rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all var(--ease-fast);
}
.hud-user-pill:hover {
    border-color: var(--glass-border-hover);
    box-shadow: 0 0 16px var(--gold-glow);
}

.hud-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    display: flex; align-items: center; justify-content: center;
    color: #000; font-weight: 800; font-size: 0.9rem;
    box-shadow: 0 0 12px var(--gold-glow);
    flex-shrink: 0;
}

.hud-user-info { line-height: 1.2; }
.hud-user-name { font-weight: 700; font-size: 0.88rem; }
.hud-user-title {
    font-size: 0.68rem;
    color: var(--gold);
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

/* ─── Page Canvas ─── */
.content-canvas {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem 2.5rem 4rem;
    scroll-behavior: smooth;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(212,175,55,0.3); }

/* ─── Cards ─── */
.glass-card {
    background: var(--glass-2);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    transition: transform var(--ease-spring), box-shadow var(--ease-fast), border-color var(--ease-fast);
}

/* Specular highlight at top edge */
.glass-card::before {
    content: '';
    position: absolute;
    top: 0; left: 12%; right: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
    pointer-events: none;
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 24px rgba(212,175,55,0.08);
    border-color: rgba(212,175,55,0.2);
}

.glass-card.gold-accent { border-left: 3px solid var(--gold); }
.glass-card.cyan-accent { border-left: 3px solid var(--cyan); }
.glass-card.no-hover:hover { transform: none; box-shadow: 0 8px 32px rgba(0,0,0,0.4); }

/* ─── Gamification XP Bar ─── */
.xp-bar-container { margin-top: 1rem; }

.xp-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}
.xp-bar-labels .current { color: var(--text); font-weight: 600; }

.xp-track {
    height: 10px;
    background: rgba(0,0,0,0.6);
    border-radius: 5px;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.8);
    overflow: hidden;
    position: relative;
}

.xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light));
    border-radius: 5px;
    box-shadow: 0 0 14px var(--gold-glow);
    transition: width 0.85s var(--ease-elastic);
    position: relative;
}

.xp-fill::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.35) 50%, transparent 100%);
    animation: shimmer 2.5s infinite;
}

@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ─── Badges ─── */
.badge-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid;
}
.badge-chip.gold   { color: var(--gold); border-color: rgba(212,175,55,0.3); background: rgba(212,175,55,0.08); }
.badge-chip.cyan   { color: var(--cyan); border-color: rgba(0,229,255,0.3);  background: rgba(0,229,255,0.08); }
.badge-chip.green  { color: var(--approve); border-color: rgba(34,197,94,0.3); background: rgba(34,197,94,0.08); }
.badge-chip.red    { color: var(--reject);  border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.08); }
.badge-chip.warning{ color: var(--warning); border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.08); }

/* ─── Jurisdiction Tag ─── */
.jurisdiction-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--cyan);
    background: rgba(0,229,255,0.07);
    border: 1px solid rgba(0,229,255,0.2);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
}

/* ─── Buttons ─── */
.btn-gold {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-md);
    border: none;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #000;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 18px var(--gold-glow);
    transition: all var(--ease-fast);
    position: relative;
    overflow: hidden;
}
.btn-gold::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.25), transparent);
    opacity: 0;
    transition: opacity var(--ease-fast);
}
.btn-gold:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 28px var(--gold-glow); }
.btn-gold:hover::after { opacity: 1; }
.btn-gold:active { transform: scale(0.96); }

.btn-ghost {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 0.92rem;
    padding: 0.72rem 1.6rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: all var(--ease-fast);
    backdrop-filter: blur(4px);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); background: rgba(212,175,55,0.06); }
.btn-ghost:active { transform: scale(0.96); }

/* Compact XS Buttons */
.btn-xs {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
}
.btn-xs i {
    font-size: 0.85rem !important;
}

.btn-approve {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 0.92rem;
    padding: 0.8rem 1.5rem; border-radius: var(--radius-md);
    border: 2px solid var(--approve); background: rgba(34,197,94,0.08);
    color: var(--approve); cursor: pointer;
    box-shadow: 0 0 0 0 var(--approve-glow);
    transition: all var(--ease-fast);
}
.btn-approve:hover { background: rgba(34,197,94,0.18); box-shadow: 0 0 20px var(--approve-glow); transform: translateY(-2px); }
.btn-approve:active { transform: scale(0.95); }

.btn-reject {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 0.92rem;
    padding: 0.8rem 1.5rem; border-radius: var(--radius-md);
    border: 2px solid var(--reject); background: rgba(239,68,68,0.08);
    color: var(--reject); cursor: pointer;
    box-shadow: 0 0 0 0 var(--reject-glow);
    transition: all var(--ease-fast);
}
.btn-reject:hover { background: rgba(239,68,68,0.18); box-shadow: 0 0 20px var(--reject-glow); transform: translateY(-2px); }
.btn-reject:active { transform: scale(0.95); }

/* ─── Trust Coefficient Display ─── */
.trust-display {
    font-family: 'Outfit', sans-serif; font-weight: 800;
    font-size: 3.5rem; line-height: 1;
    background: linear-gradient(180deg, #fff 10%, var(--gold) 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px var(--gold-glow));
}
.trust-display .suffix { font-size: 1.5rem; -webkit-text-fill-color: var(--text-muted); }

/* ─── Vote Meter / Progress Bar ─── */
.vote-meter { height: 10px; border-radius: 5px; overflow: hidden; display: flex; background: rgba(255,255,255,0.05); }
.vote-meter .bar-approve { background: linear-gradient(90deg, #16a34a, var(--approve)); border-radius: 5px 0 0 5px; transition: width 0.6s var(--ease-spring); }
.vote-meter .bar-reject  { background: linear-gradient(90deg, var(--reject), #991b1b); border-radius: 0 5px 5px 0; transition: width 0.6s var(--ease-spring); }

/* ─── Ranking Table ─── */
.rank-table { width: 100%; border-collapse: separate; border-spacing: 0 0.5rem; }
.rank-table th { color: var(--text-muted); font-size: 0.72rem; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; padding: 0 1rem; border-bottom: 1px solid var(--glass-border); padding-bottom: 0.6rem; }
.rank-row { background: var(--glass-1); border-radius: var(--radius-sm); transition: background var(--ease-fast); }
.rank-row:hover { background: rgba(30,35,45,0.8); }
.rank-row td {
    padding: 0.9rem 1rem;
    font-size: 0.88rem;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}
.rank-row td:first-child { border-left: 1px solid var(--glass-border); border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.rank-row td:last-child  { border-right: 1px solid var(--glass-border); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.rank-position {
    font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.2rem;
    width: 48px; text-align: center;
}
.rank-position.top-1 { color: var(--gold); }
.rank-position.top-2 { color: #c0c0c0; }
.rank-position.top-3 { color: #cd7f32; }
.rank-position.me    { color: var(--cyan); }

/* ─── Warning Chip ─── */
.warning-chip {
    display: inline-flex; align-items: center; gap: 0.3rem;
    background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3);
    color: var(--reject); font-size: 0.72rem; font-weight: 700;
    padding: 0.2rem 0.6rem; border-radius: var(--radius-pill);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
    50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}

/* ─── Tabs ─── */
.tab-bar {
    display: flex; gap: 0.3rem;
    background: var(--glass-1);
    padding: 0.3rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}
.tab-bar::-webkit-scrollbar { display: none; } /* Safari/Chrome */
.tab-item {
    padding: 0.5rem 1.2rem; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 0.88rem; cursor: pointer;
    border: none; background: transparent; color: var(--text-muted);
    transition: all var(--ease-fast);
}
.tab-item.active { background: var(--glass-2); color: var(--gold); box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.tab-item:hover:not(.active) { color: var(--text); }

/* ─── Countdown Timer ─── */
.countdown {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-family: 'Outfit', sans-serif; font-weight: 700;
    font-size: 0.82rem; color: var(--reject);
    background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25);
    padding: 0.25rem 0.65rem; border-radius: var(--radius-pill);
    animation: pulse-red 2s infinite;
}

/* ─── Form Inputs ─── */
.form-field {
    margin-bottom: 1.2rem;
}
.form-field label {
    display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-muted);
    letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 0.4rem;
}
.form-input {
    width: 100%; padding: 0.75rem 1rem;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text); font-family: 'Inter', sans-serif; font-size: 0.92rem;
    outline: none;
    transition: border-color var(--ease-fast), box-shadow var(--ease-fast);
}
.form-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212,175,55,0.12);
}
.form-input::placeholder { color: var(--text-dim); }

select.form-input option { background: #1a1d24; }

textarea.form-input { resize: vertical; min-height: 100px; }

/* ─── XP Pop Feedback ─── */
.xp-pop {
    position: fixed; pointer-events: none; z-index: 9999;
    font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.4rem;
    color: var(--gold); text-shadow: 0 0 16px var(--gold-glow);
    animation: xp-float 1.2s ease-out forwards;
}
@keyframes xp-float {
    0%   { opacity: 1; transform: translateY(0) scale(1); }
    80%  { opacity: 1; transform: translateY(-60px) scale(1.1); }
    100% { opacity: 0; transform: translateY(-80px) scale(0.9); }
}

/* ─── Animations ─── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) both; }
.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.26s; }
.delay-4 { animation-delay: 0.38s; }

/* ─── Utility Classes ─── */
.text-gold   { color: var(--gold) !important; }
.text-cyan   { color: var(--cyan) !important; }
.text-muted  { color: var(--text-muted) !important; }
.text-approve{ color: var(--approve) !important; }
.text-reject { color: var(--reject) !important; }

.bg-glass { background: var(--glass-1); border: 1px solid var(--glass-border); border-radius: var(--radius-md); }

/* ─── Blazor Error UI ─── */
#blazor-error-ui {
    bottom: 0; left: 0; width: 100%;
    background: rgba(239,68,68,0.9); color: #fff;
    padding: 0.8rem 1.5rem; text-align: center;
    font-weight: 600; position: fixed; z-index: 9999;
    display: none;
    backdrop-filter: blur(8px);
}
#blazor-error-ui .dismiss { position: absolute; right: 1rem; top: 0.8rem; cursor: pointer; }

/* ─── Auth Flow ─── */
.auth-body {
    background: #05070a;
    min-height: 100vh;
    overflow-y: auto;
}

.auth-bg {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Start from top to allow scrolling */
    padding: 4rem 1.5rem;
    position: relative;
    background: 
        radial-gradient(circle at 20% 30%, rgba(212,175,55,0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0,229,255,0.05) 0%, transparent 50%),
        #05070a;
}

.auth-particles {
    position: absolute; inset: 0;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 2px; height: 2px;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0.3;
    animation: float-particle 10s infinite linear;
}

.particle:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { top: 60%; left: 80%; animation-delay: 2s; }
.particle:nth-child(3) { top: 80%; left: 20%; animation-delay: 4s; }
.particle:nth-child(4) { top: 10%; left: 70%; animation-delay: 1s; }
.particle:nth-child(5) { top: 40%; left: 40%; animation-delay: 3s; }
.particle:nth-child(6) { top: 90%; left: 90%; animation-delay: 5s; }

@keyframes float-particle {
    0%   { transform: translate(0, 0) scale(1); opacity: 0; }
    20%  { opacity: 0.4; }
    80%  { opacity: 0.4; }
    100% { transform: translate(40px, -100px) scale(0); opacity: 0; }
}

.auth-container {
    width: 100%;
    max-width: 460px;
    position: relative;
    z-index: 10;
}

.auth-card {
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}

.brand-icon-auth {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 0 12px var(--gold-glow));
}

.brand-text-auth {
    font-size: 2.4rem;
    margin-bottom: 0.2rem;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-sub-auth {
    color: var(--text-muted);
    font-size: 0.95rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 500;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--reject);
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-logout {
    margin-top: auto;
    padding: 1rem 0.8rem;
    border-top: 1px solid var(--glass-border);
}

.hud-avatar-active {
    border: 2px solid var(--gold);
    box-shadow: 0 0 15px var(--gold-glow);
}

/* ─── UI Utilities ─── */
.bg-glass-heavy {
    background: rgba(10, 12, 16, 0.95);
    backdrop-filter: blur(25px);
}
.cursor-pointer { cursor: pointer; }
.hover-gold:hover {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold);
}

/* ─── Auth Layout ─── */
.auth-layout-root {
    width: 100%;
    min-height: 100vh;
}

.auth-bg {
    min-height: 100vh;
    width: 100%;
    background: radial-gradient(circle at top right, #0f172a, var(--bg));
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 1.25rem;
    position: relative;
    overflow-y: auto;
}

.auth-particles {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 20s infinite linear;
}

@keyframes float {
    from { transform: translateY(0) translateX(0); }
    to { transform: translateY(-100vh) translateX(50px); }
}@keyframes float {
    from { transform: translateY(0) translateX(0); }
    to { transform: translateY(-100vh) translateX(50px); }
}

/* --- Premium Landing / Welcome Page --- */
.landing-experience {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}
.landing-hero {
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1rem;
}
.hero-title {
    font-size: 5rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 2rem;
    text-transform: uppercase;
    background: linear-gradient(135deg, #fff 0%, var(--gold) 50%, var(--gold-dark) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 30px rgba(212,175,55,0.4));
}
.hero-subtitle {
    font-size: 1.4rem;
    color: var(--text-muted);
    max-width: 800px;
    margin-bottom: 3rem;
    line-height: 1.6;
}
.philosophical-badge {
    background: rgba(212,175,55,0.1);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 2.5rem;
    display: inline-block;
}
.landing-section { padding: 8rem 2rem; position: relative; }
.section-label { text-transform: uppercase; letter-spacing: 4px; color: var(--gold); font-weight: 800; font-size: 0.9rem; margin-bottom: 1.5rem; display: block; opacity: 0.7; }
.modern-card {
    background: rgba(13, 17, 23, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 3rem;
    transition: all 0.4s var(--ease-elastic);
    height: 100%;
    backdrop-filter: blur(12px);
}
.modern-card:hover { 
    background: rgba(255, 255, 255, 0.05); 
    border-color: var(--gold); 
    transform: translateY(-12px);
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}
.contract-highlight {
    background: linear-gradient(135deg, rgba(212,175,55,0.12), rgba(0,0,0,0.6));
    border: 2px solid var(--gold);
    border-radius: var(--radius-lg);
    padding: 5rem 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
@media (max-width: 992px) { .hero-title { font-size: 3.5rem; } }
@media (max-width: 768px) { .hero-title { font-size: 2.8rem; } .hero-subtitle { font-size: 1.1rem; } }

/* Scroll Navigation & Anchor Effects */
html { scroll-behavior: smooth; }

.nav-anchor {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s var(--ease-spring);
    text-decoration: none;
    padding-bottom: 4px;
    border-bottom: 1px solid transparent;
}
.nav-anchor i { font-size: 1.1rem; color: var(--gold); }
.nav-anchor:hover {
    color: #fff;
    transform: translateY(-2px);
    border-bottom-color: var(--gold);
}

.animate-bounce {
    animation: bounce 2s infinite;
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-10px);}
    60% {transform: translateY(-5px);}
}


/* --- Responsive & Mobile Refinements --- */
.mobile-toggle {
    display: none;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    color: var(--gold);
    font-size: 1.8rem;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    z-index: 1001;
    touch-action: manipulation;
    transition: all 0.2s;
}
.mobile-toggle:active {
    scale: 0.9;
    background: rgba(212, 175, 55, 0.2);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 199;
}

@media (max-width: 992px) {
    .mobile-toggle { display: block; }
    
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        transition: left 0.4s var(--ease-spring);
        z-index: 200;
        box-shadow: 10px 0 50px rgba(0,0,0,0.8);
    }
    
    .sidebar-open .sidebar {
        left: 0;
    }
    
    .sidebar-open .sidebar-overlay {
        display: block;
    }
    
    .top-hud {
        justify-content: space-between;
        padding: 0 1rem;
    }
    
    .hud-xp-track {
        padding: 0.3rem 0.6rem;
        gap: 0.5rem;
    }
    
    .hud-xp-bar-wrap, .hud-xp-label {
        display: none;
    }
    
    .hud-user-pill {
        padding: 0.3rem 0.5rem;
    }
    
    .hud-user-info {
        display: none;
    }
    
    .content-canvas {
        padding: 1rem 1rem 5rem;
    }

    /* Agora & Multi-media fixes */
    .agora-media-carousel { height: 250px; }
    .hero-title { font-size: 2.5rem; }
    .landing-hero { padding: 4rem 1rem; }
}

@media (max-width: 480px) {
    .hud-level-badge { font-size: 0.7rem; padding: 0.1rem 0.4rem; }
    .hero-title { font-size: 2rem; }
    .modern-card { padding: 2rem 1.5rem; }
}


/* --- iOS & iPhone Specific Fixes --- */
@supports (-webkit-touch-callout: none) {
    .content-canvas {
        -webkit-overflow-scrolling: touch;
        padding-bottom: calc(5rem + env(safe-area-inset-bottom));
    }
    .sidebar {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Ensure images don't overflow on small screens */
img {
    max-width: 100%;
    height: auto;
}

/* Fix voting grid on mobile */
@media (max-width: 576px) {
    .voting-grid {
        grid-template-columns: 1fr;
    }
    .btn-option {
        padding: 1rem;
        font-size: 0.9rem;
    }
}

/* Fix search bars on mobile */
@media (max-width: 768px) {
    .row.align-items-center.mb-4.g-3 {
        flex-direction: column;
    }
    .col-md-7, .col-md-5, .col-xl-5, .col-lg-6 {
        width: 100% !important;
    }
}


/* Z-Index Fix for Mobile Toggle and HUD */
.top-hud {
    z-index: 900 !important;
}
.mobile-toggle {
    z-index: 1010 !important;
    cursor: pointer;
    position: relative;
}
.sidebar {
    z-index: 1050 !important;
}
.sidebar-overlay {
    z-index: 1040 !important;
    display: none;
    pointer-events: none;
}
.sidebar-open .sidebar-overlay {
    display: block;
    pointer-events: all;
}


/* Critical Mobile Menu Fixes */
.btn-close-menu {
    background: none;
    border: none;
    font-size: 1.5rem;
    padding: 0.5rem;
    cursor: pointer;
}

@media (max-width: 992px) {
    .sidebar {
        background: rgba(10, 15, 25, 0.98) !important;
        backdrop-filter: none !important;
        display: flex !important;
        flex-direction: column !important;
        opacity: 0;
        pointer-events: none;
        box-shadow: none;
    }
    
    .sidebar-open .sidebar {
        opacity: 1;
        pointer-events: all;
        left: 0;
        box-shadow: 20px 0 50px rgba(0,0,0,0.9);
    }

    .nav-scrollable {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        display: block !important;
        height: auto !important;
        overflow-y: auto !important;
    }

    .nav-logout {
        flex-shrink: 0;
        background: rgba(0,0,0,0.2);
    }
}

/* Z-Index Overrides */
.mobile-toggle { z-index: 1100 !important; }
.sidebar-overlay { z-index: 1150 !important; }
.sidebar { z-index: 1200 !important; }


/* Santiago Siri Video Styling */
.border-gold { border: 1px solid var(--gold) !important; }
.shadow-gold-lg { box-shadow: 0 0 30px rgba(212, 175, 55, 0.2); }

