/* =========================================================
   SimpolTelemetry — Global Shared CSS (Orange/Black only)
   Mobile-first, performance, accessibilità
   ========================================================= */

/* Design tokens: SOLO NERO + ARANCIONE + GRIGI NEUTRI */
:root{
  /* Background / surfaces */
  --bg: #07090d;
  --surface: #0c1016;
  --surface-2: #0a0d12;
  --line: #1a202b;

  /* Text */
  --text: #e8edf3;
  --muted: #a5adb8; /* grigio neutro, niente blu */

  /* Brand */
  --brand: #e07722;
  --brand-2: #ff7a00;

  /* States (solo caldi/neutri) */
  --danger: #ff4d3f;
  --success: #2ad67a;

  /* Layout */
  --radius: 16px;
  --shadow: 0 12px 34px rgba(0,0,0,.45);
  --container: 980px;
}

/* Reset essentials */
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: "IBM Plex Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img{ max-width:100%; display:block; }
a{ color: inherit; text-decoration: none; }
button, input{ font: inherit; }

/* Utilities */
.muted{ color: var(--muted); }
.link{
  color: var(--brand-2);
  text-decoration: none;
}
.link:hover{ text-decoration: underline; }

/* App shells */
.app{
  min-height:100%;
  display:flex;
}

.container{
  width:100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px;
}

/* Card */
.card{
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* =========================================================
   AUTH (login/register)
   ========================================================= */
.auth{
  align-items:center;
  justify-content:center;
  padding: 18px;
}

.auth__shell{
  width:100%;
  max-width: 520px;
}

.auth__header{
  text-align:center;
  margin-bottom: 14px;
}

.auth__brand{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin: 0 auto 10px;
}

.auth__logo{
  width: min(520px, 92vw);
  height: auto;
  border-radius: 14px;
  object-fit: contain;

  /* “incorniciatura” neutra */
  border: 1px solid var(--line);
  background: #05070b;
}

.auth__title{
  margin: 8px 0 4px;
  font-size: 22px;
  letter-spacing: .02em;
}

.auth__subtitle{
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--muted);
}

.auth__card{
  padding: 16px;
}

.auth__footnote{
  margin: 12px 0 0;
  text-align:center;
  font-size: 14px;
}

.auth__footer{
  margin-top: 14px;
  text-align:center;
  font-size: 12px;
}

/* =========================================================
   FORMS
   ========================================================= */

#company{
  position:absolute !important;
  left:-9999px !important;
  width:1px !important;
  height:1px !important;
  opacity:0 !important;
  pointer-events:none !important;
}

.form{
  display:grid;
  gap: 12px;
}

.field{
  display:flex;
  flex-direction:column;
  gap: 6px;
}

.label{
  font-weight: 600;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .01em;
}

.input{
  width:100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid #242c38;
  background: #06080c;
  color: var(--text);
  outline: none;

  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.input::placeholder{ color: #808995; } /* grigio neutro */
.input:focus{
  border-color: color-mix(in srgb, var(--brand-2), #ffffff 12%);
  box-shadow: 0 0 0 3px rgba(255, 122, 0, .18);
  background: #05070b;
}

.form__actions{
  display:flex;
  justify-content:flex-end;
  margin-top: 2px;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;

  border: 1px solid #242c38;
  background: #121824;
  color: var(--text);

  cursor: pointer;
  user-select:none;

  transition: transform .08s ease, filter .15s ease, border-color .15s ease, background .15s ease;
}

.btn:hover{
  filter: brightness(1.06);
  border-color: color-mix(in srgb, var(--brand-2), #ffffff 10%);
}

.btn:active{ transform: translateY(1px); }

.btn:disabled{
  opacity: .65;
  cursor: not-allowed;
  transform: none;
}

.btn--primary{
  border-color: color-mix(in srgb, var(--brand-2), #000 30%);
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  color: #07090d;
  font-weight: 700;
}

/* Focus visibility (accessibilità) */
.btn:focus-visible,
.input:focus-visible,
.link:focus-visible{
  outline: 2px solid rgba(255, 122, 0, .55);
  outline-offset: 2px;
}

/* =========================================================
   ALERT / STATUS
   ========================================================= */
.alert{
  min-height: 18px; /* evita salto layout quando appare */
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.alert--success{ color: var(--success); }
.alert--error{ color: var(--danger); }
.alert--info{ color: var(--brand-2); } /* info = arancione, non azzurro */

.beta-disclaimer {
  margin-top: 12px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  color: #c9c9c9;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 420px){
  .auth{ padding: 12px; }
  .auth__card{ padding: 14px; }
  .form__actions{ justify-content: stretch; }
  .btn{ width: 100%; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; }
}

/* =========================================================
   MODAL (Policy / Termini / Privacy)
   ========================================================= */

.modalOverlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.62);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9999;
}

.modalOverlay.is-open{ display: flex; }

.modal{
  width: min(720px, 96vw);
  max-height: min(78vh, 720px);
  overflow: hidden;

  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);

  display: flex;
  flex-direction: column;
}

.modal__header{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px;
  border-bottom: 1px solid var(--line);
}

.modal__title{
  font-weight: 700;
  letter-spacing: .01em;
}

.modalCloseBtn{
  background: transparent;
  border: 1px solid #242c38;
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.modalCloseBtn:hover{
  border-color: color-mix(in srgb, var(--brand-2), #ffffff 10%);
}

.modal__body{
  padding: 14px;
  overflow: auto;
}

.modal__footer{
  display:flex;
  justify-content:flex-end;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

/* scroll area per policy */
.policyScroll{
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  border-radius: 12px;
  padding: 12px;
  max-height: 42vh;
  overflow: auto;
}

.policyH{
  margin: 0 0 6px;
  font-size: 14px;
}

.policyP{
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.policyAck{
  display:flex;
  align-items:flex-start;
  gap: 10px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text);
}

.policyAck input{
  margin-top: 3px;
  accent-color: var(--brand-2);
}

/* Mobile: footer bottoni full width */
@media (max-width: 420px){
  .modal__footer{
    flex-direction: column;
  }
  .modal__footer .btn{
    width: 100%;
  }
}

