/* Posizioni — lo stile di HR Manager Blu: bianco e blu scuro, i grigi sono
   il blu in trasparenza, tema automatico dal sistema. Fanno eccezione solo
   l'arancione del pulsante e il verde della spunta, chiesti esplicitamente.
   Pensata per iPhone 16 Pro Max (440 × 956 punti). */

:root {
  --blu: #0b1f3a;
  --arancio: #ff8a00;
  --arancio-premuto: #e67a00;
  --verde: #34c759;

  --bg: #ffffff;
  --fg: var(--blu);
  --sup: #ffffff;
  --fg2: rgba(11, 31, 58, 0.56);
  --fg3: rgba(11, 31, 58, 0.3);
  --sep: rgba(11, 31, 58, 0.12);
  --fill: rgba(11, 31, 58, 0.05);
  --fill2: rgba(11, 31, 58, 0.09);
  --ease-ios: cubic-bezier(0.32, 0.72, 0, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--blu);
    --fg: #ffffff;
    --sup: #142a4a;
    --fg2: rgba(255, 255, 255, 0.6);
    --fg3: rgba(255, 255, 255, 0.32);
    --sep: rgba(255, 255, 255, 0.14);
    --fill: rgba(255, 255, 255, 0.075);
    --fill2: rgba(255, 255, 255, 0.13);
    --verde: #30d158;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: var(--blu);
  --fg: #ffffff;
  --sup: #142a4a;
  --fg2: rgba(255, 255, 255, 0.6);
  --fg3: rgba(255, 255, 255, 0.32);
  --sep: rgba(255, 255, 255, 0.14);
  --fill: rgba(255, 255, 255, 0.075);
  --fill2: rgba(255, 255, 255, 0.13);
  --verde: #30d158;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 22px;
  letter-spacing: -0.41px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; letter-spacing: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
svg { display: block; }

.pagina {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 16px) 20px calc(env(safe-area-inset-bottom) + 16px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

h1 { font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: 0.37px; margin: 0; }
h2 { font-size: 13px; line-height: 18px; font-weight: 400; text-transform: uppercase; letter-spacing: -0.08px;
     color: var(--fg2); margin: 0 0 6px 16px; }
.sotto { margin: 0; font-size: 15px; line-height: 20px; color: var(--fg2); letter-spacing: -0.24px; }
.testata { padding-top: 8px; }

/* Il "riquadro" di Clienti / HR Blu: fondo in trasparenza, angoli 12, niente ombra. */
.riquadro { background: var(--fill); border-radius: 12px; padding: 14px 16px; }
label { display: block; font-size: 13px; line-height: 18px; color: var(--fg2); margin-bottom: 6px; }

.tendina { position: relative; }
.tendina select {
  -webkit-appearance: none; appearance: none;
  width: 100%;
  font-size: 20px; line-height: 25px; font-weight: 600; letter-spacing: 0.38px;
  background: var(--sup); border: 0.5px solid var(--sep); border-radius: 10px;
  padding: 13px 44px 13px 14px;
}
.tendina svg {
  position: absolute; right: 12px; top: 50%; width: 24px; height: 24px; transform: translateY(-50%);
  fill: none; stroke: var(--fg2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none;
}
.indirizzo { margin: 8px 2px 0; font-size: 15px; line-height: 20px; color: var(--fg2); }

/* ---------------------------------------------------------------- centro */
.centro { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 340px; }
.vista { display: none; flex-direction: column; align-items: center; text-align: center; gap: 14px;
         animation: entra 300ms var(--ease-ios) both; width: 100%; }
@keyframes entra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.centro[data-stato="vuoto"] .vista-salva,
.centro[data-stato="nuovo"] .vista-salva,
.centro[data-stato="registrato"] .vista-registrato,
.centro[data-stato="rileva"] .vista-rileva,
.centro[data-stato="debole"] .vista-debole,
.centro[data-stato="fatto"] .vista-fatto,
.centro[data-stato="errore"] .vista-errore { display: flex; }
.centro:not([data-stato="vuoto"]) .solo-vuoto { display: none; }

.cerchio {
  position: relative;
  width: 168px; height: 168px; border-radius: 50%;
  background: var(--arancio); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 12px 32px rgba(255, 138, 0, 0.35);
  transition: transform 150ms var(--ease-ios), opacity 200ms, box-shadow 200ms;
}
.cerchio > svg:last-child { width: 64px; height: 64px; fill: #fff; }
.cerchio:active:not(:disabled) { transform: scale(0.95); background: var(--arancio-premuto); }
.cerchio:disabled { opacity: 0.3; box-shadow: none; cursor: default; }
.etichetta-cerchio { margin: 4px 0 0; font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: 0.35px; }
.etichetta-cerchio.verde { color: var(--verde); }
.suggerimento { margin: 0; max-width: 340px; font-size: 15px; line-height: 20px; color: var(--fg2); letter-spacing: -0.24px; }

/* Rilevamento: anello che si riempie nei secondi di ascolto. */
.cerchio-attivo { animation: respira 1.6s ease-in-out infinite; }
@keyframes respira { 50% { box-shadow: 0 12px 48px rgba(255, 138, 0, 0.6); } }
.anello { position: absolute; inset: -10px; width: calc(100% + 20px); height: calc(100% + 20px); transform: rotate(-90deg); }
.anello circle { fill: none; stroke-width: 4; }
.anello circle:first-child { stroke: var(--fill2); }
#arco { stroke: var(--arancio); stroke-linecap: round; stroke-dasharray: 351.86; stroke-dashoffset: 351.86;
        transition: stroke-dashoffset 300ms linear; }

.spunta {
  width: 168px; height: 168px; border-radius: 50%; background: var(--verde);
  display: grid; place-items: center; animation: scatta 450ms var(--ease-ios) both;
}
.spunta svg { width: 84px; height: 84px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
              stroke-dasharray: 24; stroke-dashoffset: 24; animation: traccia 400ms 180ms var(--ease-ios) forwards; }
@keyframes scatta { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes traccia { to { stroke-dashoffset: 0; } }

.avviso {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--fill2); border-radius: 12px; padding: 14px 18px;
  font-size: 20px; line-height: 25px; font-weight: 600;
}
.avviso svg { width: 24px; height: 24px; flex: none; fill: none; stroke: var(--arancio); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.pulsante-arancio, .pulsante-pieno {
  width: 100%; max-width: 360px; border-radius: 14px; padding: 16px; font-size: 17px; font-weight: 600;
  transition: transform 150ms var(--ease-ios), opacity 150ms;
}
.pulsante-arancio { background: var(--arancio); color: #fff; }
.pulsante-pieno { background: var(--fg); color: var(--bg); margin-top: 14px; }
.pulsante-arancio:active, .pulsante-pieno:active { transform: scale(0.97); opacity: 0.85; }
.pulsante-testo { color: var(--fg); font-weight: 600; padding: 10px 14px; border-radius: 10px; }
.pulsante-testo:active { background: var(--fill2); }
.pulsante-testo.piccolo { font-size: 15px; font-weight: 400; color: var(--fg2); }

/* ---------------------------------------------------------------- storico */
.elenco { list-style: none; margin: 0; padding: 0 0 0 16px; }
.elenco li { display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 0; }
.elenco li + li { border-top: 0.5px solid var(--sep); }
.elenco .quando { font-weight: 600; }
.elenco .dove { font-size: 13px; line-height: 18px; color: var(--fg2); font-variant-numeric: tabular-nums; letter-spacing: -0.08px; }
.elenco .testo { flex: 1; min-width: 0; }
.elenco .ultima { display: inline-block; margin-left: 6px; font-size: 12px; font-weight: 600; color: var(--bg); background: var(--fg);
                  border-radius: 6px; padding: 0 6px; vertical-align: 2px; }
.elenco a { color: var(--fg); font-size: 15px; font-weight: 600; text-decoration: none; padding: 8px 10px; border-radius: 10px; background: var(--fill2); }

.piede { display: flex; justify-content: center; }

/* ---------------------------------------------------------------- accesso */
.accesso { justify-content: center; text-align: center; }
.accesso .marchio { width: 88px; height: 88px; border-radius: 22px; background: var(--arancio); margin: 0 auto 8px; display: grid; place-items: center; }
.accesso .marchio svg { width: 48px; height: 48px; fill: #fff; }
.accesso form { text-align: left; margin-top: 16px; }
.accesso input {
  width: 100%; font-size: 28px; line-height: 34px; letter-spacing: 6px; text-align: center; font-variant-numeric: tabular-nums;
  background: var(--sup); border: 0.5px solid var(--sep); border-radius: 10px; padding: 12px;
}
.errore { margin: 10px 0 0; color: var(--fg); font-weight: 600; font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .spunta svg { stroke-dashoffset: 0; }
}
