:root {
    /* Layout Colors */
    --bg-primary: #0a0f1e;
    --bg-secondary: #111827;
    --bg-card: #1a2235;
    --bg-card-hover: #1f2a40;

    /* Semantic Accent Colors (Rinominati) */
    --accent-primary: #3b82f6;
    --accent-primary-light: #60a5fa;
    --accent-secondary: #10b981;
    --accent-secondary-light: #34d399;
    --accent-tertiary: #f59e0b;

    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Borders & Radius */
    --border-color: rgba(255,255,255,0.08);
    --border-light: rgba(255,255,255,0.05);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* ===== SOVRASCRITTURA BOOTSTRAP 5 ===== */
    --bs-primary: var(--accent-primary);
    --bs-primary-rgb: 59, 130, 246; /* Opzionale, utile per alcune opacity BS5 */
    --bs-link-color: var(--accent-primary);
    --bs-link-hover-color: var(--accent-primary-light);
}

#uniwix-chat-interface {
    --chat-radius-lg: 12px;
    --chat-border-color: #2d3748;
    --chat-accent-primary: #3b82f6;
    --chat-text-muted: #a0aec0;
    --chat-bg-secondary: #1a202c;
    --chat-bg-card: #2d3748;
    --chat-text-primary: #e2e8f0;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== BACKGROUND AMBIENT ===== */
.bg-ambient {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-ambient .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
}

.bg-ambient .orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59,130,246,0.3), transparent 70%);
    top: -200px;
    right: -100px;
    animation: float-orb 20s ease-in-out infinite;
}

.bg-ambient .orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(16,185,129,0.2), transparent 70%);
    bottom: -150px;
    left: -100px;
    animation: float-orb 25s ease-in-out infinite reverse;
}

.bg-ambient .orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(245,158,11,0.15), transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float-orb 18s ease-in-out infinite 3s;
}

@keyframes float-orb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -40px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ===== GRID PATTERN ===== */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 30%, transparent 100%);
}

/* ===== NAVBAR ===== */
.navbar-custom {
    position: sticky;
    top: 0;
    z-index: 1050;
    background: rgba(10,15,30,0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    transition: all 0.3s ease;
}

.navbar-custom.scrolled {
    background: rgba(10,15,30,0.95);
    box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
}

.navbar-brand-custom {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: opacity 0.2s ease;
}

.navbar-brand-custom:hover {
    opacity: 0.9;
    color: var(--text-primary);
}

.logo-img {
    width: 120px;
    height: 44px;
    object-fit: contain;
    border-radius: 8px;
    background-color: #fff;
    padding: 4px;
    flex-shrink: 0;
}

.logo-mark {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-emerald));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    font-weight: 800;
    box-shadow: 0 4px 15px rgba(59,130,246,0.3);
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.logo-text span {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 14px;
    display: block;
    letter-spacing: 0;
    margin-top: -2px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--accent-blue);
    border-radius: 2px;
}

.nav-links a i {
    font-size: 16px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-cart {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-cart:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.15);
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--accent-blue);
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 8px rgba(59,130,246,0.4);
}

.cart-badge[data-count="0"] {
    display: none;
}

.navbar-toggler-custom {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 22px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.navbar-toggler-custom:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
}

/* Mobile nav */
.mobile-nav {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10,15,30,0.98);
    backdrop-filter: blur(20px);
    z-index: 1040;
    padding: 24px;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.mobile-nav.show {
    display: flex;
}

.mobile-nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mobile-nav a:hover,
.mobile-nav a.active {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
}

.mobile-nav a i {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

/* ===== HERO ===== */
.hero-section {
    position: relative;
    z-index: 1;
    padding: 80px 0 50px;
    text-align: center;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-blue) 0%, transparent 70%);
    opacity: 0.06;
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px 8px 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent-blue-light);
    margin-bottom: 28px;
    backdrop-filter: blur(8px);
}

.hero-badge i {
    font-size: 16px;
}

.hero-title {
    font-weight: 900;
    margin-bottom: 20px;
    position: relative;
}

.hero-title .highlight {
    background: linear-gradient(135deg, var(--accent-blue-light), var(--accent-emerald-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: clamp(15px, 2vw, 18px);
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
    font-weight: 400;
}

.session-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: var(--radius-md);
    color: var(--accent-emerald-light);
    font-size: 14px;
    font-weight: 600;
    margin-top: 28px;
    backdrop-filter: blur(8px);
}

.session-badge i {
    font-size: 18px;
}

/* ===== MAIN CONTENT NO HERO ===== */
.site-content--no-hero {
    padding-top: 40px;
}

.content-wrapper {
    max-width: 1320px;
    margin: -20px auto 0;
    padding: 0 24px;
}

.page-content {
    min-height: 40vh;
}

/* ===== SPINNER ===== */
.spinner-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(10,15,30,0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 24px;
}

.spinner-overlay.active {
    display: flex;
}

.spinner-ring {
    width: 64px;
    height: 64px;
    border: 3px solid rgba(59,130,246,0.15);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.spinner-text {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    text-align: center;
}

.spinner-text strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    top: 84px;
    right: 24px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-msg {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    animation: toast-in 0.4s cubic-bezier(0.16,1,0.3,1) forwards;
    min-width: 300px;
    max-width: 440px;
}

.toast-msg.toast-success {
    background: rgba(16,185,129,0.15);
    border: 1px solid rgba(16,185,129,0.25);
    color: var(--accent-emerald-light);
}

.toast-msg.toast-danger {
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.25);
    color: #fca5a5;
}

.toast-msg.toast-info {
    background: rgba(59,130,246,0.15);
    border: 1px solid rgba(59,130,246,0.25);
    color: var(--accent-blue-light);
}

.toast-msg i {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-msg.removing {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(40px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateX(40px) scale(0.95); }
}

/* ===== FOOTER ===== */
.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border-color);
    padding: 32px 0;
    text-align: center;
}

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

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--accent-blue-light);
}

/* ===== CARD DARK ===== */
.card-dark {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: all 0.3s ease;
}

.card-dark:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255,255,255,0.12);
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}

.card-dark .card-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 20px;
}

.card-dark .card-icon.icon-blue {
    background: rgba(59,130,246,0.1);
    border: 1px solid rgba(59,130,246,0.2);
    color: var(--accent-blue-light);
}

.card-dark .card-icon.icon-emerald {
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.2);
    color: var(--accent-emerald-light);
}

.card-dark .card-icon.icon-amber {
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.2);
    color: var(--accent-amber);
}

.card-dark h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.card-dark p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

/* ===== BTN GLOW ===== */
.btn-glow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-glow-primary {
    background: var(--accent-blue);
    color: white;
    box-shadow: 0 4px 20px rgba(59,130,246,0.3);
}

.btn-glow-primary:hover {
    background: var(--accent-blue-light);
    color: white;
    box-shadow: 0 6px 30px rgba(59,130,246,0.4);
    transform: translateY(-1px);
}

.btn-glow-emerald {
    background: var(--accent-emerald);
    color: white;
    box-shadow: 0 4px 20px rgba(16,185,129,0.3);
}

.btn-glow-emerald:hover {
    background: var(--accent-emerald-light);
    color: white;
    box-shadow: 0 6px 30px rgba(16,185,129,0.4);
    transform: translateY(-1px);
}

.btn-glow-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-glow-outline:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.15);
}

/* ===== STEPPER ===== */
.stepper {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 40px;
}

.stepper-step {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    position: relative;
}

.stepper-step:not(:last-child)::after {
    content: '';
    flex: 1;
    height: 2px;
    background: var(--border-color);
    margin: 0 16px;
}

.stepper-step.completed:not(:last-child)::after {
    background: var(--accent-emerald);
}

.stepper-step.active:not(:last-child)::after {
    background: linear-gradient(90deg, var(--accent-blue), var(--border-color));
}

.stepper-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.stepper-step.active .stepper-dot {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
    box-shadow: 0 0 20px rgba(59,130,246,0.3);
}

.stepper-step.completed .stepper-dot {
    background: var(--accent-emerald);
    border-color: var(--accent-emerald);
    color: white;
}

.stepper-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    transition: color 0.3s ease;
}

.stepper-step.active .stepper-label {
    color: var(--text-primary);
}

.stepper-step.completed .stepper-label {
    color: var(--accent-emerald-light);
}

/* ===== FORM DARK ===== */
.form-control-dark {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
    width: 100%;
}

.form-control-dark:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
    background: var(--bg-secondary);
}

.form-control-dark::placeholder {
    color: var(--text-muted);
}

.form-label-dark {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
    .nav-links {
        display: none;
    }
    .navbar-toggler-custom {
        display: flex;
    }
    .hero-section {
        padding: 40px 0 24px;
    }
    .stepper {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .stepper-step:not(:last-child)::after {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .navbar-inner {
        padding: 0 16px;
        height: 64px;
    }
    .logo-text {
        display: none;
    }
    .content-wrapper {
        padding: 0 16px;
    }
    .hero-section {
        padding: 28px 0 16px;
    }
    .hero-badge {
        font-size: 12px;
        padding: 6px 14px 6px 8px;
    }
    .toast-msg {
        min-width: auto;
        max-width: calc(100vw - 48px);
    }
    .toast-container {
        right: 16px;
        left: 16px;
    }
    .card-dark {
        padding: 24px;
    }
}

/* ===== PAGINAZIONE CUSTOM ===== */
.pagination-custom {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination-custom li a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination-custom li a:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.15);
}

.pagination-custom li a.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
    box-shadow: 0 2px 12px rgba(59,130,246,0.3);
}

.pagination-custom li a.active:hover {
    background: var(--accent-blue-light);
    border-color: var(--accent-blue-light);
    color: white;
}

/* ===== STEP NUM ===== */
.step-num {
    width: 28px;
    height: 28px;
    min-width: 28px;
    background: rgba(59,130,246,0.12);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--accent-blue-light);
}

/* ===== SSL BADGE ===== */
.ssl-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: var(--radius-sm);
    color: var(--accent-emerald-light);
    font-size: 13px;
    font-weight: 500;
}

/* ===== PAYMENT LOGO ===== */
.payment-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.payment-logo img {
    height: 24px;
    width: auto;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.payment-logo img:hover {
    opacity: 1;
}

/* ===== FORM CHECK CUSTOM (DARK) ===== */
.form-check-custom {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
}

.form-check-custom + .form-check-custom {
    border-top: 1px solid var(--border-light);
}

.form-check-input-dark {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    margin-top: 2px;
}

.form-check-input-dark:hover {
    border-color: var(--accent-blue);
}

.form-check-input-dark:checked {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.form-check-input-dark:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form-check-label-dark {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    cursor: pointer;
    transition: color 0.2s ease;
}

.form-check-label-dark:hover {
    color: var(--text-primary);
}

.form-check-label-dark a {
    color: var(--accent-blue-light);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.form-check-label-dark a:hover {
    border-bottom-color: var(--accent-blue-light);
}

/* ===== ACCEPTANCE LIST ===== */
.acceptance-list {
    display: flex;
    flex-direction: column;
}

/* ===== SELECT DARK ARROW ===== */
.form-control-dark {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

select.form-control-dark {
    cursor: pointer;
}

select.form-control-dark option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ===== FORM CONTROL DARK READONLY ===== */
.form-control-dark[readonly] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== LINK LIGHT (per temi chiari) ===== */
.link-light {
    color: var(--accent-blue-light);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.link-light:hover {
    border-bottom-color: var(--accent-blue-light);
}

/* ===== HERO ACCESS FORM ===== */
.hero-access {
    margin-top: 28px;
}

.hero-access-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 16px;
}

.hero-access-form {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 480px;
    margin: 0 auto;
}

.hero-access-form .form-control-dark {
    flex: 1;
}

@media (max-width: 575.98px) {
    .hero-access-form {
        flex-direction: column;
    }
    .hero-access-form .form-control-dark {
        width: 100%;
    }
    .hero-access-form .btn-glow {
        width: 100%;
        justify-content: center;
    }
}

/* ===== HERO ACCESS FORM ===== */
.hero-access {
    margin-top: 28px;
}

.hero-access-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 16px;
}

.hero-access-form {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 480px;
    margin: 0 auto;
}

.hero-access-form .form-control-dark {
    flex: 1;
}

@media (max-width: 575.98px) {
    .hero-access-form {
        flex-direction: column;
    }
    .hero-access-form .form-control-dark {
        width: 100%;
    }
    .hero-access-form .btn-glow {
        width: 100%;
        justify-content: center;
    }
}

.btn-glow-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-glow-danger:hover {
    background: rgba(239, 68, 68, 0.22);
    border-color: rgba(239, 68, 68, 0.45);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

/* Badge delega firmata - Desktop */
.badge-delega-firmata {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0.06));
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #10b981;
    cursor: default;
    user-select: none;
    white-space: nowrap;
}

.badge-delega-firmata i {
    font-size: 15px;
}

/* Badge delega firmata - Mobile */
.badge-delega-firmata-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #10b981;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    cursor: default;
    user-select: none;
}

.badge-delega-firmata-mobile i {
    font-size: 16px;
}

/* Badge delega in attesa - Desktop */
.badge-delega-attesa {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.06));
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #f59e0b;
    cursor: default;
    user-select: none;
    white-space: nowrap;
}

.badge-delega-attesa i {
    font-size: 15px;
}

/* Badge delega in attesa - Mobile */
.badge-delega-attesa-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #f59e0b;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    cursor: default;
    user-select: none;
}

.badge-delega-attesa-mobile i {
    font-size: 16px;
}

/* INVALID STATES */
.form-control-dark.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220,53,69,0.15);
}

.form-control-dark.is-invalid:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220,53,69,0.25);
}

.form-check-input-dark.is-invalid {
    border-color: #dc3545 !important;
    background-color: #f8d7da !important;
}

.form-check-input-dark.is-invalid:checked {
    background-color: #f5c6cb !important;
    border-color: #e03e3e !important;
}

.form-check-label-dark.is-invalid {
    color: #dc3545 !important;
}

.form-check-input-dark.is-invalid:focus {
    border-color: #e03e3e !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* VALID STATES */
.form-control-dark.is-valid {
    border-color: #198754 !important;
    box-shadow: 0 0 0 3px rgba(25,135,84,0.15);
}

.form-control-dark.is-valid:focus {
    border-color: #198754 !important;
    box-shadow: 0 0 0 3px rgba(25,135,84,0.25);
}

.form-check-input-dark.is-valid {
    border-color: #198754 !important;
    background-color: #d1e7dd !important;
}

.form-check-input-dark.is-valid:checked {
    background-color: #c3e6cb !important;
    border-color: #28a745 !important;
}

.form-check-label-dark.is-valid {
    color: #198754 !important;
}

.form-check-input-dark.is-valid:focus {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

/* ERROR TEXT */
.field-badge-error {
    display: none;
    color: #f87171;
    font-size: 12px;
    margin-top: 6px;
}

.form-control-dark.is-invalid + .field-badge-error {
    display: block;
}

.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.3) !important;
}

a.hover-white:hover {
    color: white !important;
}

/* ===== BREADCRUMB CUSTOM ===== */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 14px;
}

.breadcrumb-item a {
    color: var(--accent-blue-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--text-muted);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
    content: "/";
}

/* ===== ACCORDION DARK CUSTOM ===== */
.accordion-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    margin-bottom: 8px;
    border-radius: var(--radius-sm) !important;
    overflow: hidden;
}

.accordion-button {
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 15px;
    padding: 16px 20px;
    box-shadow: none !important;
}

.accordion-button:not(.collapsed) {
    background: var(--bg-card-hover);
    color: var(--accent-blue-light);
}

.accordion-button::after {
    filter: brightness(0) invert(1); /* Freccia bianca di default */
}

/* Freccia scura se il tema è chiaro (es. UnoERP sovrascrive questa) */
:root {
    --accordion-btn-icon-filter: brightness(0) invert(1);
}
.navbar-custom {
    /* Piccolo trick: se il navbar è chiaro, la freccia diventa scura */
}

.accordion-body {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 20px;
    line-height: 1.7;
    border-top: 1px solid var(--border-color);
}

/* ===== RINOMINA QUESTO BLOCCO (da .link-light a .link-accent) ===== */
.link-accent {
    color: var(--accent-blue-light);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.link-accent:hover {
    color: var(--text-primary); /* Cambiato: ora diventa del colore primario, non bianco forzato */
    border-bottom-color: var(--accent-blue-light);
}

/* ===== WILL PAGINATE (Stile Bootstrap 5 nativo via CSS) ===== */
div.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 0;
    margin-top: 2.5rem;
    list-style: none;
}

div.pagination span,
div.pagination em,
div.pagination a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

/* Pagine e Frecce - Link normali */
div.pagination a {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

div.pagination a:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.15);
}

/* Pagina Attiva (em.current) */
div.pagination em.current {
    background: var(--accent-blue);
    border: 1px solid var(--accent-blue);
    color: white !important;
    font-style: normal;
    box-shadow: 0 2px 12px rgba(59,130,246,0.3);
}

/* Frecce Disabilitate */
div.pagination span.previous_page.disabled,
div.pagination span.next_page.disabled {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.5;
}