/* ================================================================
   tools.magicsto.re — Shared Base CSS
   Palette: #152535 (navy) · #009DE0 (blue) · #C89030 (gold)
   Font: Novelin (self-hosted /fonts/)
   ================================================================ */

/* ── FONT: Novelin ─────────────────────────────────────────── */
@font-face {
  font-family: 'Novelin';
  src: url('/fonts/Novelin-Thin.ttf') format('truetype');
  font-weight: 100; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Novelin';
  src: url('/fonts/Novelin-ThinItalic.ttf') format('truetype');
  font-weight: 100; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Novelin';
  src: url('/fonts/Novelin-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Novelin';
  src: url('/fonts/Novelin-Italic.ttf') format('truetype');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Novelin';
  src: url('/fonts/Novelin-BoldItalic.ttf') format('truetype');
  font-weight: 700; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Novelin';
  src: url('/fonts/Novelin-Black.ttf') format('truetype');
  font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Novelin';
  src: url('/fonts/Novelin-BlackItalic.ttf') format('truetype');
  font-weight: 900; font-style: italic; font-display: swap;
}

/* ── VARIABLES ─────────────────────────────────────────────── */
:root {
  --navy:    #152535;
  --navy2:   #1a3347;
  --navy3:   #1e3d52;
  --blue:    #009DE0;
  --blue-lt: #33b4e8;
  --white:   #ffffff;
  --black:   #000000;
  --gray:    #a3bfcb;   /* elevated contrast on navy bg (was #8aabb8) */
  --gray2:   #6b8492;   /* elevated contrast (was #4a6a7a) */
  --gold:    #C89030;
  --gold-lt: #E8B040;
  --cream:   #F0EDE8;

  --score-crit:  #e74c3c;
  --score-low:   #e67e22;
  --score-mid:   #f1c40f;
  --score-good:  #2ecc71;
  --score-great: #27ae60;

  --radius:    14px;
  --radius-sm: 8px;
  --shadow:    0 8px 32px rgba(0,0,0,0.35);
}

/* ── A11Y HELPERS ──────────────────────────────────────────── */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  background: var(--blue);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* Default focus-visible across interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--blue-lt);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Reduced motion: annulla animazioni e transizioni */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

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

html, body {
  font-family: 'Novelin', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: var(--navy);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── BACKGROUND TEXTURE + GLOWS ────────────────────────────── */
body {
  padding-bottom: 42px;
  background-image:
    repeating-linear-gradient(-55deg, rgba(255,255,255,0.016) 0px, rgba(255,255,255,0.016) 1px, transparent 1px, transparent 34px),
    repeating-linear-gradient( 35deg, rgba(255,255,255,0.010) 0px, rgba(255,255,255,0.010) 1px, transparent 1px, transparent 34px);
}
body::before {
  content: '';
  position: fixed;
  top: -180px; left: -180px;
  width: 640px; height: 640px;
  background: radial-gradient(circle, rgba(200,144,48,0.07) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  bottom: -200px; right: -120px;
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(0,157,224,0.05) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* ── HEADER ────────────────────────────────────────────────── */
.header-wrap {
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  height: 72px;
  background: rgba(21, 37, 53, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(200, 144, 48, 0.18);
  position: relative;
}
.header-inner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 35%, var(--gold-lt) 65%, transparent 100%);
  pointer-events: none;
}

/* ── LOGO ──────────────────────────────────────────────────── */
.logo-img {
  height: 38px;
  width: auto;
  object-fit: contain;
  display: block;
}
.logo-txt-fallback {
  font-size: 22px;
  font-weight: 900;
  color: var(--white);
  letter-spacing: -0.5px;
  display: none;
}

/* ── BUTTON: HEADER CONSULT ────────────────────────────────── */
.btn-consult {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--blue);
  color: var(--white);
  font-family: 'Novelin', sans-serif;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.03em;
  padding: 10px 22px;
  border-radius: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.2s;
  animation: pulse-btn 3s ease-in-out infinite;
}
.btn-consult:hover {
  background: var(--blue-lt);
  transform: translateY(-1px);
  animation: none;
}
@keyframes pulse-btn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 157, 224, 0); }
  50%       { box-shadow: 0 0 0 6px rgba(0, 157, 224, 0.25); }
}

/* ── FOOTER ────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 28px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.footer-copy {
  font-size: 12px;
  color: var(--gray2);
  letter-spacing: 0.02em;
}
.footer-links {
  display: flex;
  gap: 20px;
}
.footer-links a {
  font-size: 12px;
  color: var(--gray2);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--blue-lt); }

/* ── COMMON ANIMATIONS ─────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── RESPONSIVE BASE ───────────────────────────────────────── */
@media (max-width: 640px) {
  .header-inner { padding: 0 20px; }
  .btn-consult  { font-size: 13px; padding: 9px 16px; }
  .footer       { padding: 24px 20px 72px; flex-direction: column; align-items: flex-start; }
}

/* ── TOOL FRAMEWORK ─────────────────────────────────────────────
   Screen system, top-bar, logo variants — definiti una volta sola
   qui e condivisi da tutti i tool della suite.
   ──────────────────────────────────────────────────────────────── */

/* Tool pages fill the viewport */
html, body { height: 100%; }
#app { min-height: 100vh; overflow-x: hidden; width: 100%; }

/* Screen transition system */
.screen        { display: none; min-height: 100vh; animation: fadeIn 0.35s ease; }
.screen.active { display: block; }

/* Top bar — sticky header inside tool screens */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* Welcome top bar: transparent + gold accent line */
.top-bar--welcome {
  padding: 20px 32px;
  background: transparent;
  border-bottom: 1px solid rgba(200,144,48,0.18);
  position: relative;
  z-index: 10;
}
.top-bar--welcome::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 35%, var(--gold-lt) 65%, transparent 100%);
}
.top-bar--quiz    { gap: 16px; } /* quiz/form steps */
.top-bar--form    { gap: 16px; } /* alias */
.top-bar--results { }            /* results: logo only */

/* Logo variants */
.logo          { height: 38px; width: auto; object-fit: contain; flex-shrink: 0; }
.logo--sm      { height: 30px; }
.logo--welcome { height: 44px; }
.logo-txt      { font-size: 22px; font-weight: 800; color: var(--white); letter-spacing: -0.5px; }
.logo-txt--sm  { font-size: 18px; }

/* Tool navigation */
.tool-badge {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  background: rgba(0,157,224,0.1);
  border: 1px solid rgba(0,157,224,0.25);
  padding: 4px 12px;
  border-radius: 20px;
}
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--gray);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.2s;
}
.btn-back:hover { color: var(--white); }

@media (max-width: 640px) {
  .top-bar--welcome { padding: 16px 20px; }
  body          { padding-bottom: 80px; }
  .ai-disclaimer { font-size: 10px; padding: 6px 16px 7px; }
}

/* ── Fonte nota inline ── */
.fonte-note {
  font-size: 0.75rem;
  color: #aaa;
  font-style: italic;
}

/* ── AI Disclaimer Footer ── */
.ai-disclaimer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(21,37,53,0.97);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
  padding: 7px 20px 8px;
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  z-index: 1000;
  line-height: 1.4;
}
