/* ── Brand font: Proxima Nova (solo Light 300). Body: Mulish. ── */
@font-face {
  font-family: "Proxima Nova";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/static/fonts/ProximaNova-Light.ttf") format("truetype");
}

:root {
  /* ── TPPay Design System ── */
  --nav: #07122d;             /* navy ink / superfici scure */
  --bg: #f8f8fa;
  --panel: #ffffff;
  --border: #e7e6e6;

  --text: #2a3450;
  --muted: #4f596d;

  /* Brand */
  --purple: #b01efb;          /* azione primaria */
  --purple-600: #9a14e0;
  --purple-400: #c862fc;
  --purple-200: #e4b6fe;
  --orange: #fd7d05;          /* accento */
  --orange-600: #f39600;

  /* Status */
  --success: #1f9e5a;
  --danger: #e23d52;

  /* Ombre navy-tinted */
  --shadow-md: 0 8px 24px rgba(7, 18, 45, .10);
  --shadow-sm: 0 2px 8px rgba(7, 18, 45, .08);
  --shadow-lg: 0 16px 40px rgba(7, 18, 45, .14);
  --shadow-purple: 0 10px 30px rgba(176, 30, 251, .35);

  /* Gradienti firma */
  --gradient-coin: linear-gradient(120deg, #fd7d05 0%, #fea450 35%, #c862fc 65%, #b01efb 100%);
  --gradient-brand: linear-gradient(90deg, #07122d 0%, #b01efb 55%, #fd7d05 100%);
  --gradient-hero: radial-gradient(120% 120% at 50% 45%, #3a1e78 0%, #1b1640 45%, #07122d 100%);
  --focus-ring: 0 0 0 3px rgba(176, 30, 251, .35);

  --font-body: "Mulish", system-ui, sans-serif;
  --font-display: "Proxima Nova", "Mulish", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  overflow-y: auto;
}

.page {
  min-height: 100vh; /* fallback */
  min-height: 100dvh; /* dynamic viewport */
  display: flex;
  flex-direction: column;
}

@supports not (height: 100dvh) and (-webkit-touch-callout: none) {
  html, body { min-height: -webkit-fill-available; }
  .page { min-height: -webkit-fill-available; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.topnav {
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0)),
    var(--nav);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 10px 30px rgba(7,18,45,.25);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.brand img {
  height: 28px;
  width: auto;
  display: block;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,.35));
}

.brand-title {
  font-family: var(--font-body);
  font-weight: 800;
  letter-spacing: -0.2px;
  line-height: 1.1;
  font-size: 14px;
}

.brand-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,.72);
  margin-top: 2px;
}

.nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.userpill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  font-size: 12px;
  color: rgba(255,255,255,.92);
  max-width: min(520px, 70vw);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 16px 24px 34px;
}

.main.full {
  width: 100%;
  max-width: none;
  padding: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* iframe manages its own scroll */
}

.main.center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.embed-fill {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 18px;
}

/* Titoli grandi: Proxima Nova Light (la firma tipografica del brand).
   Titoli piccoli (card/sezioni): Mulish bold. */
h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 34px;
  letter-spacing: -0.02em;
}

h2 {
  margin: 0 0 10px;
  font-family: var(--font-body);
  font-weight: 800;
  letter-spacing: -0.3px;
}

p { margin: 0 0 12px; color: var(--muted); line-height: 1.7; }
.muted { color: var(--muted); }

input[type="search"],
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"] {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 14px;
}

input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: var(--focus-ring);
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  transition: transform .15s ease, filter .15s ease, background-color .15s ease, box-shadow .2s ease;
  user-select: none;
  white-space: nowrap;
  font: inherit;
}

button.btn {
  cursor: pointer;
}

.btn.primary {
  color: #fff;
  background: var(--purple);
  box-shadow: var(--shadow-sm);
  border: 0;
}

.btn.primary:hover {
  box-shadow: var(--shadow-purple);
}

.btn.ghost {
  color: var(--nav);
  background: rgba(255,255,255,.88);
  border: 1px solid #b7bdc9;
}

.btn.nav {
  color: #fff;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
}

.btn.block {
  width: 100%;
}

.btn:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.btn.disabled {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
  filter: none;
  transform: none;
}

/* Auth shell (OTP/login/protected) */
.auth-shell {
  width: min(980px, 100%);
  animation: fadeUp .55s ease both;
}

.auth-card {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-md);
}

.hero-diagonal {
  height: 10px;
  background: var(--gradient-brand);
}

.auth-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(2,6,23,.03), rgba(2,6,23,0));
}

.auth-kicker {
  font-family: var(--font-body);
  font-weight: 800;
  letter-spacing: -0.2px;
  font-size: 14px;
  color: var(--text);
}

.auth-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(7, 18, 45, .12);
  background: rgba(176, 30, 251, .08);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.auth-pill span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gradient-coin);
}

.auth-content {
  padding: 24px;
}

.split {
  display: grid;
  grid-template-columns: 1.25fr .9fr;
  gap: 26px;
  align-items: stretch;
}

.note {
  display: flex;
  gap: 12px;
  background: rgba(2, 6, 23, .02);
  border: 1px solid rgba(2, 6, 23, .12);
  border-radius: 14px;
  padding: 14px;
  font-size: 13px;
  color: var(--muted);
}

.otp-input {
  width: min(340px, 100%);
  display: block;
  margin: 6px auto 0;
  text-align: center;
  letter-spacing: 10px;
  font-size: 22px;
  font-weight: 800;
  padding: 14px 16px;
  border-radius: 16px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, rgba(2, 6, 23, .02), rgba(2, 6, 23, 0));
}

.auth-card .panel {
  background: rgba(2, 6, 23, .02);
  border: 1px solid rgba(2, 6, 23, .10);
  box-shadow: none;
}

@media (max-width: 900px) {
  .brand { min-width: 0; }
  .brand-title { font-size: 13px; }
  h1 { font-size: 28px; }
  .split { grid-template-columns: 1fr; }
  .hero-diagonal {
    height: 8px;
  }
}

/* ─── Mobile (max 600px) ─── */
@media (max-width: 600px) {
  .topnav {
    padding: 10px 12px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .brand {
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
  }

  .brand img {
    height: 24px;
  }

  .brand-title {
    font-size: 12px;
  }

  .brand-subtitle {
    font-size: 10px;
    display: none;
  }

  .nav-right {
    gap: 6px;
    flex: 0 0 auto;
  }

  .userpill {
    display: none;
  }

  .btn.nav {
    padding: 8px 10px;
    font-size: 11px;
  }

  .main {
    padding: 14px 12px 24px;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 20px;
  }

  .panel {
    padding: 14px;
    border-radius: 14px;
  }

  /* Auth pages */
  .auth-shell {
    width: 100%;
  }

  .auth-card {
    border-radius: 16px;
  }

  .auth-head {
    padding: 12px 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .auth-kicker {
    font-size: 13px;
  }

  .auth-subtitle {
    font-size: 11px;
  }

  .auth-pill {
    padding: 6px 10px;
    font-size: 11px;
  }

  .auth-content {
    padding: 16px 14px;
  }

  .otp-input {
    font-size: 20px;
    letter-spacing: 8px;
    padding: 12px 14px;
    border-radius: 14px;
  }

  .note {
    padding: 12px;
    font-size: 12px;
    gap: 10px;
  }

  input[type="search"],
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="number"] {
    padding: 11px;
    font-size: 16px; /* Previene zoom su iOS */
    border-radius: 10px;
  }

  .btn {
    padding: 10px 14px;
    font-size: 13px;
  }
}

/* Language switcher (topbar) */
.lang-switcher {
  display: flex;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.lang-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,.5);
  text-decoration: none;
  transition: all .2s ease;
}

.lang-opt:hover {
  color: rgba(255,255,255,.8);
  background: rgba(255,255,255,.08);
}

.lang-opt.active {
  color: #fff;
  background: var(--purple);
  box-shadow: 0 2px 6px rgba(176, 30, 251, .3);
}

@media (max-width: 600px) {
  .lang-switcher {
    padding: 2px;
  }

  .lang-opt {
    padding: 4px 6px;
    font-size: 10px;
  }
}

.main {
  padding-top: 20px;
  padding-inline: 18px;
}

.main:not(.full) {
  background:
    radial-gradient(900px 380px at 20% 0%, rgba(176,30,251,.06), rgba(176,30,251,0) 60%),
    radial-gradient(900px 380px at 80% 0%, rgba(253,125,5,.06), rgba(253,125,5,0) 60%);
}
