/* =========================================================
   Vimar AURA - landing & backoffice
   Palette presa dal marchio: le quattro lettere di A·U·R·A
   diventano i colori dei blocchi della pagina.
   ========================================================= */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque.woff2") format("woff2-variations"),
       url("../fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: #19191a;
  --paper: #ffffff;
  --mist: #f3f3f7;
  --muted: #55555f;
  --line: #d9d9e2;

  --yellow: #fbbc01;   /* A */
  --blue:   #2396ef;   /* U */
  --violet: #6b5cec;   /* R */
  --pink:   #ed507a;   /* A */

  --font: "Bricolage Grotesque", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --stroke: 3px;
  --r-card: 28px;
  --r-inner: 18px;
  --lift: 8px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: #fbeecc;
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Aura: i segnali del logo si allargano alla pagina ----------
   L'unico momento animato: al caricamento gli archi si "propagano"
   dal logo verso l'esterno, poi restano fermi.                         */

.aura {
  position: absolute;
  z-index: -1;
  left: 16%;                 /* centro del logo dentro il banner */
  top: 50%;
  width: 100%;
  transform: translate(-50%, -50%);
  overflow: visible;
  pointer-events: none;
}
.aura-arc {
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: arc-out .9s cubic-bezier(.2, .7, .2, 1) both;
}
.aura-arc--blue   { stroke: var(--blue); }
.aura-arc--violet { stroke: var(--violet); }
.aura-arc--pink   { stroke: var(--pink); }
.aura-arc.r1 { stroke-width: 7; opacity: .9;  animation-delay: .15s; }
.aura-arc.r2 { stroke-width: 6; opacity: .5;  animation-delay: .35s; }
.aura-arc.r3 { stroke-width: 5; opacity: .25; animation-delay: .55s; }

@keyframes arc-out {
  from { stroke-dashoffset: 1; }
}

/* ---------- Layout ---------- */

.wrap {
  position: relative;
  z-index: 1;
  width: min(1040px, 100% - 40px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  margin: 0 auto;
  padding: 64px 0 calc(80px + env(safe-area-inset-bottom, 0px));
}
.page-public .wrap { padding-top: clamp(72px, 8vw, 108px); }

.hero {
  display: flex;
  justify-content: center;
  margin-bottom: 76px;
}
.hero__brand {
  position: relative;
  isolation: isolate;
  margin: 0;
  width: min(300px, 70%);
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 36px;
  align-items: stretch;
}

/* ---------- Card ---------- */

.card {
  --accent: var(--blue);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 32px 32px 34px;
  background: var(--paper);
  border: var(--stroke) solid var(--ink);
  border-radius: var(--r-card);
  box-shadow: var(--lift) var(--lift) 0 var(--accent);
}
.card--survey { --accent: var(--blue); }
.card--call   { --accent: var(--violet); }

.step {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: var(--stroke) solid var(--ink);
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
}
.card--survey .step,
.card--call .step { color: #fff; }

.card__title {
  margin: 4px 0 0;
  font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.375rem);
  font-weight: 800;
  font-stretch: 88%;
  line-height: 1.05;
  letter-spacing: -.01em;
}
.card__text {
  margin: 0;
  max-width: 38ch;
  color: var(--muted);
}

/* ---------- Bottoni ---------- */

.btn {
  --accent-btn: var(--accent, var(--blue));
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 14px 24px;
  border: var(--stroke) solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  min-height: 52px;
  box-shadow: 4px 4px 0 var(--accent-btn);
  transition: transform .12s ease, box-shadow .12s ease;
}
@media (hover: hover) {
  .btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--accent-btn); }
}
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--accent-btn); }
.btn[target]::after {
  content: "";
  width: 9px;
  height: 9px;
  border-top: 2.5px solid currentColor;
  border-right: 2.5px solid currentColor;
  transform: rotate(45deg);
  margin-left: 2px;
}

.pending {
  margin: auto 0 0;
  padding: 12px 18px;
  border: 2px dashed var(--line);
  border-radius: var(--r-inner);
  color: var(--muted);
  font-size: .9688rem;
}

/* ---------- Sondaggio: scadenza e chiusura ---------- */

.survey-until {
  margin: auto 0 0;
  color: var(--muted);
  font-size: .9688rem;
  font-weight: bold;
}
.survey-until + .btn { margin-top: 0; }

.closed {
  display: none;
  align-self: flex-start;
  margin: auto 0 0;
  padding: 10px 18px;
  border: var(--stroke) solid var(--ink);
  border-radius: var(--r-inner);
  background: var(--yellow);
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.25rem, 1rem + 1vw, 1.625rem);
  line-height: 1.2;
  letter-spacing: -.02em;
  transform: rotate(-2deg);
}
.card--survey[data-state="closed"] .closed { display: block; }
.card--survey[data-state="closed"] .btn--survey,
.card--survey[data-state="closed"] .survey-until,
.card--survey[data-state="closed"] .pending--survey { display: none; }

/* ---------- Box "Coming soon" / data della call ---------- */

.slot {
  margin: 4px 0 10px;
  padding: 22px 22px 20px;
  border-radius: var(--r-inner);
  background: var(--mist);
}
.slot--soon {
  border: 2px dashed var(--violet);
  background: color-mix(in srgb, var(--violet) 7%, var(--paper));
}

.soon {
  margin: 0;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.75rem, 1.1rem + 2.4vw, 2.625rem);
  line-height: 1.1;
  letter-spacing: -.02em;
}
.soon__cursor {
  color: var(--violet);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.slot__hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: .9688rem;
}

.when {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin: 0 0 18px;
}
.when__date {
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.2;
}
.when__time {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.125rem;
  padding: 2px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--yellow);
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 4px 10px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
}
.countdown__value {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.625rem, 1rem + 2vw, 2.375rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.countdown__label {
  margin-top: 6px;
  color: var(--muted);
  font-size: .8125rem;
}

.status {
  display: none;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-weight: 800;
  font-size: 1.25rem;
}
.status__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--pink) 60%, transparent);
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse { to { box-shadow: 0 0 0 12px transparent; } }

.card--call[data-state="live"]  .countdown,
.card--call[data-state="ended"] .countdown { display: none; }
.card--call[data-state="live"]  .status--live,
.card--call[data-state="ended"] .status--ended { display: flex; }
.card--call[data-state="ended"] .btn--join,
.card--call[data-state="ended"] .pending--join { display: none; }

/* ---------- Note ---------- */

.notes {
  margin-top: 44px;
  padding: 24px 28px;
  border: var(--stroke) solid var(--ink);
  border-radius: var(--r-inner);
  box-shadow: 6px 6px 0 var(--pink);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 24px;
  align-items: baseline;
  background: var(--paper);
}
.notes__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink);
}
.notes__title::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--pink);
  vertical-align: 1px;
}
.notes__body {
  margin: 0;
  max-width: 72ch;
  overflow-wrap: anywhere;
}
.notes__body a { text-decoration-color: var(--pink); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* =========================================================
   Backoffice
   ========================================================= */

.page-admin { background: var(--mist); }
.page-admin .wrap { width: min(720px, 100% - 32px); padding-top: 40px; }

.admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.admin-bar__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}
.admin-bar__brand img { width: 44px; height: 44px; }
.admin-bar__actions { display: flex; align-items: center; gap: 18px; }

.link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  touch-action: manipulation;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  cursor: pointer;
}

.link--small { min-height: 32px; font-size: .875rem; margin-left: 6px; }

.panel {
  --accent: var(--yellow);
  padding: 32px;
  background: var(--paper);
  border: var(--stroke) solid var(--ink);
  border-radius: var(--r-card);
  box-shadow: var(--lift) var(--lift) 0 var(--accent);
}
.panel--login { max-width: 440px; margin: 10vh auto 0; }
.panel__logo { width: 72px; height: 72px; margin-bottom: 18px; }
.panel__title { margin: 0 0 6px; font-size: 1.75rem; font-weight: 800; font-stretch: 88%; line-height: 1.1; }
.panel__intro { margin: 0 0 24px; color: var(--muted); }

.fieldset {
  margin: 0 0 28px;
  padding: 0 0 0 18px;
  border: 0;
  border-left: 5px solid var(--accent-f, var(--blue));
}
.fieldset--survey { --accent-f: var(--blue); }
.fieldset--call   { --accent-f: var(--violet); }
.fieldset--notes  { --accent-f: var(--pink); }
.fieldset legend {
  padding: 0;
  margin-bottom: 12px;
  font-size: 1.125rem;
  font-weight: 800;
}

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field label { font-weight: 700; }
.field__help { color: var(--muted); font-size: .875rem; }

.input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
.input:focus-visible { outline-offset: 1px; border-radius: 12px; }
textarea.input { min-height: 120px; resize: vertical; line-height: 1.5; }
.input[aria-invalid="true"] { border-color: var(--pink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink) 25%, transparent); }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding-top: 8px;
}
.form-actions .btn { margin-top: 0; }
.meta { color: var(--muted); font-size: .875rem; }

.flash {
  margin: 0 0 24px;
  padding: 14px 18px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  font-weight: 600;
}
.flash--ok    { background: color-mix(in srgb, var(--blue) 14%, var(--paper)); }
.flash--error { background: color-mix(in srgb, var(--pink) 16%, var(--paper)); }
.flash--info  { background: color-mix(in srgb, var(--yellow) 22%, var(--paper)); }
.flash ul { margin: 6px 0 0; padding-left: 20px; font-weight: 500; }

.admin-footer {
  margin-top: 40px;
  color: var(--muted);
  font-size: .875rem;
  text-align: center;
}
.admin-footer__version { font-family: var(--mono); font-weight: 500; }

/* ---------- Responsive ---------- */

@media (max-width: 820px) {
  .cards { grid-template-columns: 1fr; gap: 28px; }
  .hero { margin-bottom: 64px; }
  :root { --lift: 6px; }
}
@media (max-width: 480px) {
  .wrap { width: min(1040px, 100% - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)); }
  .card, .panel { padding: 24px 20px 26px; }
  .card { gap: 12px; }
  .notes { grid-template-columns: 1fr; padding: 20px; }
  .admin-bar { flex-wrap: wrap; }

  /* Bottoni a tutta larghezza: più facili da toccare, mai su due righe */
  .btn { align-self: stretch; justify-content: center; text-align: center; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .meta { text-align: center; }

  .slot { padding: 16px 14px; }
  .when { margin-bottom: 14px; }
  .when__date { font-size: 1.1875rem; }
  .countdown { gap: 6px; }
  .countdown__unit { padding: 10px 2px 8px; border-radius: 12px; }
  .countdown__value { font-size: clamp(1.375rem, 7.4vw, 1.75rem); }
  .countdown__label { font-size: .75rem; }
  .soon { font-size: clamp(1.5rem, 8.4vw, 2rem); }
}

/* Telefono in orizzontale: il banner non deve occupare tutto lo schermo */
@media (orientation: landscape) and (max-height: 520px) {
  .page-public .wrap { padding-top: 56px; }
  .hero { margin-bottom: 52px; }
  .hero__brand { width: min(220px, 40vw); }
}

@media (prefers-reduced-motion: reduce) {
  .aura-arc, .soon__cursor, .status__dot { animation: none; }
  .btn { transition: none; }
}
