/* ============================================================
   PROFILO DI RISCHIO — Design System
   Brand: blu navy #1d3a5f · teal #3abfb1
   Style: Clean & Minimalista
   ============================================================ */

/* ── VARIABLES ─────────────────────────────────────────────── */
:root {
  --navy:        #1d3a5f;
  --navy-dark:   #0f2340;
  --navy-mid:    #254878;
  --teal:        #3abfb1;
  --teal-dark:   #2aa09a;
  --teal-light:  #e8f9f7;
  --white:       #ffffff;
  --off-white:   #f7fbfd;
  --light-bg:    #f0f6fa;
  --border:      #dde8f0;
  --text:        #1a2b3c;
  --text-muted:  #5a7a96;
  --text-light:  #8aa3ba;

  --radius-sm:   8px;
  --radius:      14px;
  --radius-lg:   22px;
  --radius-xl:   32px;

  --shadow-sm:   0 2px 8px rgba(29,58,95,.07);
  --shadow:      0 6px 24px rgba(29,58,95,.10);
  --shadow-lg:   0 16px 48px rgba(29,58,95,.14);

  --transition:  .25s cubic-bezier(.4,0,.2,1);
  --font:        'Inter', 'Segoe UI', sans-serif;
}

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); color: var(--text); background: var(--white); line-height: 1.6; -webkit-font-smoothing: antialiased; padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font); border: none; }
input, select, textarea, button { font-size: 16px; }
ul { list-style: none; }

/* ── BRAND INTRO ───────────────────────────────────────────── */
.brand-intro {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 18% 18%, rgba(58,191,177,.12), transparent 28%),
    radial-gradient(circle at 84% 78%, rgba(29,58,95,.10), transparent 30%),
    #ffffff;
  color: var(--navy);
  overflow: hidden;
  pointer-events: none;
}
.brand-intro.hide {
  opacity: 0;
  visibility: hidden;
  transition: opacity .55s ease, visibility .55s ease;
}
.brand-intro-dots {
  position: absolute;
  inset: 0;
  opacity: .55;
  background-image:
    radial-gradient(circle, rgba(58,191,177,.34) 0 1.4px, transparent 1.6px),
    radial-gradient(circle, rgba(29,58,95,.18) 0 1px, transparent 1.2px);
  background-size: 64px 64px, 92px 92px;
  background-position: 0 0, 28px 18px;
  animation: brandDotsWave 3.4s ease-in-out infinite alternate;
}
.brand-intro-mark {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100vw - 36px));
  text-align: center;
  padding: 36px 16px;
}
.brand-intro-logo {
  height: 54px;
  width: auto;
  margin: 0 auto 34px;
  opacity: 0;
  transform: translateY(12px);
  animation: brandIntroUp .65s ease .08s forwards;
}
.brand-intro-kicker {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(12px);
  animation: brandIntroUp .65s ease .18s forwards;
}
.brand-intro-title {
  color: #0b1020;
  font-size: clamp(44px, 8vw, 112px);
  font-weight: 900;
  line-height: .98;
  letter-spacing: 0;
  opacity: 0;
  transform: translateY(22px) scale(.98);
  animation: brandIntroTitle .8s cubic-bezier(.16,1,.3,1) .26s forwards;
}
.brand-intro-title span { color: var(--teal); }
@keyframes brandDotsWave {
  from { transform: translate3d(-14px, -8px, 0) scale(1); }
  to { transform: translate3d(18px, 12px, 0) scale(1.04); }
}
@keyframes brandIntroUp {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes brandIntroTitle {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .brand-intro { display: none; }
}
@media (max-width: 600px) {
  .brand-intro-mark { padding: 24px 10px; }
  .brand-intro-logo { height: 42px; margin-bottom: 26px; }
  .brand-intro-kicker { font-size: 10px; letter-spacing: 1.8px; }
  .brand-intro-title { font-size: clamp(42px, 15vw, 68px); line-height: 1.02; }
}

/* ── TYPOGRAPHY ────────────────────────────────────────────── */
h1, h2, h3, h4 { line-height: 1.15; font-weight: 700; color: var(--navy); }
h1 { font-size: clamp(36px, 5.5vw, 68px); font-weight: 800; letter-spacing: -1px; }
h2 { font-size: clamp(28px, 4vw, 48px); font-weight: 700; letter-spacing: -.5px; }
h3 { font-size: clamp(20px, 2.5vw, 28px); }
h4 { font-size: 18px; }
p  { color: var(--text-muted); line-height: 1.75; }

/* ── LAYOUT ────────────────────────────────────────────────── */
.container { max-width: 1160px; margin: 0 auto; padding: 0 32px; }
.section { padding: 96px 0; }
.section-sm { padding: 64px 0; }
@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .section { padding: 64px 0; }
  .section-sm { padding: 40px 0; }
}

/* ── EYEBROW / LABEL ───────────────────────────────────────── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 16px;
}
.eyebrow::before {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--teal);
  border-radius: 2px;
}

/* ── BUTTONS ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
  min-height: 48px;
}
.btn-primary {
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(29,58,95,.25);
}
.btn-primary:hover {
  background: var(--navy-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(29,58,95,.30);
}
.btn-teal {
  background: var(--teal);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(58,191,177,.30);
}
.btn-teal:hover {
  background: var(--teal-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(58,191,177,.35);
}
.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--navy);
  background: var(--light-bg);
}
.btn-outline-white {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,.35);
}
.btn-outline-white:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.6);
}
.btn-lg { padding: 17px 36px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-sm { padding: 10px 20px; font-size: 13px; }

/* ── NAVBAR ────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: all var(--transition);
  padding-top: env(safe-area-inset-top);
}
.navbar.scrolled {
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  height: 96px;
  gap: 24px;
}
.nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  line-height: 0;
}
.nav-logo img {
  height: 72px;
  width: auto;
  display: block;
  max-width: 360px;
}
/* SVG Fallback logo (se immagine non caricata) */
.logo-svg-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-hex {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.logo-text-block .logo-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: .5px;
  line-height: 1.1;
}
.logo-text-block .logo-tag {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--teal);
  margin-top: 1px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 40px;
  flex: 1;
  justify-content: center;
}
.nav-links a {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  transition: color var(--transition);
  position: relative;
  white-space: nowrap;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--teal);
  border-radius: 2px;
  transition: width var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--navy); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-cta { display: flex; align-items: center; gap: 12px; }
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  padding: 6px;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background var(--transition);
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: all var(--transition);
}
.hamburger:hover { background: var(--light-bg); }

/* Mobile nav */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  top: calc(96px + env(safe-area-inset-top));
  background: var(--white);
  z-index: 999;
  padding: 32px 24px calc(32px + env(safe-area-inset-bottom));
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border);
  overflow-y: auto;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mobile-menu .btn { margin-top: 24px; text-align: center; justify-content: center; }

@media (max-width: 900px) {
  .nav-links, .nav-cta { display: none; }
  .hamburger { display: flex; }
}
@media (max-width: 560px) {
  .nav-inner { height: 80px; }
  .nav-logo img { height: 68px; max-width: 300px; }
  .mobile-menu { top: calc(80px + env(safe-area-inset-top)); padding: 24px 20px calc(28px + env(safe-area-inset-bottom)); }
  .mobile-menu a { font-size: 17px; padding: 16px 0; }
}

/* ── FOOTER ────────────────────────────────────────────────── */
footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,.7);
  padding: 72px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 56px;
}
.footer-brand .footer-logo {
  display: block;
  width: min(280px, 100%);
  height: auto;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: #ffffff;
  border-radius: 6px;
  filter: none;
  opacity: 1;
}
.footer-brand p { font-size: 13px; line-height: 1.8; max-width: 280px; }
.footer-col h5 { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,.9); margin-bottom: 20px; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { font-size: 13px; color: rgba(255,255,255,.55); transition: color var(--transition); }
.footer-col ul li a:hover { color: var(--teal); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-bottom p { font-size: 12px; color: rgba(255,255,255,.4); }
.footer-bottom a { color: rgba(255,255,255,.4); transition: color var(--transition); }
.footer-bottom a:hover { color: var(--teal); }
.footer-social { display: flex; gap: 12px; }
.footer-social a {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all var(--transition);
}
.footer-social a:hover { background: var(--teal); transform: translateY(-2px); }
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-grid .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
@media (display-mode: standalone) {
  .navbar { box-shadow: 0 1px 0 rgba(221,232,240,.9); }
}

/* ── APP INSTALL PROMPT ───────────────────────────────────── */
.app-install-prompt {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 1200;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 14px 14px 18px;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(221,232,240,.95);
  border-radius: 20px;
  box-shadow: 0 18px 52px rgba(15,35,64,.20);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.app-install-prompt strong {
  display: block;
  color: var(--navy);
  font-size: 14px;
  line-height: 1.25;
}
.app-install-prompt span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
  margin-top: 2px;
}
.app-install-btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
}
.app-install-close {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: var(--light-bg);
  color: var(--navy);
  font-size: 22px;
  line-height: 1;
}
@media (max-width: 430px) {
  .app-install-prompt {
    grid-template-columns: 1fr auto;
  }
  .app-install-close { grid-column: 2; grid-row: 1; }
  .app-install-btn { grid-column: 1 / -1; width: 100%; }
}

/* ── CARDS ─────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all var(--transition);
}
.card:hover {
  border-color: transparent;
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

/* ── HEXAGON ICON ──────────────────────────────────────────── */
.hex-icon {
  width: 56px;
  height: 56px;
  background: var(--teal-light);
  clip-path: polygon(50% 0%, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 20px;
  flex-shrink: 0;
  transition: all var(--transition);
}
.card:hover .hex-icon { background: var(--teal); }

/* ── BADGE ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
}
.badge-teal  { background: var(--teal-light); color: var(--teal-dark); }
.badge-navy  { background: rgba(29,58,95,.08); color: var(--navy); }

/* ── PROFILE RISK COLORS ───────────────────────────────────── */
.risk-1 { --rc: #4e9af1; --rb: #eef5ff; }
.risk-2 { --rc: var(--teal); --rb: var(--teal-light); }
.risk-3 { --rc: #f0b429; --rb: #fffbea; }
.risk-4 { --rc: #f07c29; --rb: #fff5ee; }
.risk-5 { --rc: #e05252; --rb: #fff0f0; }

/* ── ANIMATIONS ────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up   { opacity: 0; }
.fade-up.visible { animation: fadeUp .6s ease forwards; }
.fade-up:nth-child(1) { animation-delay: .0s; }
.fade-up:nth-child(2) { animation-delay: .1s; }
.fade-up:nth-child(3) { animation-delay: .2s; }
.fade-up:nth-child(4) { animation-delay: .3s; }

/* ── DIVIDER ───────────────────────────────────────────────── */
.divider { width: 48px; height: 3px; background: var(--teal); border-radius: 3px; margin: 20px 0; }

/* ── FORM ELEMENTS (contatti) ──────────────────────────────── */
.form-field { margin-bottom: 20px; }
.form-field label { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 7px; }
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(58,191,177,.15);
}
.form-field textarea { resize: vertical; min-height: 140px; }

/* ── PAGE HERO (inner pages) ───────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, #1a5a7a 100%);
  padding: 160px 0 80px;
  text-align: center;
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%233abfb1' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.page-hero h1 { color: var(--white); font-size: clamp(32px, 5vw, 56px); margin-bottom: 16px; }
.page-hero p  { color: rgba(255,255,255,.75); max-width: 560px; margin: 0 auto; font-size: 17px; }

/* ── BREADCRUMB ────────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; justify-content: center; }
.breadcrumb a { font-size: 13px; color: rgba(255,255,255,.5); transition: color var(--transition); }
.breadcrumb a:hover { color: var(--teal); }
.breadcrumb span { color: rgba(255,255,255,.3); font-size: 12px; }

/* ── UTILITY ───────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-teal   { color: var(--teal); }
.text-navy   { color: var(--navy); }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-48 { margin-bottom: 48px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) { .grid-4 { grid-template-columns: 1fr; } }
