/* ==========================================================================
   IN3D — Design system "Caldo / Vivace"
   Palette calda (arancio/corallo) + blu profondo, gradienti energici,
   forme arrotondate e micro-animazioni. Overrides su Bootstrap 5.
   ========================================================================== */

:root {
    /* Brand */
    --brand-orange: #f97316;
    --brand-coral:  #fb7185;
    --brand-amber:  #fbbf24;
    --brand-sky:    #0ea5e9;
    --brand-ink:    #0f172a; /* deep blue/navy per testi e navbar */

    /* Gradienti */
    --grad-warm:  linear-gradient(135deg, #f97316 0%, #fb7185 100%);
    --grad-hero:  linear-gradient(120deg, #f97316 0%, #fb7185 45%, #0ea5e9 100%);
    --grad-sky:   linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);

    /* Bootstrap semantic overrides */
    --primary-color:   #f97316;
    --secondary-color: #64748b;
    --success-color:   #10b981;
    --danger-color:    #ef4444;
    --warning-color:   #f59e0b;
    --info-color:      #0ea5e9;

    /* Superfici */
    --bg-body:    #fff7ed;
    --surface:    #ffffff;
    --border-soft:#f1e4d3;

    /* Ombre morbide (tinte calde) */
    --shadow-sm: 0 2px 8px rgba(249, 115, 22, 0.08);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
    --shadow-glow: 0 12px 28px rgba(249, 115, 22, 0.35);

    /* Raggi */
    --radius-sm: 0.75rem;
    --radius-md: 1.25rem;
    --radius-lg: 1.75rem;

    /* Bootstrap variable bridges */
    --bs-primary: #f97316;
    --bs-primary-rgb: 249, 115, 22;
    --bs-link-color: #ea580c;
    --bs-link-hover-color: #c2410c;
    --bs-body-color: #1e293b;
    --bs-border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: #1e293b;
    background-color: var(--bg-body);
    background-image:
        radial-gradient(60rem 60rem at 110% -10%, rgba(251, 113, 133, 0.14), transparent 60%),
        radial-gradient(50rem 50rem at -10% 10%, rgba(14, 165, 233, 0.10), transparent 55%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

h1, h2, h3, h4, h5, h6, .navbar-brand, .display-1, .display-2, .display-3, .display-4 {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--brand-ink);
}

.lead { color: #475569; }

a { text-decoration: none; }

::selection { background: rgba(249, 115, 22, 0.25); }

/* Utility: testo con gradiente */
.text-gradient {
    background: var(--grad-warm);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* --------------------------------------------------------------------------
   Navbar
   -------------------------------------------------------------------------- */
.navbar {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border-soft);
    box-shadow: var(--shadow-sm);
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.navbar .navbar-brand {
    font-size: 1.4rem;
    background: var(--grad-warm);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar .navbar-brand i { -webkit-text-fill-color: initial; color: var(--brand-orange); }

.navbar .nav-link {
    color: #334155 !important;
    font-weight: 500;
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.85rem !important;
    transition: color .2s ease, background-color .2s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--brand-orange) !important;
    background-color: rgba(249, 115, 22, 0.08);
}

.navbar-toggler { border: none; }
.navbar-toggler:focus { box-shadow: none; }

/* Selettore lingua */
.lang-switcher .form-select {
    width: auto;
    border-radius: 999px;
    border: 1.5px solid var(--border-soft);
    font-weight: 600;
    color: #334155;
    padding: 0.3rem 2rem 0.3rem 0.85rem;
    background-color: #fff;
    cursor: pointer;
}
.lang-switcher .form-select:focus {
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 0.2rem rgba(249, 115, 22, 0.18);
}

.dropdown-menu {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 0.5rem;
}
.dropdown-item { border-radius: var(--radius-sm); padding: 0.5rem 0.75rem; }
.dropdown-item:hover { background-color: rgba(249, 115, 22, 0.1); color: var(--brand-orange); }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform .25s ease, box-shadow .25s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.card.bg-light {
    background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%) !important;
}

.card-title { font-weight: 700; }

/* Icone tonde in stile "feature" */
.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    font-size: 2rem;
    color: #fff;
    background: var(--grad-warm);
    box-shadow: var(--shadow-glow);
}
.feature-icon.sky   { background: var(--grad-sky);  box-shadow: 0 12px 28px rgba(14,165,233,.35); }
.feature-icon.amber { background: linear-gradient(135deg,#fbbf24,#f97316); box-shadow: 0 12px 28px rgba(245,158,11,.35); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    border-radius: 999px;
    padding: 0.6rem 1.4rem;
    font-weight: 600;
    letter-spacing: .01em;
    transition: transform .18s ease, box-shadow .2s ease, filter .2s ease;
}
.btn:active { transform: translateY(1px); }

.btn-lg { padding: 0.85rem 1.9rem; font-size: 1.05rem; }

.btn-primary {
    border: none;
    background: var(--grad-warm);
    box-shadow: var(--shadow-glow);
}
.btn-primary:hover,
.btn-primary:focus {
    filter: brightness(1.05);
    box-shadow: 0 16px 34px rgba(249, 115, 22, 0.45);
    transform: translateY(-2px);
}

.btn-success { border: none; background: linear-gradient(135deg,#10b981,#059669); }
.btn-info    { border: none; background: var(--grad-sky); color: #fff; }
.btn-info:hover { color:#fff; }
.btn-warning { border: none; background: linear-gradient(135deg,#fbbf24,#f59e0b); color:#3f2d00; }

.btn-outline-primary {
    border: 2px solid var(--brand-orange);
    color: var(--brand-orange);
    background: transparent;
}
.btn-outline-primary:hover {
    background: var(--grad-warm);
    border-color: transparent;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero-blob {
    font-size: 15rem;
    background: var(--grad-hero);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 20px 40px rgba(249,115,22,.25));
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-18px); }
}

/* Numeri step "how it works" */
.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.15rem;
    color: #fff;
    background: var(--grad-warm);
    box-shadow: var(--shadow-glow);
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid #e7d9c6;
    padding: 0.6rem 0.9rem;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 0.25rem rgba(249, 115, 22, 0.18);
}

/* --------------------------------------------------------------------------
   3D Viewer
   -------------------------------------------------------------------------- */
#viewer-container {
    width: 100%;
    height: 500px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: var(--grad-hero);
    position: relative;
    box-shadow: var(--shadow-md);
}

/* Anteprima modello 3D riutilizzabile */
.model-preview {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: #0f172a;
}
.model-preview__canvas {
    position: relative;
    width: 100%;
    height: 340px;
    background: radial-gradient(120% 120% at 50% 0%, #1e293b 0%, #0b1120 100%);
}
.model-preview__canvas canvas { display: block; width: 100% !important; height: 100% !important; }
.model-preview__spinner,
.model-preview__msg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #cbd5e1;
    padding: 1rem;
}
.model-preview__msg { flex-direction: column; gap: .5rem; }
.model-preview__msg i { font-size: 2rem; color: var(--brand-amber); }
.model-preview__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 1rem;
    background: #0b1120;
    color: #e2e8f0;
    font-size: .85rem;
    font-weight: 600;
}
.model-preview__hint { color: #94a3b8; font-weight: 500; white-space: nowrap; }

/* --------------------------------------------------------------------------
   Badges & status
   -------------------------------------------------------------------------- */
.badge {
    padding: 0.5em 0.85em;
    font-weight: 600;
    border-radius: 999px;
}

.status-pending    { background-color: var(--warning-color); color: #3f2d00; }
.status-processing { background-color: var(--info-color);    color: #04283a; }
.status-quoted     { background-color: var(--success-color); }
.status-accepted   { background-color: var(--success-color); }
.status-rejected   { background-color: var(--danger-color); }
.status-expired    { background-color: var(--secondary-color); }

/* Stati ordine */
.status-confirmed       { background-color: #0ea5e9; color:#04283a; }
.status-payment_pending { background-color: var(--warning-color); color:#3f2d00; }
.status-paid            { background-color: #14b8a6; }
.status-in_production   { background-color: var(--brand-orange); }
.status-quality_check   { background-color: #8b5cf6; }
.status-ready_to_ship   { background-color: #38bdf8; color:#04283a; }
.status-shipped         { background-color: #3b82f6; }
.status-delivered       { background-color: var(--success-color); }
.status-completed       { background-color: #047857; }
.status-cancelled       { background-color: var(--secondary-color); }

/* --------------------------------------------------------------------------
   Stat tiles (dashboard staff)
   -------------------------------------------------------------------------- */
.stat-tile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.4rem;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-sm);
    height: 100%;
}
.stat-tile__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    flex: 0 0 auto;
    border-radius: 50%;
    font-size: 1.4rem;
    color: #fff;
    background: var(--grad-warm);
}
.stat-tile__icon.sky   { background: var(--grad-sky); }
.stat-tile__icon.green { background: linear-gradient(135deg,#10b981,#059669); }
.stat-tile__icon.ink   { background: linear-gradient(135deg,#334155,#0f172a); }
.stat-tile__value { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 1.6rem; font-weight: 800; line-height: 1; color: var(--brand-ink); }
.stat-tile__label { font-size: .82rem; color: #64748b; font-weight: 600; }

/* Icona stato nella FAQ */
.faq-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    flex: 0 0 auto;
    border-radius: 50%;
    font-size: 1.3rem;
    color: #fff;
    background: var(--grad-warm);
}

/* --------------------------------------------------------------------------
   Alerts
   -------------------------------------------------------------------------- */
.alert {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   Timeline
   -------------------------------------------------------------------------- */
.timeline {
    position: relative;
    padding-left: 2rem;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    border-radius: 3px;
    background: var(--grad-warm);
}
.timeline-item {
    position: relative;
    padding-bottom: 2rem;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.55rem;
    top: 0.25rem;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: var(--brand-orange);
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.4);
}

/* --------------------------------------------------------------------------
   File upload
   -------------------------------------------------------------------------- */
.file-upload-area {
    border: 2px dashed #e7c9a3;
    border-radius: var(--radius-md);
    padding: 2.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(255,255,255,0.6);
}
.file-upload-area:hover {
    border-color: var(--brand-orange);
    background-color: rgba(249, 115, 22, 0.06);
}
.file-upload-area.dragover {
    border-color: var(--success-color);
    background-color: rgba(16, 185, 129, 0.1);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
footer.site-footer {
    background: var(--brand-ink) !important;
    color: #cbd5e1;
}
footer.site-footer h5 {
    color: #fff;
    background: var(--grad-warm);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
footer.site-footer .text-muted { color: #94a3b8 !important; }
footer.site-footer .footer-link { color: #e2e8f0; font-weight: 600; }
footer.site-footer .footer-link:hover { color: var(--brand-orange); }

/* --------------------------------------------------------------------------
   Loading spinner
   -------------------------------------------------------------------------- */
.spinner-wrapper {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}

/* --------------------------------------------------------------------------
   Entrance animation
   -------------------------------------------------------------------------- */
.fade-up { animation: fadeUp .6s ease both; }
.fade-up.delay-1 { animation-delay: .1s; }
.fade-up.delay-2 { animation-delay: .2s; }
.fade-up.delay-3 { animation-delay: .3s; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-blob, .fade-up { animation: none; }
    .card:hover { transform: none; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    #viewer-container { height: 300px; }
    .hero-blob { font-size: 9rem; }
    .timeline { padding-left: 1.5rem; }
    .timeline-item::before { left: -2.05rem; }
}
