/**
* 2007-2025 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author    PrestaShop SA <contact@prestashop.com>
*  @copyright 2007-2025 PrestaShop SA
*  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*
* Don't forget to prefix your containers with your own identifier
* to avoid any conflicts with others containers.
*/

/* Nasconde il campo "Customer" inutile nella form indirizzo FO */
.form-group.row.id_customer,
.form-group.row.customer,
.form-group.row.id-customer,
.form-group.row.customer_id,
.form-group.row.idcustomer {
  display: none !important;
}

/* === AGECHECK (B2C) === */
.di-agecheck .di-agecheck-card {
  margin: 16px 0;
}
.di-agecheck .di-agecheck-qr-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 8px 0 12px;
}
.di-agecheck .di-agecheck-qr {
  width: 180px;
  height: 180px;
  background: #fff;
  border: 1px solid #eee;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.di-agecheck .di-agecheck-qr-status {
  font-size: 12px;
  color: #666;
  margin: 6px 0 0;
  word-break: break-word;
}
.di-agecheck .di-agecheck-qr-attempts {
  margin: 4px 0 0 16px;
  padding: 0;
  font-size: 12px;
}
.di-agecheck .di-agecheck-qr-attempts li {
  margin: 0 0 2px 0;
}
.di-agecheck .di-agecheck-qr-attempts a {
  color: #666;
  text-decoration: underline;
}
.di-agecheck .di-agecheck-qr img,
.di-agecheck .di-agecheck-qr canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.di-agecheck .di-agecheck-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.di-agecheck .di-agecheck-back {
  text-decoration: none;
}
.di-agecheck .di-agecheck-linkbox input {
  font-size: 12px;
}
.di-agecheck .di-agecheck-copy-status {
  margin-left: 8px;
  font-size: 12px;
  color: #28a745;
}
.di-agecheck--mobile .btn-block {
  width: 100%;
}

/* === REGISTRAZIONE (B2B/B2C) — UI polish === */
/* Campi auto-compilati/disabilitati: mantieni leggibilità (alcuni temi applicano opacity bassa) */
#customer-form input[disabled],
#customer-form select[disabled],
#customer-form textarea[disabled],
#customer-form input[readonly],
#customer-form select[readonly],
#customer-form textarea[readonly] {
  opacity: 1 !important;
  background-color: #f3f4f6 !important;
  color: #444 !important;
  cursor: not-allowed;
}

/* Campi precompilati (OpenAPI o modal): grigio leggero ma EDITABILI */
#customer-form .di-prefilled {
  background-color: #f3f4f6 !important;
  color: #444 !important;
}

/* Righe campi custom del modulo: spacing più coerente */
#customer-form .form-group.row.piva,
#customer-form .form-group.row.denominazione,
#customer-form .form-group.row.codice_destinatario,
#customer-form .form-group.row.indirizzo,
#customer-form .form-group.row.cap,
#customer-form .form-group.row.provincia,
#customer-form .form-group.row.comune,
#customer-form .form-group.row.iso_country,
#customer-form .form-group.row.extra_country {
  margin-bottom: 0.85rem;
}

/* Selettore tipo registrazione (se presente nel tema) */
#registration-type-selector {
  margin: 0 0 1rem 0;
  padding: 0.75rem 0.75rem;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 8px;
  background: #fff;
}
#registration-type-selector .btn,
#registration-type-selector button {
  min-width: 220px;
}

/* Bottone/tab che mostra il tipo scelto */
#txt_tipo {
  margin: 0.25rem 0 0.75rem 0;
}
#txt_tipo_btn {
  white-space: normal;
  line-height: 1.2;
}

/* Messaggio rivenditore/contatti (se presente) */
#txt_comp,
#txt_contatti {
  margin: 0.75rem 0 0 0;
  font-size: 0.95rem;
  color: #444;
  text-align: center;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

/* Footer registrazione: centra anche il bottone SALVA (alcuni temi lo flottano a sinistra) */
#customer-form #registration-form-footer .form-control-submit,
#customer-form .form-footer .form-control-submit {
  float: none !important;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-left: auto !important;
  margin-right: auto !important;
  min-width: 180px;
}

/* Footer registrazione: centra DAVVERO il blocco (tema con colonne non bilanciate) */
#customer-form #registration-form-footer.form-footer.row {
  justify-content: center;
}
#customer-form #registration-form-footer.form-footer.row > .col-lg-3 {
  display: none;
}
#customer-form #registration-form-footer.form-footer.row > .col-lg-6 {
  flex: 0 1 720px;
  max-width: 720px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* Forza centratura reale del contenuto dentro la colonna footer (testo + bottone) */
#customer-form #registration-form-footer.form-footer.row > .col-lg-6 {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center !important;
}
#customer-form #registration-form-footer #txt_contatti {
  width: 100%;
  max-width: 720px;
  text-align: center !important;
}
#customer-form #registration-form-footer #txt_contatti a {
  display: inline-block;
}

/* reCAPTCHA: evita overflow su mobile */
.g-recaptcha {
  max-width: 100%;
  overflow: hidden;
}
@media (max-width: 380px) {
  .g-recaptcha {
    transform: scale(0.92);
    transform-origin: 0 0;
  }
}

/* === Modal guidato B2B (OpenAPI) === */
.di-b2b-modal {
  display: none;
}
.di-b2b-modal.is-open {
  display: block;
}
.di-b2b-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 100000;
  cursor: default;
}
.di-b2b-modal__dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 520px);
  background: #fff;
  border-radius: 12px;
  padding: 18px 18px 16px;
  z-index: 100001;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.di-b2b-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: #444;
}
.di-b2b-modal__title {
  margin: 0 28px 8px 0;
  font-size: 1.25rem;
}
.di-b2b-modal__desc {
  margin: 0 0 12px 0;
  color: #555;
  font-size: 0.95rem;
}
.di-b2b-modal__fields {
  display: grid;
  gap: 8px;
}
.di-b2b-modal__label {
  font-size: 0.9rem;
  color: #333;
  margin-top: 6px;
}
.di-b2b-modal__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 8px;
}

/* Phone badge (country + calling code) */
.di-b2b-modal__phone-wrap {
  position: relative;
}
.di-b2b-modal__phone-badge {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid rgba(0,0,0,0.12);
  color: #333;
  font-size: 12px;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
.di-b2b-modal__phone-input {
  padding-left: 92px; /* spazio per badge */
}
.di-b2b-modal__hint {
  font-size: 0.82rem;
  color: #666;
  margin-top: 2px;
}
.di-b2b-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}
.di-b2b-modal__error {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fdecea;
  color: #7a1b1b;
  font-size: 0.9rem;
}

/* blocca scroll pagina quando modal aperto */
html.di-b2b-modal-open,
html.di-b2b-modal-open body {
  overflow: hidden !important;
}
