/* ============================================================
   FH Wealth Intelligence - Design System
   Coerente con brand FH Strategic Advisory (fhmed.it)
   ============================================================ */

:root {
  /* Palette FH Strategic Advisory (teal istituzionale + oro corporate) */
  --fh-blue: #1a5266;          /* Teal primary FH */
  --fh-blue-dark: #0f3a4a;     /* Primary dark */
  --fh-blue-light: #2a7a99;    /* Primary light */
  --fh-accent: #c4a35a;        /* Oro accent FH */
  --fh-accent-dark: #a8893e;
  --fh-accent-light: #d4b86a;
  --fh-success: #10b981;       /* Verde conferma */
  --fh-warning: #eab308;
  --fh-danger: #e74c3c;        /* Rosso warning FH */

  --fh-text: #1a202c;
  --fh-text-muted: #64748b;
  --fh-text-light: #94a3b8;

  --fh-bg: #ffffff;
  --fh-bg-alt: #f8fafc;
  --fh-bg-dark: #0f172a;

  --fh-border: #e2e8f0;
  --fh-border-dark: #cbd5e1;

  --fh-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --fh-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --fh-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --fh-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --fh-radius-sm: 4px;
  --fh-radius: 8px;
  --fh-radius-lg: 12px;
  --fh-radius-xl: 16px;

  --fh-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --fh-font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Courier New', monospace;

  --fh-container: 1200px;
  --fh-section-py: 80px;
}

/* ==== Reset + Base ==== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--fh-font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--fh-text);
  background: var(--fh-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--fh-accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--fh-accent-dark); }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; color: var(--fh-blue); }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); letter-spacing: -0.01em; }
h3 { font-size: 1.375rem; }
p { color: var(--fh-text); }

/* ==== Utilities ==== */
.container { max-width: var(--fh-container); margin: 0 auto; padding: 0 20px; }
.text-center { text-align: center; }
.text-muted { color: var(--fh-text-muted); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }

/* ==== Header ==== */
.fh-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--fh-border);
}
.fh-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 20px;
  max-width: var(--fh-container);
  margin: 0 auto;
}
.fh-logo {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--fh-blue);
  display: flex;
  align-items: center;
  gap: 8px;
}
.fh-logo .dot { color: var(--fh-accent); }
.fh-logo__sub {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fh-text-muted);
  border-left: 2px solid var(--fh-border);
  padding-left: 12px;
  margin-left: 4px;
}
.fh-nav { display: flex; align-items: center; gap: 32px; }
.fh-nav a {
  color: var(--fh-text);
  font-weight: 500;
  font-size: 0.9375rem;
  transition: color 0.2s;
}
.fh-nav a:hover { color: var(--fh-accent); }
.fh-nav__cta { margin-left: 8px; }

@media (max-width: 768px) {
  .fh-nav a:not(.fh-btn) { display: none; }
  .fh-logo__sub { display: none; }
}

/* ==== Buttons ==== */
.fh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--fh-radius);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.fh-btn--primary {
  background: var(--fh-accent);
  color: white;
  box-shadow: var(--fh-shadow);
}
.fh-btn--primary:hover {
  background: var(--fh-accent-dark);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--fh-shadow-lg);
}
.fh-btn--secondary {
  background: transparent;
  color: var(--fh-blue);
  border-color: var(--fh-border-dark);
}
.fh-btn--secondary:hover {
  background: var(--fh-bg-alt);
  border-color: var(--fh-accent);
  color: var(--fh-accent);
}
.fh-btn--ghost {
  background: transparent;
  color: var(--fh-text);
  padding: 8px 16px;
}
.fh-btn--ghost:hover { color: var(--fh-accent); }
.fh-btn--lg { padding: 16px 32px; font-size: 1rem; }
.fh-btn--block { width: 100%; }
.fh-btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* ==== Hero ==== */
.fh-hero {
  padding: calc(var(--fh-section-py) + 32px) 0 var(--fh-section-py);
  background:
    radial-gradient(circle at 10% 20%, rgba(196, 163, 90, 0.08), transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(196, 163, 90, 0.08), transparent 40%),
    linear-gradient(180deg, var(--fh-bg) 0%, var(--fh-bg-alt) 100%);
}
.fh-hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
@media (max-width: 900px) {
  .fh-hero__grid { grid-template-columns: 1fr; gap: 48px; }
}
.fh-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(196, 163, 90, 0.1);
  color: var(--fh-accent-dark);
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.fh-hero__badge::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--fh-success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.fh-hero h1 { margin-bottom: 20px; }
.fh-hero__sub {
  font-size: 1.1875rem;
  color: var(--fh-text-muted);
  margin-bottom: 32px;
  max-width: 500px;
}
.fh-hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }
.fh-hero__trust {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--fh-border);
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.8125rem;
  color: var(--fh-text-muted);
}
.fh-hero__trust span { display: flex; align-items: center; gap: 6px; }
.fh-hero__trust strong { color: var(--fh-blue); font-weight: 600; }

/* Mockup screenshot */
.fh-hero__mockup {
  position: relative;
  border-radius: var(--fh-radius-xl);
  background: var(--fh-bg-dark);
  box-shadow: var(--fh-shadow-xl);
  overflow: hidden;
  transform: perspective(1200px) rotateY(-6deg) rotateX(2deg);
  transition: transform 0.3s;
}
.fh-hero__mockup:hover { transform: perspective(1200px) rotateY(-3deg); }
.fh-hero__mockup::before {
  content: "";
  display: block;
  padding-top: 62.5%; /* 16:10 */
}
.fh-hero__mockup-content {
  position: absolute;
  inset: 0;
  padding: 16px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  color: #e2e8f0;
  font-family: var(--fh-font-mono);
  font-size: 0.75rem;
}
.fh-mock-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.fh-mock-bar span { width: 10px; height: 10px; border-radius: 50%; background: #64748b; }
.fh-mock-bar span:nth-child(1) { background: #ef4444; }
.fh-mock-bar span:nth-child(2) { background: #eab308; }
.fh-mock-bar span:nth-child(3) { background: #10b981; }
.fh-mock-bar em {
  margin-left: 12px;
  font-style: normal;
  color: #94a3b8;
  font-family: var(--fh-font);
  font-size: 0.75rem;
}
.fh-mock-body { display: grid; grid-template-columns: 80px 1fr 100px; gap: 12px; min-height: 0; }
.fh-mock-sidebar { background: rgba(255,255,255,0.03); border-radius: 6px; padding: 8px; }
.fh-mock-sidebar div {
  padding: 6px 4px;
  color: #64748b;
  border-radius: 4px;
  margin-bottom: 2px;
}
.fh-mock-sidebar div.active { background: rgba(59,130,246,0.2); color: #60a5fa; }
.fh-mock-chart {
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.fh-mock-price {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.fh-mock-price strong { font-size: 1.25rem; font-family: var(--fh-font); color: #fff; }
.fh-mock-price .delta { color: var(--fh-success); font-weight: 600; }
.fh-mock-price .live {
  padding: 2px 8px;
  background: rgba(16,185,129,0.15);
  color: var(--fh-success);
  border-radius: 100px;
  font-size: 0.625rem;
  font-family: var(--fh-font);
  font-weight: 700;
  letter-spacing: 0.05em;
}
.fh-mock-chart svg { width: 100%; height: 80px; }
.fh-mock-book { background: rgba(255,255,255,0.03); border-radius: 6px; padding: 8px; font-size: 0.6875rem; }
.fh-mock-book div { padding: 2px 4px; }
.fh-mock-book div.ask { color: #f87171; }
.fh-mock-book div.bid { color: #4ade80; }

/* ==== Sections ==== */
.fh-section { padding: var(--fh-section-py) 0; }
.fh-section--alt { background: var(--fh-bg-alt); }
.fh-section__head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 56px;
}
.fh-section__eyebrow {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(196, 163, 90, 0.1);
  color: var(--fh-accent-dark);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.fh-section__head p {
  font-size: 1.125rem;
  color: var(--fh-text-muted);
  margin-top: 12px;
}

/* ==== Feature grid ==== */
.fh-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.fh-feature {
  padding: 32px 28px;
  background: var(--fh-bg);
  border: 1px solid var(--fh-border);
  border-radius: var(--fh-radius-lg);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.fh-feature:hover {
  transform: translateY(-4px);
  box-shadow: var(--fh-shadow-lg);
  border-color: var(--fh-accent);
}
.fh-feature__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--fh-accent) 0%, var(--fh-accent-dark) 100%);
  color: white;
  border-radius: var(--fh-radius);
  margin-bottom: 20px;
  font-size: 1.5rem;
  font-weight: 700;
}
.fh-feature h3 { margin-bottom: 10px; font-size: 1.25rem; color: var(--fh-blue); }
.fh-feature p { color: var(--fh-text-muted); font-size: 0.9375rem; }

/* ==== How-it-works ==== */
.fh-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  counter-reset: step;
}
@media (max-width: 768px) { .fh-steps { grid-template-columns: 1fr; } }
.fh-step {
  position: relative;
  padding: 32px 24px 24px;
  text-align: center;
  counter-increment: step;
}
.fh-step::before {
  content: counter(step);
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 48px;
  background: var(--fh-blue);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  font-weight: 800;
  box-shadow: var(--fh-shadow);
}
.fh-step h3 { margin-bottom: 8px; font-size: 1.125rem; }
.fh-step p { color: var(--fh-text-muted); font-size: 0.9375rem; }

/* ==== Pricing ==== */
.fh-pricing {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}
@media (max-width: 900px) { .fh-pricing { grid-template-columns: 1fr; } }
.fh-plan {
  padding: 32px 28px;
  background: var(--fh-bg);
  border: 1px solid var(--fh-border);
  border-radius: var(--fh-radius-lg);
  position: relative;
  display: flex;
  flex-direction: column;
}
.fh-plan--featured {
  border-color: var(--fh-accent);
  box-shadow: 0 0 0 1px var(--fh-accent), var(--fh-shadow-xl);
  transform: scale(1.03);
}
@media (max-width: 900px) { .fh-plan--featured { transform: none; } }
.fh-plan__badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  background: var(--fh-accent);
  color: white;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
}
.fh-plan__name { font-size: 1rem; font-weight: 600; color: var(--fh-text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.fh-plan__price { font-size: 2.5rem; font-weight: 800; color: var(--fh-blue); margin-bottom: 8px; }
.fh-plan__price small { font-size: 1rem; font-weight: 500; color: var(--fh-text-muted); }
.fh-plan__desc { color: var(--fh-text-muted); font-size: 0.9375rem; margin-bottom: 24px; }
.fh-plan__features { list-style: none; margin-bottom: 32px; flex: 1; }
.fh-plan__features li {
  padding: 8px 0;
  padding-left: 28px;
  position: relative;
  font-size: 0.9375rem;
  color: var(--fh-text);
}
.fh-plan__features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 8px;
  width: 20px;
  height: 20px;
  background: var(--fh-success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}
.fh-plan__features li.disabled { color: var(--fh-text-light); }
.fh-plan__features li.disabled::before { content: "−"; background: var(--fh-text-light); }

/* ==== FAQ ==== */
.fh-faq { max-width: 800px; margin: 0 auto; }
.fh-faq-item {
  border-bottom: 1px solid var(--fh-border);
  padding: 20px 0;
}
.fh-faq-item summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--fh-blue);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-right: 8px;
  font-size: 1.0625rem;
}
.fh-faq-item summary::-webkit-details-marker { display: none; }
.fh-faq-item summary::after {
  content: "+";
  font-size: 1.5rem;
  font-weight: 300;
  transition: transform 0.2s;
}
.fh-faq-item[open] summary::after { transform: rotate(45deg); }
.fh-faq-item p {
  margin-top: 12px;
  color: var(--fh-text-muted);
  line-height: 1.7;
}

/* ==== CTA Strip ==== */
.fh-cta-strip {
  background: linear-gradient(135deg, var(--fh-blue) 0%, var(--fh-blue-dark) 100%);
  color: white;
  padding: 64px 0;
  text-align: center;
}
.fh-cta-strip h2 { color: white; margin-bottom: 16px; }
.fh-cta-strip p { color: rgba(255,255,255,0.8); font-size: 1.125rem; margin-bottom: 32px; }
.fh-cta-strip .fh-btn--primary { background: white; color: var(--fh-blue); }
.fh-cta-strip .fh-btn--primary:hover { background: rgba(255,255,255,0.9); color: var(--fh-blue); }

/* ==== Forms (registrazione + login) ==== */
.fh-auth {
  min-height: calc(100vh - 72px);
  padding: 48px 20px;
  background: var(--fh-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
}
.fh-auth__card {
  background: white;
  max-width: 480px;
  width: 100%;
  padding: 40px;
  border-radius: var(--fh-radius-lg);
  box-shadow: var(--fh-shadow-lg);
}
.fh-auth__card h1 { font-size: 1.75rem; margin-bottom: 8px; }
.fh-auth__card > p { color: var(--fh-text-muted); margin-bottom: 32px; }
.fh-field { margin-bottom: 20px; }
.fh-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fh-text);
  margin-bottom: 6px;
}
.fh-field label .req { color: var(--fh-danger); margin-left: 2px; }
.fh-field input,
.fh-field select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--fh-border-dark);
  border-radius: var(--fh-radius);
  font-size: 0.9375rem;
  font-family: inherit;
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.fh-field input:focus,
.fh-field select:focus {
  outline: none;
  border-color: var(--fh-accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.fh-field small { display: block; margin-top: 6px; color: var(--fh-text-muted); font-size: 0.8125rem; }
.fh-field small.error { color: var(--fh-danger); }
.fh-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--fh-text-muted);
  margin-bottom: 12px;
  cursor: pointer;
}
.fh-checkbox input {
  margin-top: 3px;
  accent-color: var(--fh-accent);
}
.fh-checkbox a { text-decoration: underline; }
.fh-auth__foot {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--fh-border);
  color: var(--fh-text-muted);
  font-size: 0.875rem;
}

/* Messaggi form */
.fh-msg {
  padding: 12px 16px;
  border-radius: var(--fh-radius);
  margin-bottom: 20px;
  font-size: 0.9375rem;
  display: none;
}
.fh-msg.show { display: block; }
.fh-msg--error { background: rgba(239, 68, 68, 0.1); color: var(--fh-danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.fh-msg--success { background: rgba(16, 185, 129, 0.1); color: var(--fh-success); border: 1px solid rgba(16, 185, 129, 0.2); }

/* Spinner */
.fh-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  display: inline-block;
  animation: fh-spin 0.7s linear infinite;
}
@keyframes fh-spin { to { transform: rotate(360deg); } }

/* ==== Footer ==== */
.fh-footer {
  background: var(--fh-bg-dark);
  color: #94a3b8;
  padding: 48px 0 24px;
}
.fh-footer__grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 48px;
  margin-bottom: 32px;
}
@media (max-width: 768px) { .fh-footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
.fh-footer h4 {
  color: white;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}
.fh-footer ul { list-style: none; }
.fh-footer li { margin-bottom: 8px; }
.fh-footer a { color: #94a3b8; font-size: 0.9375rem; }
.fh-footer a:hover { color: white; }
.fh-footer__brand { font-size: 1.375rem; font-weight: 800; color: white; margin-bottom: 12px; }
.fh-footer__brand .dot { color: var(--fh-accent); }
.fh-footer__about { color: #64748b; font-size: 0.9375rem; max-width: 320px; line-height: 1.7; }
.fh-footer__bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: #64748b;
}
@media (max-width: 768px) {
  .fh-footer__bottom { flex-direction: column; gap: 8px; text-align: center; }
}

/* Skip link */
.fh-skip {
  position: absolute;
  top: -40px;
  left: 0;
  padding: 8px 16px;
  background: var(--fh-blue);
  color: white;
  z-index: 9999;
}
.fh-skip:focus { top: 0; }
