/* ============================================================
   WIRITALY - Contratto Modal Styles
   File: contratto_style.css
   ============================================================ */

.wir-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.wir-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 700px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  position: relative;
  animation: wirFadeIn 0.25s ease;
}

@keyframes wirFadeIn {
  from { opacity:0; transform: translateY(20px); }
  to   { opacity:1; transform: translateY(0); }
}

/* Header */
.wir-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.5rem 0.8rem;
  border-bottom: 1px solid #e9ecef;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
  border-radius: 16px 16px 0 0;
}

.wir-logo {
  height: 40px;
  object-fit: contain;
}

.wir-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #6c757d;
  line-height: 1;
  padding: 0 4px;
  transition: color 0.2s;
}
.wir-close:hover { color: #dc3545; }

/* Progress bar */
.wir-progress {
  display: flex;
  padding: 0.8rem 1.5rem;
  gap: 0.3rem;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  overflow-x: auto;
}

.wir-step {
  flex: 1;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 500;
  color: #adb5bd;
  padding: 0.35rem 0.2rem;
  border-radius: 6px;
  white-space: nowrap;
  min-width: 80px;
  transition: all 0.3s;
}

.wir-step.active {
  background: #0d6efd;
  color: #fff;
  font-weight: 700;
}

.wir-step.done {
  background: #198754;
  color: #fff;
}

/* Pacchetto banner */
.wir-pacchetto-banner {
  background: linear-gradient(135deg, #0d6efd, #0a58ca);
  color: #fff;
  padding: 0.7rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Step content */
.wir-step-content {
  padding: 1.5rem;
}

.wir-step-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #212529;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #0d6efd;
}

.wir-divider {
  border: none;
  border-top: 1px solid #dee2e6;
  margin: 1.5rem 0 1rem;
}

.wir-hint {
  font-size: 0.85rem;
  color: #6c757d;
  margin-bottom: 1rem;
  font-style: italic;
}

/* Grid layouts */
.wir-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.wir-grid-3 {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1rem;
}

.wir-span-2 { grid-column: span 2; }

@media (max-width: 600px) {
  .wir-grid-2,
  .wir-grid-3 { grid-template-columns: 1fr; }
  .wir-span-2 { grid-column: span 1; }
}

/* Form fields */
.wir-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.2rem;
}

.wir-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #495057;
}

.wir-field input,
.wir-field select {
  border: 1.5px solid #ced4da;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

.wir-field input:focus,
.wir-field select:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13,110,253,0.12);
}

.wir-field input.wir-error {
  border-color: #dc3545;
}

/* Checkboxes / Radio */
.wir-checkboxes {
  grid-template-columns: 1fr 1fr 1fr !important;
  margin-top: 0.5rem;
}

@media (max-width: 600px) {
  .wir-checkboxes { grid-template-columns: 1fr !important; }
}

.wir-field-check {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.wir-field-check > label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #495057;
}

.wir-radio-group {
  display: flex;
  gap: 1rem;
}

.wir-radio-group label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Privacy checkboxes */
.wir-privacy {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.wir-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #495057;
  cursor: pointer;
  line-height: 1.4;
}

.wir-checkbox-label input { 
  margin-top: 3px;
  flex-shrink: 0;
  width: auto;
}

/* Info box */
.wir-info-box {
  background: #e7f3ff;
  border: 1px solid #b8d4f8;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-size: 0.88rem;
  color: #0d4c9e;
  margin-bottom: 1rem;
}

/* Navigation buttons */
.wir-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e9ecef;
}

.wir-nav-center {
  justify-content: center;
  gap: 1rem;
}

.wir-btn-back {
  background: #6c757d;
  color: #fff;
  border: none;
  padding: 0.6rem 1.3rem;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}
.wir-btn-back:hover { background: #5c636a; }

.wir-btn-next {
  background: #0d6efd;
  color: #fff;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.wir-btn-next:hover { background: #0b5ed7; }

.wir-btn-submit {
  background: #198754;
  color: #fff;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.wir-btn-submit:hover { background: #157347; }
.wir-btn-submit:disabled {
  background: #adb5bd;
  cursor: not-allowed;
}

/* OTP */
.wir-otp-container {
  text-align: center;
  padding: 1rem 0;
}

.wir-otp-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.wir-otp-input-wrap {
  margin: 1.5rem auto;
  max-width: 200px;
}

.wir-otp-input {
  border: 2px solid #0d6efd;
  border-radius: 12px;
  padding: 0.8rem 1rem;
  font-size: 2rem;
  text-align: center;
  letter-spacing: 0.5rem;
  width: 100%;
  box-sizing: border-box;
  outline: none;
}

.wir-otp-input:focus {
  box-shadow: 0 0 0 4px rgba(13,110,253,0.2);
}

.wir-otp-error {
  color: #dc3545;
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.wir-btn-otp-resend {
  background: none;
  border: none;
  color: #0d6efd;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 0.5rem;
}

/* Success */
.wir-success-container {
  text-align: center;
  padding: 2rem 1rem;
}

.wir-success-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.wir-success-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #198754;
  margin-bottom: 0.75rem;
}

.wir-success-info {
  background: #f0fff4;
  border: 1px solid #a3d9b1;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem auto;
  max-width: 400px;
  font-size: 0.9rem;
  color: #145a32;
}

.wir-btn-chiudi-success {
  background: #0d6efd;
  color: #fff;
  border: none;
  padding: 0.7rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: background 0.2s;
}
.wir-btn-chiudi-success:hover { background: #0b5ed7; }

/* Loading */
.wir-loading {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  z-index: 20;
}

.wir-spinner {
  width: 48px;
  height: 48px;
  border: 5px solid #dee2e6;
  border-top-color: #0d6efd;
  border-radius: 50%;
  animation: wirSpin 0.8s linear infinite;
  margin-bottom: 1rem;
}

@keyframes wirSpin {
  to { transform: rotate(360deg); }
}

.wir-loading p {
  color: #495057;
  font-weight: 600;
  font-size: 1rem;
}

/* Button "Attiva Ora" nella pagina principale */
#wirBtnAttivaOra {
  display: inline-block;
  background: linear-gradient(135deg, #198754, #0d6efd);
  color: #fff;
  border: none;
  padding: 0.85rem 2.5rem;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(13,110,253,0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

#wirBtnAttivaOra:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(13,110,253,0.4);
}
