/* Crypto Control Center - tema sopra Bootstrap 5.3 (scuro e chiaro via data-bs-theme) */

:root {
  --ccc-up: #00c853;
  --ccc-down: #ff1744;
  --ccc-warn: #ff9800;
  --ccc-radius: 14px;
  --bs-primary: #2196f3;
  --bs-primary-rgb: 33, 150, 243;
  --bs-link-color-rgb: 33, 150, 243;
  --bs-link-hover-color-rgb: 66, 165, 245;
  --bs-font-sans-serif: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

[data-bs-theme="dark"] {
  --bs-body-bg: #15171c;
  --bs-body-bg-rgb: 21, 23, 28;
  --bs-body-color: #e6e8ec;
  --bs-secondary-color: #9aa1ad;
  --bs-border-color: #2b2f38;
  --bs-tertiary-bg: #1b1e25;
  --ccc-surface: #1d2027;
  --ccc-surface-2: #242831;
  --ccc-nav: rgba(21, 23, 28, .86);
  --ccc-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  --ccc-glow: radial-gradient(1200px 500px at 85% -10%, rgba(33, 150, 243, .13), transparent 60%),
              radial-gradient(900px 420px at -10% 0%, rgba(0, 200, 83, .07), transparent 55%);
}

[data-bs-theme="light"] {
  --bs-body-bg: #f3f5f9;
  --bs-body-bg-rgb: 243, 245, 249;
  --bs-body-color: #1a1f2b;
  --bs-secondary-color: #667085;
  --bs-border-color: #dfe3ea;
  --bs-tertiary-bg: #eef1f6;
  --ccc-surface: #ffffff;
  --ccc-surface-2: #f6f8fb;
  --ccc-nav: rgba(255, 255, 255, .88);
  --ccc-shadow: 0 6px 20px rgba(23, 33, 60, .08);
  --ccc-up: #0a9d4c;
  --ccc-down: #d81b3f;
  --ccc-glow: radial-gradient(1200px 500px at 85% -10%, rgba(33, 150, 243, .10), transparent 60%),
              radial-gradient(900px 420px at -10% 0%, rgba(0, 200, 83, .06), transparent 55%);
}

body {
  min-height: 100vh;
  background-image: var(--ccc-glow);
  background-repeat: no-repeat;
  background-attachment: fixed;
  font-variant-numeric: tabular-nums;
}

/* Barra di navigazione */
.ccc-navbar {
  background: var(--ccc-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bs-border-color);
}
.ccc-brand { font-weight: 700; letter-spacing: .2px; display: inline-flex; align-items: center; gap: .55rem; }
.ccc-logo {
  display: inline-flex; align-items: flex-end; gap: 3px; height: 22px; padding: 3px 6px;
  border-radius: 8px; background: linear-gradient(135deg, rgba(33, 150, 243, .22), rgba(0, 200, 83, .18));
}
.ccc-logo i { display: block; width: 4px; border-radius: 2px; background: var(--ccc-up); }
.ccc-logo i:nth-child(1) { height: 9px; }
.ccc-logo i:nth-child(2) { height: 15px; background: var(--ccc-down); }
.ccc-logo i:nth-child(3) { height: 12px; }
.navbar .nav-link { border-radius: 8px; padding-inline: .8rem !important; font-weight: 500; }
.navbar .nav-link.active, .navbar .nav-link:hover { background: rgba(var(--bs-primary-rgb), .12); color: var(--bs-primary); }

/* Riquadri */
.card {
  background: var(--ccc-surface);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--ccc-radius);
  box-shadow: var(--ccc-shadow);
}
.card-header {
  background: transparent; border-bottom: 1px solid var(--bs-border-color);
  font-weight: 600; font-size: .8rem; letter-spacing: .6px; text-transform: uppercase; color: var(--bs-secondary-color);
  padding: .7rem 1rem;
}
.card-header i { color: var(--bs-primary); margin-right: .35rem; }

.btn { border-radius: 10px; font-weight: 500; }
.btn-primary { --bs-btn-bg: #2196f3; --bs-btn-border-color: #2196f3; --bs-btn-hover-bg: #1e88e5; --bs-btn-hover-border-color: #1e88e5; --bs-btn-active-bg: #1976d2; --bs-btn-active-border-color: #1976d2; }
.btn-buy { --bs-btn-color: #fff; --bs-btn-bg: #0a9d4c; --bs-btn-border-color: #0a9d4c; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #088541; --bs-btn-hover-border-color: #088541; --bs-btn-active-color: #fff; --bs-btn-active-bg: #077538; --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: #0a9d4c; --bs-btn-disabled-border-color: #0a9d4c; }
.btn-sell { --bs-btn-color: #fff; --bs-btn-bg: #d81b3f; --bs-btn-border-color: #d81b3f; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #bd1736; --bs-btn-hover-border-color: #bd1736; --bs-btn-active-color: #fff; --bs-btn-active-bg: #a8142f; --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: #d81b3f; --bs-btn-disabled-border-color: #d81b3f; }
.form-control, .form-select { border-radius: 10px; background-color: var(--ccc-surface-2); }
.form-control:focus, .form-select:focus { background-color: var(--ccc-surface-2); }
.table { --bs-table-bg: transparent; }
.table > :not(caption) > * > * { padding: .6rem .75rem; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; color: var(--bs-secondary-color); font-weight: 600; }

.text-up { color: var(--ccc-up) !important; }
.text-down { color: var(--ccc-down) !important; }
.text-warn { color: var(--ccc-warn) !important; }
.badge-soft { font-weight: 600; border-radius: 999px; padding: .35em .7em; }
.badge-live { background: rgba(0, 200, 83, .15); color: var(--ccc-up); }
.badge-sim { background: rgba(255, 152, 0, .16); color: var(--ccc-warn); }
.badge-muted { background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); }
.badge-danger { background: rgba(255, 23, 68, .14); color: var(--ccc-down); }

/* Pagina di accesso */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card { width: 100%; max-width: 410px; padding: 2.2rem 2rem; }
.login-card .ccc-logo { height: 34px; padding: 5px 9px; gap: 4px; border-radius: 11px; }
.login-card .ccc-logo i { width: 6px; }
.login-card .ccc-logo i:nth-child(1) { height: 14px; }
.login-card .ccc-logo i:nth-child(2) { height: 24px; }
.login-card .ccc-logo i:nth-child(3) { height: 19px; }

/* Elenco dei bot */
.bot-card { display: block; color: inherit; text-decoration: none; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.bot-card:hover { transform: translateY(-3px); border-color: rgba(var(--bs-primary-rgb), .55); color: inherit; }
.bot-card .symbol { font-size: 1.15rem; font-weight: 700; }
.bot-card .price { font-size: 1.35rem; font-weight: 700; }
.bot-card .meta { font-size: .8rem; color: var(--bs-secondary-color); }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ccc-warn); margin-right: .4rem; box-shadow: 0 0 0 3px rgba(255, 152, 0, .18); }
.status-dot.on { background: var(--ccc-up); box-shadow: 0 0 0 3px rgba(0, 200, 83, .18); animation: pulse 2.2s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(0, 200, 83, .18); } 50% { box-shadow: 0 0 0 7px rgba(0, 200, 83, 0); } }

/* Dettaglio del bot */
.price-hero { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.chart-card { overflow: hidden; }
.chart-box { position: relative; height: 62vh; min-height: 420px; }
#chart { position: absolute; inset: 0; }
#chartLegend { position: absolute; left: 12px; top: 8px; right: 80px; z-index: 5; font-size: .72rem; line-height: 1.5; pointer-events: none; color: var(--bs-secondary-color); }
#chartLegend span { margin-right: 10px; white-space: nowrap; }
#chartEdge { position: absolute; right: 78px; top: 8px; z-index: 5; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; pointer-events: none; font-size: .72rem; font-weight: 600; }
#chartEdge span { padding: 1px 7px; border-radius: 6px; background: var(--ccc-surface-2); border: 1px solid var(--bs-border-color); white-space: nowrap; }
#chartMsg { position: absolute; inset: 0; display: grid; place-items: center; z-index: 6; color: var(--bs-secondary-color); pointer-events: none; text-align: center; padding: 1rem; }
.chart-box.pick #chart { cursor: crosshair; }
/* Linee del bot trascinabili: il cursore cambia sopra la linea e durante lo spostamento */
.chart-box.over-line #chart, .chart-box.over-line #chart *, .chart-box.drag-line #chart, .chart-box.drag-line #chart * { cursor: ns-resize !important; }
.chart-box.drag-line { touch-action: none; user-select: none; }
.tf-group .btn { --bs-btn-padding-x: .7rem; --bs-btn-padding-y: .25rem; --bs-btn-font-size: .8rem; }

.kv { display: flex; justify-content: space-between; gap: 1rem; padding: .32rem 0; border-bottom: 1px dashed var(--bs-border-color); font-size: .9rem; }
.kv:last-child { border-bottom: 0; }
.kv > span:first-child { color: var(--bs-secondary-color); }
.kv > span:last-child { font-weight: 600; text-align: right; word-break: break-word; }

.book { font-size: .8rem; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.book-row { position: relative; display: flex; justify-content: space-between; padding: 1px 8px; }
.book-row .bar { position: absolute; right: 0; top: 1px; bottom: 1px; opacity: .14; border-radius: 3px 0 0 3px; }
.book-row.ask .bar { background: var(--ccc-down); }
.book-row.bid .bar { background: var(--ccc-up); }
.book-row.ask .p { color: var(--ccc-down); }
.book-row.bid .p { color: var(--ccc-up); }
.book-row span { position: relative; }
.book-spread { text-align: center; padding: 4px; color: var(--bs-secondary-color); border-block: 1px solid var(--bs-border-color); margin-block: 3px; }

.readonly-note { border-left: 3px solid var(--ccc-warn); }

/* Avvisi a comparsa */
#toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 1080; display: flex; flex-direction: column; gap: .5rem; max-width: min(420px, calc(100vw - 2rem)); }
.ccc-toast { padding: .7rem 1rem; border-radius: 12px; background: var(--ccc-surface); border: 1px solid var(--bs-border-color); box-shadow: var(--ccc-shadow); border-left: 4px solid var(--ccc-up); animation: toast-in .2s ease; }
.ccc-toast.err { border-left-color: var(--ccc-down); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.advisor-item { border-left: 4px solid transparent; }
.advisor-item.sev-Warning { border-left-color: var(--ccc-warn); }
.advisor-item.sev-Critical { border-left-color: var(--ccc-down); }
.page-title { font-weight: 700; letter-spacing: -.2px; }
footer { color: var(--bs-secondary-color); font-size: .78rem; }
.pre-line { white-space: pre-line; overflow-wrap: anywhere; }

/* Messaggi agli iscritti */
.message-item { border-left: 4px solid transparent; }
.message-item.unread { border-left-color: var(--ccc-up); }
.sent-message { padding: .8rem 0; border-bottom: 1px dashed var(--bs-border-color); }
.sent-message:first-child { padding-top: 0; }
.sent-message:last-child { border-bottom: 0; padding-bottom: 0; }

.or-line { display: flex; align-items: center; gap: .8rem; margin-block: 1rem; color: var(--bs-secondary-color); font-size: .8rem; }
.or-line::before, .or-line::after { content: ""; flex: 1; border-top: 1px solid var(--bs-border-color); }

.report-reply { padding: .5rem .75rem; border-left: 3px solid var(--bs-primary); border-radius: 0 8px 8px 0; background: rgba(var(--bs-primary-rgb), .08); }

/* Registrazione */
.register-card { max-width: 480px; }
.plan-option {
  display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; margin-bottom: .4rem; cursor: pointer;
  border: 1px solid var(--bs-border-color); border-radius: 10px; background: var(--ccc-surface-2);
}
.plan-option:has(input:checked) { border-color: var(--bs-primary); background: rgba(var(--bs-primary-rgb), .10); }
.plan-option .form-check-input { margin: 0; flex-shrink: 0; }

/* Sito pubblico */
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
.site-hero { padding-block: clamp(2.5rem, 7vw, 5.5rem); }
.site-title { font-size: clamp(2rem, 4.6vw, 3.3rem); font-weight: 800; letter-spacing: -.8px; line-height: 1.1; text-wrap: balance; }
.site-lead { font-size: 1.15rem; color: var(--bs-secondary-color); max-width: 34rem; margin-top: 1.1rem; }
.site-preview { max-width: 460px; margin-inline: auto; }
.site-preview .bot-card:hover { transform: none; border-color: var(--bs-border-color); }
.site-spark { display: block; width: 100%; height: 60px; margin-top: .6rem; }
.site-spark polyline { fill: none; stroke: var(--ccc-up); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.site-section { padding-block: clamp(2rem, 5vw, 3.5rem); }
.site-h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -.4px; text-align: center; }
.site-sub { text-align: center; color: var(--bs-secondary-color); max-width: 40rem; margin: .4rem auto 2rem; }
.site-feature, .site-step, .site-plan { padding: 1.5rem; }
.site-feature > i {
  display: inline-grid; place-items: center; width: 44px; height: 44px; margin-bottom: 1rem; font-size: 1.3rem;
  border-radius: 12px; color: var(--bs-primary); background: rgba(var(--bs-primary-rgb), .12);
}
.site-feature h3, .site-step h3 { font-size: 1.05rem; font-weight: 700; }
.site-feature p, .site-step p { color: var(--bs-secondary-color); margin-bottom: 0; }
.site-step-n {
  display: inline-grid; place-items: center; width: 36px; height: 36px; margin-bottom: 1rem; font-weight: 800;
  border-radius: 50%; color: var(--ccc-up); background: rgba(0, 200, 83, .14);
}
.site-plan { position: relative; display: flex; flex-direction: column; }
.site-plan.featured { border-color: var(--bs-primary); box-shadow: 0 0 0 1px var(--bs-primary), var(--ccc-shadow); }
.site-plan-flag { position: absolute; top: 1.1rem; right: 1.1rem; }
.site-plan h3 { font-size: 1.25rem; font-weight: 800; margin-bottom: .15rem; }
.site-price { font-size: 2.4rem; font-weight: 800; letter-spacing: -.8px; margin-block: 1rem .8rem; }
.site-price span { font-size: .95rem; font-weight: 500; letter-spacing: 0; color: var(--bs-secondary-color); margin-left: .25rem; }
.site-plan-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.site-plan-list li { padding: .3rem 0; }
.site-plan-list i { color: var(--ccc-up); margin-right: .35rem; }
.site-faq { max-width: 820px; }
.site-faq .accordion { --bs-accordion-bg: var(--ccc-surface); --bs-accordion-border-color: var(--bs-border-color); --bs-accordion-border-radius: var(--ccc-radius); --bs-accordion-inner-border-radius: var(--ccc-radius); --bs-accordion-active-bg: var(--ccc-surface-2); --bs-accordion-active-color: var(--bs-body-color); --bs-accordion-btn-focus-box-shadow: none; }
.site-faq .accordion-button { font-weight: 600; }
.site-faq .accordion-body { color: var(--bs-secondary-color); }
.site-footer { margin-top: 2rem; padding-block: 2rem; border-top: 1px solid var(--bs-border-color); text-align: left; }
.site-footer p { max-width: 60rem; }
.ua-cell { max-width: 320px; }
