/* =========================================
   MEDIASTREAMING — Form Modern CSS
   Tutte le regole isolate dentro .ms-form
   per evitare conflitti col CSS del sito
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700;800&family=JetBrains+Mono:wght@500&display=swap');

/* ---- Variabili ---- */
.ms-form {
  --brand:      #0057FF;
  --brand-dark: #003FBB;
  --brand-bg:   #EEF3FF;
  --text:       #474747;
  --muted:      #474747;
  --border:     #d0d5dd;
  --bg-input:   #f8f9fb;
  --bg-sub:     #f0f4ff;
  --radius:     6px;
  --focus-ring: 0 0 0 3px rgba(0,87,255,.15);
  --tr:         140ms ease;

  font-family: 'Open Sans', system-ui, sans-serif;
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
  box-sizing: border-box;
}

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

/* ---- Tables ---- */
.ms-form table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 3px;
}

.ms-form td {
  padding: 4px 3px;
  vertical-align: middle;
}

.ms-form tr > td[height] { height: 6px !important; padding: 0; }

/* ---- Label column ---- */
.ms-form .verdana10Verde {
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  width: 210px;
  padding-right: 14px;
  white-space: nowrap;
}

/* Prodotto bold */
.ms-form td > b {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

/* ---- Inputs & Selects ---- */
.ms-form input[type="text"],
.ms-form select {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Open Sans', system-ui, sans-serif;
  font-size: 15px;
  background: var(--bg-input);
  color: var(--text);
  transition: border-color var(--tr), box-shadow var(--tr);
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}

.ms-form select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23474747' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 34px;
  cursor: pointer;
}

.ms-form select:disabled {
  opacity: 1;
  cursor: default;
  color: var(--text);
  background-color: var(--bg-sub);
}

.ms-form input[type="text"]:focus,
.ms-form select:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: var(--focus-ring);
}

/* Price field */
.ms-form #total_monthly_cost {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 500;
  color: var(--brand);
  background: var(--brand-bg);
  border-color: #C7D9FF;
}

/* ---- Radio ---- */
.ms-form input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
  margin-right: 6px;
  vertical-align: middle;
}

/* ---- Sezione fiscale ---- */
.ms-form #sLive,
.ms-form #sOnDemand {
  margin-top: 5px;
}

.ms-form .fiscal-box {
  background: var(--bg-sub);
  border: 1.5px solid #c7d9ff;
  border-radius: var(--radius);
  padding: 14px 16px 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}

.ms-form .fiscal-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ms-form .fiscal-row.fiscal-full {
  grid-column: 1 / -1;
}

.ms-form .fiscal-row label {
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
}

.ms-form .fiscal-row input[type="text"] {
  width: 100%;
  height: 36px;
}

/* ---- Bottoni ---- */
.ms-form table:last-of-type tr td {
  display: flex;
  gap: 10px;
  padding-top: 12px;
  border: none;
}

.ms-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 24px;
  border: none;
  border-radius: var(--radius);
  font-family: 'Open Sans', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--tr), box-shadow var(--tr), transform var(--tr);
  white-space: nowrap;
  line-height: 1;
}

/* Primary */
.ms-form button[name="submit"],
.ms-form button[name="Submit"],
.ms-form button[type="submit"] {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 6px rgba(0,87,255,.2);
}
.ms-form button[name="submit"]:hover,
.ms-form button[name="Submit"]:hover,
.ms-form button[type="submit"]:hover {
  background: var(--brand-dark);
  box-shadow: 0 3px 10px rgba(0,87,255,.28);
  transform: translateY(-1px);
}

/* Secondary */
.ms-form button[type="button"] {
  background: #fff;
  color: var(--muted);
  border: 1.5px solid var(--border);
}
.ms-form button[type="button"]:hover {
  background: var(--bg-sub);
  color: var(--text);
}

.ms-form button:active { transform: none !important; }

/* ============================================
   STEP 2 — RIEPILOGO ORDINE
   ============================================ */

.ms-form #alignCenter { padding: 0; }

.ms-form #order_details { border-spacing: 0; }

.ms-form #tdHeader {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--text);
  padding: 0 0 14px 0;
  border-bottom: 2px solid var(--brand-bg);
}

.ms-form .colLeft {
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  width: 230px;
  padding: 9px 16px 9px 0;
  border-bottom: 1px solid #eef0f4;
  white-space: nowrap;
  vertical-align: middle;
}

.ms-form .colRight {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  padding: 9px 0;
  border-bottom: 1px solid #eef0f4;
  vertical-align: middle;
}

.ms-form .colHidden { display: none !important; }

.ms-form .colLefttos {
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  width: 230px;
  padding: 11px 16px 11px 0;
  vertical-align: top;
  white-space: nowrap;
}

.ms-form .coltos {
  font-size: 15px;
  color: var(--muted);
  padding: 11px 0;
  line-height: 1.6;
  vertical-align: top;
}

.ms-form .coltos input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--brand);
  cursor: pointer;
  vertical-align: middle;
  margin-right: 6px;
  position: relative;
  top: -1px;
}

/* ---- Links ---- */
.ms-form .link1,
.ms-form a.link1 {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid rgba(0,87,255,.25);
  transition: border-color var(--tr);
}
.ms-form .link1:hover { border-bottom-color: var(--brand); }

/* ============================================
   RESPONSIVE MOBILE
   ============================================ */
@media (max-width: 768px) {

  /* ---- STEP 1 — form fields: label sopra, input sotto ---- */
  .ms-form table { border-spacing: 0 2px; }

  .ms-form tr { display: flex; flex-direction: column; }

  .ms-form td { display: block; width: 100% !important; padding: 2px 0; }

  .ms-form .verdana10Verde {
    width: 100% !important;
    white-space: normal;
    padding-right: 0;
    padding-bottom: 3px;
    font-size: 13px;
  }

  .ms-form tr > td[height] { height: 4px !important; }

  .ms-form input[type="radio"] { width: auto; }

  .ms-form input[type="text"],
  .ms-form select {
    font-size: 13px;
    height: 34px;
  }

  /* Sezione fiscale — CAP e Città affiancati */
  .ms-form .fiscal-box {
    grid-template-columns: 1fr 1fr;
    gap: 5px 10px;
    padding: 8px 10px 6px;
  }

  .ms-form .fiscal-row.fiscal-full { grid-column: 1 / -1; }

  .ms-form .fiscal-row label { font-size: 13px; }

  .ms-form .fiscal-row input[type="text"] {
    height: 34px;
    font-size: 13px;
  }

  /* ---- STEP 2 — riepilogo: label sinistra | valore destra su stessa riga ---- */
  .ms-form #order_details tr { display: table-row; }

  .ms-form #order_details td { display: table-cell; padding: 6px 4px; }

  .ms-form .colLeft {
    display: table-cell !important;
    width: 42% !important;
    font-size: 12px;
    font-weight: 500;
    white-space: normal;
    padding: 6px 8px 6px 0;
    vertical-align: middle;
  }

  .ms-form .colRight {
    display: table-cell !important;
    width: 58% !important;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 0;
    vertical-align: middle;
  }

  .ms-form .colLefttos {
    display: table-cell !important;
    width: 42% !important;
    font-size: 12px;
    white-space: normal;
    padding: 8px 8px 8px 0;
    vertical-align: top;
  }

  .ms-form .coltos {
    display: table-cell !important;
    width: 58% !important;
    font-size: 12px;
    padding: 8px 0;
    line-height: 1.5;
    vertical-align: top;
  }

  .ms-form #tdHeader {
    font-size: 18px;
    padding-bottom: 10px;
  }

  /* Bottoni */
  .ms-form table:last-of-type tr { flex-direction: row; }
  .ms-form table:last-of-type td { display: flex; gap: 8px; }
  .ms-form button { flex: 1; font-size: 14px; }
}
