/* =============================================================================
   Metazen Trading Services — Design System
   Aesthetic: refined minimalism. Modern, light, confident.
   Influenced by: Stripe, Linear, Notion.
   ============================================================================= */

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ----- Tokens ----- */
:root {
  /* Surfaces */
  --bg:           #FAFAFA;
  --surface:      #FFFFFF;
  --surface-alt:  #F4F4F5;
  --border:       #E5E7EB;
  --border-soft:  #F1F1F4;

  /* Text */
  --text:         #0F172A;
  --text-muted:   #64748B;
  --text-subtle:  #94A3B8;

  /* Brand / actions */
  --primary:      #0F172A;
  --primary-hover:#1E293B;
  --accent:       #16A34A;
  --accent-hover: #15803D;
  --danger:       #DC2626;
  --warning:      #D97706;

  /* Misc */
  --radius:       10px;
  --radius-lg:    16px;
  --shadow-sm:    0 1px 2px rgba(15,23,42,0.04);
  --shadow:       0 4px 12px rgba(15,23,42,0.06);
  --shadow-lg:    0 16px 40px rgba(15,23,42,0.08);

  /* Typography */
  --font-mono:    ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

/* ----- Base typography ----- */
h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
h1 { font-size: 44px; line-height: 1.1; }
h2 { font-size: 32px; line-height: 1.2; }
h3 { font-size: 20px; line-height: 1.3; }
p  { margin: 0 0 12px 0; }
.muted    { color: var(--text-muted); }
.small    { font-size: 13px; }
code      { font-family: var(--font-mono); font-size: 0.9em; background: var(--surface-alt); padding: 2px 6px; border-radius: 4px; }
a         { color: var(--primary); text-decoration: none; }
a:hover   { text-decoration: underline; }
strong    { font-weight: 600; }

/* ----- Layout primitives ----- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}
main { min-height: calc(100vh - 200px); }

.section          { padding: 80px 0; }
.section-alt      { background: var(--surface-alt); }
.section-title    { margin-bottom: 12px; }
.section-sub      { font-size: 17px; color: var(--text-muted); max-width: 720px; margin-bottom: 40px; }
.section-footnote { margin-top: 32px; text-align: center; }

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  font-family: inherit;
}
.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  text-decoration: none;
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--surface-alt);
  text-decoration: none;
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: transparent;
  padding: 8px 14px;
}
.btn-ghost:hover {
  background: var(--surface-alt);
  text-decoration: none;
}
.btn-lg     { padding: 14px 24px; font-size: 16px; }
.btn-block  { display: flex; width: 100%; }

/* ----- Nav ----- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(250, 250, 250, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ----- Hero ----- */
.hero {
  padding: 96px 0 64px;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(22, 163, 74, 0.06), transparent 60%),
    var(--bg);
}
.hero-inner { text-align: center; }
.hero-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(22, 163, 74, 0.08);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 24px;
}
.hero-title {
  font-size: 56px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 auto 24px;
  max-width: 880px;
}
.hero-accent { color: var(--accent); }
.hero-sub {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 36px;
  line-height: 1.55;
}
.hero-cta {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  max-width: 880px;
  margin: 0 auto;
}
.hero-stats > div {
  background: var(--surface);
  padding: 28px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hero-stats .stat-num {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.hero-stats .stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

/* ----- Steps ----- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}
.step {
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 20px;
}
.step h3       { margin-bottom: 8px; }
.step p        { color: var(--text-muted); margin: 0; }

/* ----- Strategy cards ----- */
.strategy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.strategy-card {
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.strategy-card:hover {
  border-color: #D4D4D8;
  transform: translateY(-1px);
}
.strategy-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.strategy-asset {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.strategy-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.1);
  color: var(--accent);
  letter-spacing: 0.02em;
}
.strategy-name {
  margin-bottom: 8px;
  font-size: 19px;
}
.strategy-blurb {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
  min-height: 42px;
}
.strategy-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  padding: 16px 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 16px;
}
.strategy-stats > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
}
.strategy-stats .lbl  { color: var(--text-muted); }
.strategy-stats .val  { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.strategy-highlight {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-align: center;
  padding-top: 4px;
}

/* ----- Two-column section ----- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.record-stats .card { padding: 8px 24px; }
.record-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 14px;
}
.record-row:last-child { border-bottom: none; }
.record-row .lbl  { color: var(--text-muted); }
.record-row .val  { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ----- CTA section ----- */
.section-cta {
  background: var(--primary);
  color: white;
  text-align: center;
}
.section-cta h2   { color: white; margin-bottom: 12px; }
.section-cta p    { color: rgba(255,255,255,0.7); margin-bottom: 24px; }
.section-cta .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
}
.section-cta .btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.section-cta a    { color: rgba(255,255,255,0.7); }
.section-cta a:hover { color: white; }

/* ----- FAQ ----- */
.faq { max-width: 720px; }
.faq details {
  border-bottom: 1px solid var(--border-soft);
  padding: 16px 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 500;
  font-size: 15px;
  list-style: none;
  position: relative;
  padding-right: 32px;
}
.faq summary::after {
  content: '+';
  position: absolute;
  right: 8px;
  font-size: 20px;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}
.faq details[open] summary::after { content: '−'; }
.faq details p {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ----- Forms / auth ----- */
.auth-section { padding: 72px 0; }
.auth-container { max-width: 460px; }
.auth-card {
  padding: 36px;
}
.auth-card h1 { font-size: 28px; margin-bottom: 8px; }
.auth-card form { margin-top: 24px; }
.auth-card label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-top: 18px;
  margin-bottom: 6px;
  color: var(--text);
}
.auth-card input[type=text],
.auth-card input[type=password],
.auth-card input[type=email] {
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-card input[type=text]:focus,
.auth-card input[type=password]:focus,
.auth-card input[type=email]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.06);
}
.auth-card small.muted {
  display: block;
  margin-top: 6px;
  font-size: 12px;
}
.auth-card button { margin-top: 28px; }
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 14px;
  font-weight: 400 !important;
}
.checkbox-row input { margin: 0; }
.auth-footer {
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ----- Flash messages ----- */
.flash-container { margin-top: 24px; }
.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 8px;
  border: 1px solid;
}
.flash-error    { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.flash-success  { background: #F0FDF4; border-color: #BBF7D0; color: #166534; }
.flash-info     { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }

/* ----- Footer ----- */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  background: var(--surface-alt);
  margin-top: 80px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 3fr;
  gap: 32px;
  align-items: start;
}
.footer-inner > div p { margin-top: 6px; }
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-links a {
  color: var(--text-muted);
  font-size: 14px;
}
.footer-links a:hover { color: var(--text); }
.footer-disclaimer { font-size: 12px; line-height: 1.5; }

/* ----- Responsive ----- */
@media (max-width: 880px) {
  .hero-title       { font-size: 38px; }
  .hero-stats       { grid-template-columns: repeat(2, 1fr); }
  .steps            { grid-template-columns: 1fr; }
  .strategy-grid    { grid-template-columns: 1fr; }
  .two-col          { grid-template-columns: 1fr; gap: 32px; }
  .footer-inner     { grid-template-columns: 1fr; }
  .nav-links .btn-ghost { display: none; }
  h1                { font-size: 32px; }
  h2                { font-size: 24px; }
}
@media (max-width: 480px) {
  .hero             { padding: 64px 0 32px; }
  .section          { padding: 48px 0; }
  .hero-title       { font-size: 28px; }
  .hero-cta         { flex-direction: column; align-items: stretch; }
}

/* =============================================================================
   Dashboard styles (Phase 4)
   Appended to the existing site.css
   ============================================================================= */

.dashboard-section { padding: 32px 0 80px; }

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}
.dash-actions { display: flex; gap: 8px; align-items: center; }

/* Dot indicators */
.dot, .status-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 6px;
}
.dot-on, .status-on   { background: var(--accent); box-shadow: 0 0 0 3px rgba(22,163,74,0.15); }
.dot-off              { background: var(--text-subtle); }
.status-warn          { background: var(--warning); box-shadow: 0 0 0 3px rgba(217,119,6,0.15); }
.status-fail          { background: var(--danger);  box-shadow: 0 0 0 3px rgba(220,38,38,0.15); }

/* MT5 status card */
.mt5-status-card { padding: 24px; margin-bottom: 20px; }
.mt5-status-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 24px;
  align-items: end;
}
.mt5-status-grid > div { display: flex; flex-direction: column; gap: 6px; }
.big-num {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

/* P&L cards */
.pnl-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 20px;
}
.pnl-card {
  padding: 20px 20px;
  display: flex; flex-direction: column; gap: 6px;
}
.pnl-value {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.pnl-value.positive { color: var(--accent); }
.pnl-value.negative { color: var(--danger); }

/* Strategy overview cards */
.strategy-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.strat-card { padding: 18px 20px; }
.strat-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 8px;
}
.strat-name { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.strat-toggle { flex-shrink: 0; }
.strat-meta { font-size: 13px; }

/* Pills */
.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.pill-on   { background: rgba(22,163,74,0.12);  color: var(--accent); }
.pill-off  { background: var(--surface-alt);    color: var(--text-muted); }
.pill-buy  { background: rgba(22,163,74,0.12);  color: var(--accent); }
.pill-sell { background: rgba(220,38,38,0.10);  color: var(--danger); }
.pill-win  { background: rgba(22,163,74,0.12);  color: var(--accent); }
.pill-loss { background: rgba(220,38,38,0.10);  color: var(--danger); }
.pill-timeout { background: var(--surface-alt); color: var(--text-muted); }

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
}
.data-table th {
  background: var(--surface-alt);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.data-table td { font-variant-numeric: tabular-nums; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface-alt); }
.data-table .empty-row {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-style: italic;
}
.data-table .positive { color: var(--accent); font-weight: 600; }
.data-table .negative { color: var(--danger); font-weight: 600; }
.data-table code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: none;
  padding: 0;
  color: var(--text-muted);
}

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border); border-radius: 24px;
  transition: 0.2s;
}
.toggle-slider:before {
  content: ""; position: absolute;
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-slider { background-color: var(--accent); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }

/* Settings form details (collapsible gale ladder) */
details summary::marker { color: var(--text-muted); }
details[open] summary { margin-bottom: 8px; }

/* Danger button */
.btn-danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}
.btn-danger:hover { background: #B91C1C; border-color: #B91C1C; text-decoration: none; }

/* Dashboard card wrapper */
.dash-card { margin-bottom: 16px; }

/* Responsive */
@media (max-width: 880px) {
  .mt5-status-grid { grid-template-columns: 1fr 1fr; }
  .pnl-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-header { flex-direction: column; align-items: stretch; }
  .data-table th, .data-table td { padding: 10px 12px; font-size: 12px; }
}
