/* === RESET === */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: Arial, sans-serif;
  line-height: 1.5;
  color: #333;
  background: #f9fafc;
}

/* === FORM CONTAINER === */
.form-container {
  background: #fff;
  border: 1.5px solid #e2e8ef;
  border-radius: 13px;
  max-width: 720px;
  margin: 2.5rem auto;
  box-shadow: 0 4px 16px rgba(98,165,111,0.09);
  padding: 2.2rem 1.1rem 2rem;
  font-family: inherit;
}
.form-container h2 {
  color: #206140;
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 2rem;
  letter-spacing: 0.03em;
}

/* === FORM GROUPS E LABELS === */
.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
}
.form-group label {
  margin-bottom: 0.35em;
  color: #206140;
  font-weight: 600;
  font-size: 1.05em;
}

/* === UNIFIED SWITCH / SLIDER === */
.switch-label, .consent-switch-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 600;
  color: #206140;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.switch, .consent-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}
.switch input, .consent-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider, .consent-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}
.slider:before, .consent-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider,
input:checked + .consent-slider {
  background-color: #4eb378;
}
input:checked + .slider:before,
input:checked + .consent-slider:before {
  transform: translateX(26px);
}
.switch input:checked + .slider:before,
.consent-switch input:checked + .consent-slider:before {
  transform: translateX(26px);
}
.consent-text {
  flex: 1;
  font-size: 0.9rem;
  color: #495057;
  line-height: 1.4;
}
.privacy-link {
  color: #4eb378;
  text-decoration: underline;
  cursor: pointer;
}
.privacy-link:hover {
  color: #206140;
}
.submit-disabled {
  opacity: 0.6;
  cursor: not-allowed !important;
  pointer-events: none;
}

/* === MODAL INFORMATIVA PRIVACY === */
.privacy-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
}
.privacy-modal-content {
  background-color: #fefefe;
  margin: 3% auto;
  padding: 0;
  border-radius: 10px;
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}
.privacy-modal-header {
  background: #4eb378;
  color: white;
  padding: 1.5rem;
  border-radius: 10px 10px 0 0;
}
.privacy-modal-header h3 {
  margin: 0;
  font-size: 1.3rem;
}
.privacy-modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  color: white;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
}
.privacy-modal-close:hover {
  opacity: 0.7;
}
.privacy-modal-body {
  padding: 2rem;
  line-height: 1.6;
  color: #333;
}
.privacy-modal-body h4 {
  color: #4eb378;
  margin-top: 2rem;
  margin-bottom: 1rem;
}
.privacy-modal-body p {
  margin-bottom: 1rem;
}
.privacy-modal-body ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}
.privacy-modal-body li {
  margin-bottom: 0.5rem;
}
.privacy-modal-footer {
  padding: 1.5rem;
  text-align: center;
  border-top: 1px solid #dee2e6;
}
.btn-accept {
  background: #4eb378;
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
}
.btn-accept:hover {
  background: #206140;
}

/* === BOTTONI === */
.btn-submit {
  background: linear-gradient(90deg,#206140 60%,#4eb378 100%);
  color: white;
  border: none;
  padding: 0.88rem 2.5rem;
  border-radius: 10px;
  font-size: 1.17rem;
  font-weight:600;
  box-shadow: 0 6px 18px rgba(98,165,111,0.07);
  letter-spacing: 0.01em;
  transition: background 0.18s;
  margin: 0 auto;
  display: block;
}
.btn-submit:hover, .btn-submit:focus {
  background: linear-gradient(90deg,#62a56f 60%,#4eb378 100%);
  color: #fff;
}

/* === ALTRE UTILITY E RESPONSIVE === */
input[type="text"],
input[type="file"],
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  border: 1px solid #c7e3d1;
  border-radius: 7px;
  background: #f7fbf9;
  color: #333;
  margin-bottom: 0.3rem;
  transition: border-color 0.18s;
}
input[type="text"]:read-only {
  background: #e6efea;
}
input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: #4eb378;
  background: #f2faf3;
}
textarea {
  resize: vertical;
  min-height: 80px;
  max-height: 230px;
}

.photo-label-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  background: #f2faf3;
  color: #4eb378;
  border: 1px solid #bde5ce;
  border-radius: 5px;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
  font-size: 1em;
  transition: background 0.16s;
}
.icon-btn:hover,
.icon-btn:focus {
  background: #daf6e4;
  color: #206140;
  border-color: #4eb378;
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* === GEO MODAL BLOCK === */
.geo-modal-block {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(50,91,72,0.16);
  align-items: center;
  justify-content: center;
}
.geo-modal-content {
  background: #fff;
  padding: 2.1rem 1.45rem;
  border-radius: 11px;
  box-shadow: 0 4px 28px rgba(80,138,112,0.14);
  width: 92vw;
  max-width: 370px;
  position: relative;
  text-align: center;
}
.geo-wait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}
.loader {
  border: 4px solid #e0f3ea;
  border-top: 4px solid #4eb378;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  animation: spin 1s linear infinite;
  margin-bottom: 0.5rem;
}
@keyframes spin {
  0% { transform: rotate(0deg);}
  100% { transform: rotate(360deg);}
}
.geo-fail-msg {
  margin-top: 1.2rem;
}
.geo-fail-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.3rem;
}
.btn-modal {
  background: #62a56f;
  color: #fff;
  border: none;
  padding: 0.75rem 1.1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
  display: inline-block;
  transition: background 0.16s;
}
.btn-modal:hover, .btn-modal:focus {
  background: #206140;
}
.btn-light {
  background: #e6efea;
  color: #206140;
  border: 1px solid #4eb378;
  font-weight: 600;
}

/* === RESPONSIVE SWITCH === */
@media (max-width: 768px) {
  .consent-switch-group, .switch-label {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .form-container {
    padding: 1rem 0.15rem 1.8rem;
  }
  .privacy-modal-content {
    margin: 5% auto;
    width: 98%;
  }
}

@media (max-width: 550px) {
  .form-container {
    border: none;
    margin: 0.5rem;
    border-radius: 5px;
    box-shadow: none;
    padding: 0.5rem 0rem 1.4rem;
  }
  .privacy-modal-body {
    padding: 1.1rem;
  }
  .geo-modal-content {
    padding: 1.1rem 0.5rem;
    min-width: unset;
  }
}
/* === ICONA UPLOAD FOTO === */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eaf2fb;
  border: 2px solid #b5c1d1;
  border-radius: 50%;
  width: 54px;
  height: 54px;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s;
  box-shadow: 0 3px 12px rgba(32,97,64,0.09);
}
.icon-btn:hover,
.icon-btn:focus {
  background: #f5f5f5;
  border-color: #62a56f;
}
.icon-btn:active {
  background: #eef9ef;
}
#photoIconSvg svg {
  width: 32px;
  height: 32px;
  display: block;
}
.visually-hidden {
  position: absolute;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
}
input[type="file"] {
  display: none;
}
/* END */