/* registration-page.css
 * Stili della pagina /registrazione (form di registrazione cliente)
 * Separato dal CSS globale (style-v12.css) per isolare la complessità
 * del form dal layout del sito.
 */

/* === Sezione principale === */
.registration-section {
  padding: 3rem 1rem 4rem;
  min-height: 60vh;
}

.registration-intro {
  max-width: 880px;
  margin: 0 auto 2rem;
  text-align: center;
}

.registration-title {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  color: #1a2b4a;
  margin: 0 0 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.registration-title .fas {
  color: #FFD700;
  background: #1a2b4a;
  border-radius: 50%;
  width: 2.4rem;
  height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.registration-subtitle {
  font-family: 'Lato', sans-serif;
  font-size: 1.05rem;
  color: #2a2f3a;
  margin: 0;
  line-height: 1.5;
}

.required-mark {
  color: #d62828;
  font-weight: 700;
}

/* === Banner di stato (successo / errore) === */
.registration-banner {
  max-width: 880px;
  margin: 0 auto 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  line-height: 1.45;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.registration-banner .fas {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.registration-banner--ok {
  background: #e7f6ec;
  border: 1px solid #1e7a3a;
  color: #0f4d22;
}

.registration-banner--ok .fas { color: #1e7a3a; }

.registration-banner--err {
  background: #fdecec;
  border: 1px solid #b00020;
  color: #7a0014;
}

.registration-banner--err .fas { color: #b00020; }

/* === Form === */
.registration-form {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* === Card di sezione === */
/* Card pulita con bordo sottile e ombra morbida.
   L'header al suo interno ha il gradient scuro: grazie a overflow:hidden
   il header rispetta gli angoli arrotondati della card. */
.reg-card {
  background: #ffffff;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow:
    0 4px 16px rgba(13, 31, 58, 0.10),
    0 0 0 1px rgba(13, 31, 58, 0.08);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.reg-card:hover {
  box-shadow:
    0 8px 24px rgba(13, 31, 58, 0.14),
    0 0 0 1px rgba(13, 31, 58, 0.12);
}

/* === Header della card (intestazione sezione) === */
.reg-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 1.1rem 1.5rem;
  background: linear-gradient(135deg, #0d1f3a 0%, #1a2b4a 60%, #243456 100%);
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(255, 215, 0, 0.25);
  position: relative;
}

/* Piccolo accent decorativo in alto a destra dell'header */
.reg-header::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 215, 0, 0.08) 100%);
  pointer-events: none;
}

/* Alias per compatibilità: se mai ci fossero ancora .reg-legend usate altrove */
.reg-legend {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 1.1rem 1.5rem;
  background: linear-gradient(135deg, #0d1f3a 0%, #1a2b4a 100%);
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  box-sizing: border-box;
}

.reg-legend-icon {
  width: 2.2rem;
  height: 2.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #FFD700;
  color: #0d1f3a;
  font-size: 1rem;
  flex-shrink: 0;
}

.reg-legend-text {
  letter-spacing: 0.01em;
}

/* === Grid dei campi === */
.reg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem 1.25rem;
  padding: 1.5rem;
}

.reg-field--full {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .reg-grid {
    grid-template-columns: 1fr;
    padding: 1.1rem;
  }
}

/* === Singolo campo === */
.reg-field {
  display: flex;
  flex-direction: column;
  font-family: 'Lato', sans-serif;
}

.reg-field label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a2b4a;
  margin-bottom: 0.4rem;
  letter-spacing: 0.005em;
}

/* === Input wrapper con icona === */
.reg-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.reg-input-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7790;
  font-size: 0.95rem;
  pointer-events: none;
  transition: color 0.2s ease;
}

.reg-input-icon--top {
  top: 0.85rem;
  transform: none;
}

.reg-input-wrap input,
.reg-input-wrap textarea {
  width: 100%;
  padding: 0.7rem 0.9rem 0.7rem 2.6rem;
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  color: #1a2b4a;
  background: #f8fafc;
  border: 1.5px solid #d8dce3;
  border-radius: 0.5rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-sizing: border-box;
}

.reg-input-wrap textarea {
  resize: vertical;
  min-height: 5.5rem;
  line-height: 1.5;
  padding-top: 0.7rem;
}

.reg-input-wrap input::placeholder,
.reg-input-wrap textarea::placeholder {
  color: #9aa3b5;
  font-style: italic;
}

.reg-input-wrap input:hover,
.reg-input-wrap textarea:hover {
  border-color: #b8c1d3;
  background: #ffffff;
}

.reg-input-wrap input:focus,
.reg-input-wrap textarea:focus {
  border-color: #FFD700;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.25);
}

.reg-input-wrap input:focus + .reg-input-icon,
.reg-input-wrap input:focus ~ .reg-input-icon,
.reg-input-wrap:focus-within .reg-input-icon {
  color: #1a2b4a;
}

/* === Stato di errore === */
.reg-field.has-error .reg-input-wrap input,
.reg-field.has-error .reg-input-wrap textarea {
  border-color: #b00020;
  background: #fff5f5;
}

.reg-field.has-error .reg-input-wrap input:focus,
.reg-field.has-error .reg-input-wrap textarea:focus {
  box-shadow: 0 0 0 3px rgba(176, 0, 32, 0.18);
}

.reg-error {
  display: block;
  min-height: 1.1rem;
  margin-top: 0.3rem;
  font-size: 0.85rem;
  color: #b00020;
  font-weight: 600;
  line-height: 1.2;
}

.reg-error:not(:empty) {
  padding-left: 0.1rem;
}

.reg-hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.82rem;
  color: #6b7790;
  font-style: italic;
}

.reg-hint code {
  background: #f5f7fb;
  border: 1px solid #e3e6ec;
  border-radius: 0.25rem;
  padding: 0 0.35rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.92em;
  color: #1a2b4a;
}

/* === Checkbox privacy === */
.reg-privacy {
  background: #ffffff;
  border: 1.5px solid #e3e6ec;
  border-radius: 0.85rem;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.reg-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  cursor: pointer;
  font-family: 'Lato', sans-serif;
  font-size: 0.98rem;
  color: #2a2f3a;
  line-height: 1.45;
}

.reg-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.reg-checkbox-mark {
  width: 1.4rem;
  height: 1.4rem;
  min-width: 1.4rem;
  border: 1.5px solid #b8c1d3;
  border-radius: 0.35rem;
  background: #f8fafc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.2s ease;
  margin-top: 1px;
}

.reg-checkbox input[type="checkbox"]:checked + .reg-checkbox-mark {
  background: #FFD700;
  border-color: #1a2b4a;
}

.reg-checkbox input[type="checkbox"]:checked + .reg-checkbox-mark::after {
  content: "";
  width: 0.45rem;
  height: 0.85rem;
  border: solid #1a2b4a;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.reg-checkbox input[type="checkbox"]:focus-visible + .reg-checkbox-mark {
  outline: 2px solid #FFD700;
  outline-offset: 2px;
}

.reg-checkbox-text a {
  color: #005fb2;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.reg-checkbox-text a:hover {
  color: #1a2b4a;
}

.reg-privacy.has-error {
  border-color: #b00020;
  background: #fff5f5;
}

/* === Bottone submit === */
.reg-submit {
  text-align: center;
  margin-top: 0.5rem;
}

.reg-submit-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-width: 260px;
  padding: 0.95rem 2rem;
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0d1f3a;
  background: linear-gradient(135deg, #FFD700 0%, #ffb700 100%);
  border: 2px solid #0d1f3a;
  border-radius: 0.7rem;
  cursor: pointer;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 12px rgba(13, 31, 58, 0.15);
  transition: transform 0.1s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.reg-submit-btn:hover {
  background: linear-gradient(135deg, #0d1f3a 0%, #1a2b4a 100%);
  color: #FFD700;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(13, 31, 58, 0.25);
}

.reg-submit-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(13, 31, 58, 0.2);
}

.reg-submit-btn:focus-visible {
  outline: 3px solid #FFD700;
  outline-offset: 3px;
}

.reg-submit-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
}

.reg-submit-btn[disabled]:hover {
  background: linear-gradient(135deg, #FFD700 0%, #ffb700 100%);
  color: #0d1f3a;
}

/* === Responsive === */
@media (max-width: 768px) {
  .registration-section {
    padding: 2rem 0.8rem 3rem;
  }
  .reg-header,
  .reg-legend {
    padding: 0.9rem 1.1rem;
    font-size: 1.05rem;
  }
  .reg-legend-icon {
    width: 1.9rem;
    height: 1.9rem;
    font-size: 0.9rem;
  }
  .reg-submit-btn {
    min-width: 100%;
  }
  .registration-banner {
    margin-left: 0.4rem;
    margin-right: 0.4rem;
  }
}

@media (max-width: 480px) {
  .registration-title {
    flex-direction: column;
    gap: 0.4rem;
  }
  .reg-checkbox {
    font-size: 0.92rem;
  }
}

/* === Animazioni personalizzate per la pagina === */
@keyframes regCardGlow {
  0%   { box-shadow: 0 4px 16px rgba(13, 31, 58, 0.08); }
  50%  { box-shadow: 0 6px 22px rgba(255, 215, 0, 0.15); }
  100% { box-shadow: 0 4px 16px rgba(13, 31, 58, 0.08); }
}

.reg-card:focus-within {
  animation: regCardGlow 1.2s ease;
}

/* === Accessibilità: prefers-reduced-motion === */
@media (prefers-reduced-motion: reduce) {
  .reg-card,
  .reg-submit-btn,
  .reg-input-wrap input,
  .reg-input-wrap textarea,
  .reg-checkbox-mark {
    transition: none !important;
  }
  .reg-card:focus-within {
    animation: none;
  }
}

/* === Stampa === */
@media print {
  .header,
  .hamburger,
  .dark-footer,
  .reg-submit,
  .reg-privacy {
    display: none !important;
  }
  .reg-card {
    box-shadow: none;
    border: 1px solid #1a2b4a;
    page-break-inside: avoid;
  }
  .reg-header,
  .reg-legend {
    background: none !important;
    color: #1a2b4a !important;
    border-bottom: 2px solid #1a2b4a;
    border-radius: 0;
  }
  .reg-header::after { display: none; }
  .reg-legend-icon {
    background: none;
    color: #1a2b4a;
  }
}
