/* QIS — Quant Invest System | Components */

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; }

/* ── Typography ── */
h1, h2, h3, h4, h5 { line-height: 1.2; font-weight: 700; }

h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.1rem; }

.mono { font-family: var(--font-mono); }
.text-accent  { color: var(--accent); }
.text-muted   { color: var(--text-secondary); }
.text-dimmed  { color: var(--text-muted); }
.text-center  { text-align: center; }
.text-red     { color: var(--red); }
.text-green   { color: var(--green); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 14px 28px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 212, 170, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border-hover);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  padding: 14px 20px;
}
.btn-ghost:hover { color: var(--accent-hover); }

.btn-sm {
  padding: 10px 20px;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 18px 36px;
  font-size: 1.05rem;
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.card-glass {
  background: rgba(26, 34, 56, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* ── EA Product Card ── */
.ea-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: relative;
  overflow: hidden;
}

.ea-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  opacity: 0;
  transition: opacity var(--transition);
}

.ea-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), var(--shadow-glow);
}

.ea-card:hover::before { opacity: 1; }

.ea-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--yellow);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: fit-content;
}

.ea-card-badge.new {
  background: var(--accent-muted);
  color: var(--accent);
  border-color: var(--accent-border);
}

.ea-card-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.ea-card-meta {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.ea-tag {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
}

.ea-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.ea-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ea-metric-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.ea-metric-value {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
}

.ea-metric-value.positive { color: var(--accent); }
.ea-metric-value.negative { color: var(--red); }
.ea-metric-value.neutral  { color: var(--blue); }

.ea-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.ea-price {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.ea-card-actions {
  display: flex;
  gap: var(--space-2);
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-accent  { background: var(--accent-muted); color: var(--accent); border: 1px solid var(--accent-border); }
.badge-blue    { background: var(--blue-muted); color: var(--blue); }
.badge-yellow  { background: rgba(245,158,11,0.15); color: var(--yellow); }
.badge-green   { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-red     { background: var(--red-muted); color: var(--red); }

/* ── Metrics strip ── */
.metrics-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-10);
  flex-wrap: wrap;
}

.metric-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.metric-number {
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
}

.metrics-divider {
  width: 1px;
  height: 48px;
  background: var(--border);
}

/* ── Section ── */
.section {
  padding: var(--space-20) 0;
}

.section-sm { padding: var(--space-12) 0; }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.section-title {
  margin-bottom: var(--space-4);
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
}

/* ── Divider ── */
hr, .divider {
  border: none;
  height: 1px;
  background: var(--border);
  margin: var(--space-8) 0;
}

/* ── Table ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Input / Form ── */
.input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color var(--transition);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
}

.input::placeholder { color: var(--text-muted); }

/* ── Accordion ── */
.accordion { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }

.accordion-item { border-bottom: 1px solid var(--border); }
.accordion-item:last-child { border-bottom: none; }

.accordion-trigger {
  width: 100%;
  background: transparent;
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 1rem;
  text-align: left;
  transition: background var(--transition);
}

.accordion-trigger:hover { background: rgba(255,255,255,0.03); }

.accordion-trigger .icon {
  width: 20px; height: 20px;
  color: var(--text-muted);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.accordion-trigger.open .icon { transform: rotate(180deg); }

.accordion-content {
  padding: 0 var(--space-6) var(--space-5);
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  display: none;
}

.accordion-content.open { display: block; }

/* ── Trust bar ── */
.trust-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  flex-wrap: wrap;
  padding: var(--space-4) var(--space-8);
  background: rgba(0, 212, 170, 0.06);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.trust-bar-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.trust-bar-item svg { color: var(--accent); }
.trust-bar .divider-dot { color: var(--border); }

/* ── Pipeline steps ── */
.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
}

.pipeline-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  position: relative;
  transition: all var(--transition);
}

.pipeline-step:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-glow);
}

.pipeline-step-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.pipeline-step-title {
  font-weight: 700;
  margin-bottom: var(--space-2);
  font-size: 0.95rem;
}

.pipeline-step-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Disclaimer ── */
.disclaimer {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.disclaimer strong { color: var(--yellow); }

/* ── Loading spinner ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(0,212,170,0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.9rem;
  box-shadow: var(--shadow-card);
  z-index: 9999;
  transform: translateY(120%);
  transition: transform var(--transition-slow);
}

.toast.show { transform: translateY(0); }
.toast.success { border-color: rgba(34,197,94,0.4); }
.toast.error   { border-color: rgba(239,68,68,0.4); }

/* ── Guarantee block ── */
.guarantee-block {
  background: var(--accent-muted);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.guarantee-icon {
  width: 48px; height: 48px;
  background: var(--accent-muted);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}
