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

:root {
    --bg-page: #0f172a;
    --bg-shell: #020617;
    --bg-card: #020617;
    --bg-card-soft: rgba(15, 23, 42, 0.9);
    --border-subtle: rgba(148, 163, 184, 0.25);
    --accent: #5865f2;
    --accent-soft: rgba(88, 101, 242, 0.18);
    --accent-strong: #4f46e5;
    --accent-green: #22c55e;
    --text-primary: #e5e7eb;
    --text-muted: #9ca3af;
    --text-soft: #6b7280;
    --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.65);
    --shadow-chip: 0 10px 30px rgba(15, 23, 42, 0.75);
    --radius-card: 16px;
    --radius-pill: 999px;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #1d283a 0, #020617 55%, #020617 100%);
    color: var(--text-primary);
}

/* Topbar */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(18px);
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.8));
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.topbar-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 0 0, rgba(249, 115, 22, 0.18), transparent 55%),
                radial-gradient(circle at 100% 0, rgba(56, 189, 248, 0.16), transparent 50%);
    opacity: 0.9;
    pointer-events: none;
}

.topbar-inner {
    position: relative;
    max-width: 1120px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.logo-mark {
    background: radial-gradient(circle at 30% 0, #fed7aa, #f97316);
    color: #111827;
    padding: 4px 9px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 14px;
    box-shadow: var(--shadow-chip);
}

.logo-text {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.04em;
    color: #fef3c7;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-link {
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
}

.nav-link:hover {
    color: #e5e7eb;
    border-color: rgba(148, 163, 184, 0.4);
    background: rgba(15, 23, 42, 0.7);
}

.nav-logout {
    color: #fca5a5;
}

.nav-logout:hover {
    border-color: rgba(248, 113, 113, 0.7);
    background: rgba(127, 29, 29, 0.5);
}

.nav-user {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.nav-user-avatar {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 0, #a5b4fc, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #0b1120;
}

.nav-user-name {
    font-size: 13px;
    color: #e5e7eb;
}

/* Layout shell */

.page-shell {
    max-width: 1120px;
    margin: 18px auto 40px;
    padding: 0 16px;
}

.page-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.1fr) minmax(260px, 0.9fr);
    gap: 18px;
}

/* Cards */

.card {
    background: radial-gradient(circle at top left, rgba(148, 163, 184, 0.1), transparent 55%),
                linear-gradient(to bottom right, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.98));
    border-radius: var(--radius-card);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
    padding: 14px 16px;
}

.error-card h2 {
    margin-top: 0;
}

/* Feed & posts */

.feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.post-card {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, border-color 0.12s ease-out, background 0.12s ease-out;
}

.post-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
    border-color: rgba(248, 250, 252, 0.12);
    background: radial-gradient(circle at top left, rgba(249, 115, 22, 0.18), rgba(15, 23, 42, 0.98));
}

.post-full {
    padding: 16px 18px;
}

.vote-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 40px;
    padding-top: 2px;
    gap: 4px;
}

.vote-button {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 2px 4px;
    color: var(--text-soft);
    border-radius: 6px;
    transition: background 0.12s ease-out, color 0.12s ease-out, transform 0.08s ease-out;
}

.vote-button:hover {
    background: rgba(148, 163, 184, 0.22);
    color: #fefce8;
    transform: translateY(-1px);
}

.vote-score {
    font-weight: 700;
    font-size: 14px;
    color: #fef3c7;
}

.post-main {
    flex: 1;
    min-width: 0;
}

.post-meta {
    font-size: 12px;
    color: var(--text-soft);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

/* Community pill */

.community-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.5);
    box-shadow: 0 10px 35px rgba(15, 23, 42, 0.9);
    text-decoration: none;
}

.community-pill:hover {
    border-color: rgba(248, 250, 252, 0.5);
    background: rgba(15, 23, 42, 0.95);
}

.pill-name {
    font-weight: 600;
    font-size: 12px;
    color: #e5e7eb;
}

.meta-separator {
    opacity: 0.6;
}

.post-author strong {
    color: #e5e7eb;
}

.post-title {
    font-size: 16px;
    margin: 4px 0 4px;
}

.post-title a {
    color: #f9fafb;
    text-decoration: none;
}

.post-title a:hover {
    text-decoration: underline;
}

.post-title-full {
    font-size: 20px;
    margin-top: 6px;
}

.post-body {
    font-size: 14px;
    margin: 4px 0 8px;
    color: var(--text-muted);
}

.post-body-full {
    font-size: 14px;
    margin-top: 10px;
    color: var(--text-primary);
    line-height: 1.55;
}

/* Immagini post */

.post-image-thumb {
    margin-top: 6px;
    max-width: 140px;
    max-height: 90px;
    border-radius: 10px;
    display: block;
    object-fit: cover;
    border: 1px solid rgba(31, 41, 55, 0.9);
}

.post-image-full {
    margin-top: 10px;
    width: 100%;
    max-height: 480px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid rgba(31, 41, 55, 0.9);
}

/* Post actions */

.post-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.post-actions-full {
    margin-top: 12px;
}

/* Buttons */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(88, 101, 242, 0.6);
    background: linear-gradient(90deg, #5865f2, #4f46e5);
    color: #f9fafb !important;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.85);
    transition: transform 0.08s ease-out, box-shadow 0.12s ease-out, filter 0.12s ease-out;
}

.btn-primary.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-primary.btn-xsmall {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 52px rgba(15, 23, 42, 0.98);
    filter: brightness(1.05);
}

.btn-primary.full-width {
    width: 100%;
    justify-content: center;
}

.follow-button {
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(148, 163, 184, 0.7);
    background-color: rgba(15, 23, 42, 0.9);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.12s ease-out, color 0.12s ease-out, border-color 0.12s ease-out, box-shadow 0.12s ease-out;
}

.follow-button:hover {
    border-color: rgba(248, 250, 252, 0.65);
    color: #e5e7eb;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.9);
}

.follow-button.following {
    background: radial-gradient(circle at 0 0, rgba(34, 197, 94, 0.25), rgba(15, 23, 42, 0.95));
    border-color: rgba(34, 197, 94, 0.8);
    color: #bbf7d0;
}

/* Verified badge */

.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 0, #a7f3d0, #22c55e);
    color: #022c22;
    font-size: 11px;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.6);
}

.verified-badge.large {
    width: 18px;
    height: 18px;
    font-size: 12px;
}

/* Community header */

.community-header {
    margin-bottom: 12px;
    padding: 0;
    overflow: hidden;
}

.community-banner-wrapper {
    width: 100%;
    max-height: 180px;
    overflow: hidden;
    border-radius: 14px 14px 0 0;
}

.community-banner {
    width: 100%;
    display: block;
    object-fit: cover;
}

.community-header-main {
    display: flex;
    padding: 12px 14px 14px;
}

.community-avatar {
    width: 64px;
    height: 64px;
    border-radius: 22px;
    background: conic-gradient(from 220deg, #f97316, #22c55e, #38bdf8, #f97316);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0b1120;
    font-weight: 800;
    font-size: 22px;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.95);
    overflow: hidden;
}

.community-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.community-info {
    flex: 1;
    margin-left: 12px;
}

.community-title {
    font-size: 18px;
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #f9fafb;
}

.community-description {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--text-muted);
}

.community-description.muted {
    font-style: italic;
}

.community-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Sidebar */

.page-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-card {
    padding: 14px 16px;
}

.sidebar-card.subtle {
    background: linear-gradient(to bottom right, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.98));
}

.sidebar-title {
    margin: 0 0 6px;
    font-size: 16px;
}

.sidebar-subtitle {
    margin: 0 0 6px;
    font-size: 14px;
    color: #f9fafb;
}

.sidebar-text {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.sidebar-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.sidebar-list li {
    margin-bottom: 6px;
}

/* Empty state */

.empty-state {
    text-align: left;
}

.empty-state h2 {
    margin-top: 0;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-muted);
}

/* Form & auth */

.form-page {
    margin-bottom: 16px;
}

.form-title {
    margin: 0 0 10px;
    font-size: 18px;
}

.form-card-inner {
    margin-top: 4px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
    color: var(--text-soft);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 7px 9px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(15, 23, 42, 0.95);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.12s ease-out, box-shadow 0.12s ease-out, background 0.12s ease-out;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(148, 163, 184, 0.7);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: rgba(88, 101, 242, 0.9);
    box-shadow: 0 0 0 1px rgba(88, 101, 242, 0.6);
    background: rgba(15, 23, 42, 0.98);
}

/* Alerts */

.alert {
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    font-size: 13px;
}

.alert-error {
    background-color: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.6);
    color: #fecaca;
}

/* Auth */

.auth-card {
    max-width: 420px;
}

.auth-switch {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-soft);
}

.auth-switch a {
    color: #f97316;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Profilo utente */

.profile-card {
    padding: 0;
    overflow: hidden;
}

.profile-banner {
    height: 96px;
    background: #22c55e;
}

.profile-main {
    display: flex;
    padding: 16px;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 0, #bfdbfe, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: #0b1120;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.95);
    margin-top: -40px;
    margin-right: 14px;
}

.profile-info {
    flex: 1;
}

.profile-name {
    margin: 4px 0 2px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-badge-admin {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.6);
    color: #bfdbfe;
}

.profile-subtitle {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--text-soft);
}

/* Tabs */

.profile-tabs {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
}

.profile-tab {
    font-size: 13px;
    padding: 6px 0;
    text-decoration: none;
    color: var(--text-soft);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.profile-tab.active {
    color: #22c55e;
    border-color: #22c55e;
}

/* Profile section */

.profile-section {
    margin-top: 10px;
}

.profile-section-box {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #020617;
    border: 1px solid rgba(31, 41, 55, 0.9);
}

.profile-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-bottom: 8px;
}

.profile-row:last-child {
    margin-bottom: 0;
}

.profile-label-block {
    display: flex;
    flex-direction: column;
}

.profile-label {
    color: var(--text-soft);
    font-size: 12px;
}

.profile-value {
    color: var(--text-primary);
}

.profile-btn-ghost {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(75, 85, 99, 0.9);
    background: rgba(17, 24, 39, 0.9);
    color: #e5e7eb;
    font-size: 12px;
    cursor: pointer;
}

.profile-btn-ghost.disabled {
    opacity: 0.6;
    cursor: default;
}

/* Stato account */

.status-title {
    margin: 2px 0 4px;
    font-size: 15px;
}

.status-ok {
    color: #22c55e;
    font-weight: 600;
}

.status-warning {
    color: #facc15;
    font-weight: 600;
}

.status-description {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--text-muted);
}

.status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding: 10px 8px 4px;
    border-radius: 12px;
    background: #020617;
    border: 1px solid rgba(31, 41, 55, 0.9);
}

.status-step {
    flex: 1;
    text-align: center;
    font-size: 11px;
    color: var(--text-soft);
}

.status-step-label {
    margin-top: 4px;
}

.status-dot {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    margin: 0 auto;
    border: 2px solid rgba(75, 85, 99, 0.9);
    background: #020617;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #bbf7d0;
}

.status-dot.active {
    border-color: #22c55e;
    background: radial-gradient(circle at 30% 0, #bbf7d0, #22c55e);
}

/* Admin panel */

.admin-card {
    margin-bottom: 16px;
}

.admin-title {
    margin: 0 0 4px;
    font-size: 18px;
}

.admin-subtitle {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--text-soft);
}

.admin-section {
    margin-top: 12px;
}

.admin-section-title {
    margin: 0 0 6px;
    font-size: 15px;
}

.admin-muted {
    font-size: 13px;
    color: var(--text-soft);
}

.admin-table-wrapper {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-table th,
.admin-table td {
    padding: 6px 8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.admin-table th {
    text-align: left;
    color: var(--text-soft);
    font-weight: 500;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 11px;
}

.admin-badge-verified {
    background: rgba(22, 163, 74, 0.18);
    border: 1px solid rgba(22, 163, 74, 0.8);
    color: #bbf7d0;
}

.admin-badge-unverified {
    background: rgba(148, 163, 184, 0.18);
    border: 1px solid rgba(148, 163, 184, 0.7);
    color: #e5e7eb;
}

.admin-inline-form {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.admin-select {
    padding: 4px 6px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-primary);
    font-size: 12px;
}

/* Footer */

.site-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    background: radial-gradient(circle at bottom, rgba(15, 23, 42, 0.96), #020617 70%);
    margin-top: 8px;
}

.footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 12px 16px 18px;
    font-size: 12px;
    color: var(--text-soft);
    display: flex;
    justify-content: space-between;
}

.footer-muted {
    opacity: 0.8;
}

/* Responsive */

@media (max-width: 880px) {
    .page-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .page-sidebar {
        order: -1;
    }
}

@media (max-width: 640px) {
    .topbar-inner {
        padding-inline: 12px;
    }

    .page-shell {
        padding-inline: 12px;
    }

    .post-card {
        padding: 10px 12px;
    }

    .logo-text {
        font-size: 18px;
    }

    .topbar-nav {
        gap: 6px;
    }

    .btn-primary {
        padding-inline: 10px;
    }

    .profile-main {
        flex-direction: column;
    }

    .profile-avatar {
        margin-bottom: 10px;
    }

    .status-bar {
        flex-direction: column;
        gap: 6px;
    }

    .status-step {
        display: flex;
        align-items: center;
        gap: 6px;
        justify-content: flex-start;
    }

    .status-step-label {
        text-align: left;
    }
}


/* =========================================================
   Migliorie responsive extra per mobile / piccoli schermi
   ========================================================= */

@media (max-width: 768px) {
    /* Topbar: logo sopra, menu sotto su due righe se serve */
    .topbar-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .topbar-nav {
        flex-wrap: wrap;
        justify-content: flex-start;
        row-gap: 4px;
    }

    .page-shell {
        margin-top: 14px;
    }
}

@media (max-width: 600px) {
    /* Evitiamo overflow orizzontale */
    body {
        overflow-x: hidden;
    }

    .page-shell {
        padding-inline: 10px;
    }

    .topbar-nav {
        width: 100%;
    }

    .nav-link,
    .btn-small,
    .btn-primary.btn-small {
        font-size: 13px;
        padding: 5px 9px;
    }

    .logo-text {
        font-size: 17px;
    }

    /* Post: layout a colonna */
    .post-card {
        flex-direction: column;
    }

    .vote-column {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        width: auto;
        padding-top: 0;
        margin-bottom: 6px;
        gap: 6px;
    }

    .vote-score {
        min-width: 34px;
        text-align: center;
        font-size: 13px;
    }

    .post-main {
        width: 100%;
    }

    .post-image-thumb {
        max-height: 260px;
    }

    /* Community header: avatar e info in colonna */
    .community-header-main {
        flex-direction: column;
        gap: 10px;
    }

    .community-avatar {
        margin-bottom: 4px;
    }

    /* Sidebar sotto al feed su mobile stretto */
    .page-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .page-sidebar {
        order: 2;
    }

    .page-main {
        min-width: 0;
    }

    /* Form e card più respirati */
    .card {
        padding: 12px 12px;
    }

    .form-page.card {
        padding: 14px 14px;
    }
}

@media (max-width: 420px) {
    .topbar-inner {
        padding-inline: 10px;
    }

    .logo-icon {
        font-size: 16px;
    }

    .logo-text {
        font-size: 16px;
    }

    .topbar-nav {
        gap: 6px;
    }

    .nav-user-name {
        display: none;
    }

    .community-title {
        font-size: 16px;
    }

    .post-title a {
        font-size: 16px;
    }

    .post-meta {
        font-size: 11px;
    }
}


/* === Barra stato account: step connessi e colori per stato === */

.status-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: flex-start;
    margin-top: 8px;
    padding: 10px 8px 6px;
    border-radius: 14px;
    background: #020617;
    border: 1px solid rgba(31, 55, 99, 0.9);
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.status-step {
    position: relative;
    flex: 0 0 90px;
    text-align: center;
    font-size: 11px;
    color: var(--text-soft);
    padding: 0 4px;
}

.status-step-label {
    margin-top: 4px;
    white-space: nowrap;
}

.status-step::before {
    content: "";
    position: absolute;
    top: 9px; /* allineato al centro del dot (18px / 2) */
    left: -50%;
    width: 100%;
    height: 2px;
    background: rgba(55, 65, 81, 0.85);
    z-index: 0;
}

.status-step:first-child::before {
    display: none;
}

.status-dot {
    position: relative;
    z-index: 1;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    margin: 0 auto;
    border: 2px solid rgba(75, 85, 99, 0.9);
    background: #020617;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #0f172a;
}

/* Base attivo: verrà colorato per stato tramite classe del contenitore */
.status-dot.active {
    border-color: #22c55e;
    background: radial-gradient(circle at 30% 0, #bbf7d0, #22c55e);
    color: #022c22;
}

.status-step.active::before {
    background: #22c55e;
}

/* Colori per stato complessivo dell'account */
.status-bar.status-ok .status-dot.active,
.status-bar.status-ok .status-step.active::before {
    border-color: #22c55e;
    background: radial-gradient(circle at 30% 0, #bbf7d0, #22c55e);
}

.status-bar.status-limited .status-dot.active,
.status-bar.status-limited .status-step.active::before {
    border-color: #eab308;
    background: radial-gradient(circle at 30% 0, #fef9c3, #eab308);
}

.status-bar.status-very-limited .status-dot.active,
.status-bar.status-very-limited .status-step.active::before {
    border-color: #f59e0b;
    background: radial-gradient(circle at 30% 0, #ffedd5, #f59e0b);
}

.status-bar.status-risk .status-dot.active,
.status-bar.status-risk .status-step.active::before {
    border-color: #f97316;
    background: radial-gradient(circle at 30% 0, #ffedd5, #f97316);
}

.status-bar.status-suspended .status-dot.active,
.status-bar.status-suspended .status-step.active::before {
    border-color: #ef4444;
    background: radial-gradient(circle at 30% 0, #fee2e2, #ef4444);
}

/* Mobile estremamente stretto: riduciamo un po' */
@media (max-width: 420px) {
    .status-bar {
        padding-inline: 6px;
    }
    .status-step {
        min-width: 64px;
    }
    .status-step-label {
        font-size: 10px;
    }
}


/* === Override layout barra stato per mobile: sempre in orizzontale === */
@media (max-width: 640px) {
    .status-bar {
        flex-direction: row;
    }
    .status-step {
        display: block;
        text-align: center;
        align-items: center;
        justify-content: flex-start;
    }
    .status-step-label {
        text-align: center;
    }
}

