/* #ewelink-open-the-door details.form-wrapper, fieldset.form-wrapper { */
/* 	width: 100%; */
/* } */


/* =========================================================
   eWeLink Open The Door — form
   ========================================================= */
.ewelink-open-the-door {
  /* token di tema: cambia qui per personalizzare */
  --ewl-pad: 1rem;
  --ewl-radius: 12px;
  --ewl-gap: .75rem;

  --ewl-border: #d5dbe2;
  --ewl-bg: #ffffff;
  --ewl-bg-head: #f4f7fa;
  --ewl-text: #1a1f24;
  --ewl-muted: #5a6570;
  --ewl-accent: #0b63ce;
  --ewl-accent-hover: #084fa6;
  --ewl-focus: #ffb300;

  max-width: 40rem;
  margin-inline: auto;
  display: grid;
  gap: var(--ewl-gap);
  color: var(--ewl-text);
  font: inherit;
  font-size: 1rem;
  line-height: 1.45;
}

.ewelink-open-the-door *,
.ewelink-open-the-door *::before,
.ewelink-open-the-door *::after {
  box-sizing: border-box;
}

/* ---------- Details come "card" ---------- */
.ewelink-open-the-door details {
  background: var(--ewl-bg);
  border: 1px solid var(--ewl-border);
  border-radius: var(--ewl-radius);
  overflow: hidden;
}

/* ---------- Summary (riga cliccabile) ---------- */
.ewelink-open-the-door summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 52px;
  padding: .875rem var(--ewl-pad);
  background: var(--ewl-bg-head);
  font-weight: 600;
  font-size: 1.0625rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.ewelink-open-the-door summary::-webkit-details-marker { display: none; }
.ewelink-open-the-door summary::marker { content: ""; }

/* chevron */
.ewelink-open-the-door summary::after {
  content: "";
  flex: 0 0 auto;
  width: .5rem;
  height: .5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .18s ease;
}
.ewelink-open-the-door details[open] > summary::after {
  transform: rotate(-135deg);
}
.ewelink-open-the-door details[open] > summary {
  border-bottom: 1px solid var(--ewl-border);
}

/* focus tastiera */
.ewelink-open-the-door summary:focus-visible {
  outline: 3px solid var(--ewl-focus);
  outline-offset: -3px;
}

/* ---------- Contenuto interno ---------- */
.ewelink-open-the-door details > *:not(summary) {
  margin-inline: var(--ewl-pad);
}

.ewelink-open-the-door details > p,
.ewelink-open-the-door details > .form-item {
  margin-block: .875rem .75rem;
}

.ewelink-open-the-door details > .description {
  color: var(--ewl-muted);
  font-size: .9375rem;
}

/* ---------- Form item / label ---------- */
.ewelink-open-the-door .form-item {
  display: block;
}
.ewelink-open-the-door label {
  display: block;
  margin-bottom: .375rem;
  font-weight: 600;
}
.ewelink-open-the-door .description {
  margin-top: .375rem;
  color: var(--ewl-muted);
  font-size: .875rem;
}

/* ---------- Input PIN ---------- */
.ewelink-open-the-door .form-text {
  display: block;
  width: 100%;
  max-width: 12rem;
  min-height: 48px;
  padding: .75rem 1rem;
  font: inherit;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .35em;
  text-indent: .35em;          /* compensa il letter-spacing finale */
  text-align: center;
  color: inherit;
  background: #fff;
  border: 1px solid var(--ewl-border);
  border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ewelink-open-the-door .form-text:focus {
  outline: none;
  border-color: var(--ewl-accent);
  box-shadow: 0 0 0 3px rgba(11, 99, 206, .25);
}
.ewelink-open-the-door .form-text:focus-visible {
  outline: 3px solid var(--ewl-focus);
  outline-offset: 2px;
}

/* ---------- Pulsanti ---------- */
.ewelink-open-the-door input[type="submit"],
.ewelink-open-the-door .button {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: calc(100% - 2 * var(--ewl-pad));  /* margini inclusi */
  min-height: 48px;
  margin: .25rem var(--ewl-pad) 1rem;
  padding: .875rem 1.25rem;
  font: inherit;
  font-weight: 600;
  text-align: center;
  color: #fff;
  background: var(--ewl-accent);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .15s ease, transform .08s ease;
}
@media (hover: hover) {
  .ewelink-open-the-door input[type="submit"]:hover,
  .ewelink-open-the-door .button:hover {
    background: var(--ewl-accent-hover);
  }
}
.ewelink-open-the-door input[type="submit"]:active,
.ewelink-open-the-door .button:active {
  transform: translateY(1px);
}
.ewelink-open-the-door input[type="submit"]:focus-visible,
.ewelink-open-the-door .button:focus-visible {
  outline: 3px solid var(--ewl-focus);
  outline-offset: 2px;
}

/* ---------- Schermi stretti ---------- */
@media (max-width: 420px) {
  .ewelink-open-the-door { --ewl-pad: .75rem; }
  .ewelink-open-the-door summary { font-size: 1rem; }
}

/* ---------- Rispetto delle preferenze utente ---------- */
@media (prefers-reduced-motion: reduce) {
  .ewelink-open-the-door *,
  .ewelink-open-the-door *::before,
  .ewelink-open-the-door *::after {
    transition: none !important;
    animation: none !important;
  }
}
