/* ==========================================
   1. RESET & BASE
   ========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: white;
  font-family: "Noto Sans", sans-serif;
  color: black;
    overflow-x: hidden;
}

/* ==========================================
   2. NAVIGAZIONE E FOOTER
   ========================================== */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 48px;
  background-color: #ffffff;
  opacity: 1;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  z-index: 100;
}

.header-container {
  width: 100%;
  height: 48px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
    gap: 25px;
}

.lang-dropdown {
  position: relative;
  display: inline-block;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 6px 10px;
  font-family: "Noto Sans", sans-serif;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: background 0.2s ease;
}

.lang-btn:hover {
  background: #f5f5f5;
}

.lang-menu {
  display: none;
  position: absolute;
  top: 120%;
  right: 0;
  background-color: white;
  min-width: 80px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  overflow: hidden;
  z-index: 101;
}

.lang-menu a {
  color: black;
  padding: 10px 15px;
  text-decoration: none;
  display: block;
  font-family: "Noto Sans", sans-serif;
  font-size: 14px;
  text-align: center;
  transition: background 0.2s ease;
}

.lang-menu a:hover {
  background-color: #f0f0f0;
}

.lang-dropdown.open .lang-menu {
  display: block;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-menu a {
  display: block;
  color: rgb(138, 140, 152);
  font-family: "Oswald", sans-serif;
  text-decoration: none;
  font-size: 16px;
  padding: 0 0 0 10px;
  line-height: 48px;
  white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu a:focus-visible {
  color: #46435B;
}

.nav-menu .active {
  color: #46435B;
}

.site-footer {
  width: 100%;
  background-color: #000000;
  padding: 14px 24px;
}

.footer-container {
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: #ffffff;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.813rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.footer-links a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ==========================================
   3. LAYOUT PRINCIPALE (CONTAINER & SEZIONI)
   ========================================== */
.form-container {
  width: 95%;
  max-width: 950px;
  min-height: 100vh;
  margin: 48px auto 0;
  display: flex;
  flex-direction: column;
  background-color: #ffd763;
  position: relative;
  padding: 90px 40px 24px;
  gap: 0;
}

.jeff-section {
  position: absolute;
  top: 7px;
  right: -10px;
  width: 55%;
  max-width: 760px;
  height: 100vh;
  min-width: 0;
  overflow: visible;
  flex: none;
  z-index: 2;
  pointer-events: none;
  transform: translateX(min(35%, max(0px, calc((100vw - 1100px)))))
}

.yellow-background {
  background: transparent;
  align-items: flex-start;
  justify-content: flex-end;
  height: 100%;
  border-radius: 0;
  position: relative;
  width: 100%;
  display: flex;
}

.full-jeff {
  position: relative;
  width: auto;
  height: 100%;
  max-height: none;
  display: block;
  object-fit: contain;
  transform: none;
  z-index: 2;
}

.form-section {
  flex: 1;
  display: flex;
}

.form-input-container {
  width: 100%;
}

.contact-section {
  margin-top: 120px;
  background-color: #ffffff;
  border-radius: 3rem;
  padding: 28px 24px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 3;
}

/* ==========================================
   3. INTESTAZIONE FORM (HEADER)
   ========================================== */
.form-header {
  display: flex;
  flex-direction: column;
  text-align: center;
  gap: 20px;
  margin-top: 0;
  margin-bottom: 28px;
}

.form-header h1 {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2.2rem, 1.6rem + 3vw, 3.25rem);
  line-height: 1.15;
  font-weight: 400;
}

.form-header p {
  font-size: clamp(1rem, 0.85rem + 1.2vw, 1.438rem);
  line-height: 1.4;
  font-weight: 400;
}

/* ==========================================
   4. STRUTTURA CAMPI & INPUT GENERALI
   ========================================== */
.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  /* Evita che i campi flex scompaginino la riga */
}

.message-group {
  margin-bottom: 1.5rem;
}

label {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.125rem;
  color: #111111;
  margin-bottom: 0.1rem;
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  background-color: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.2rem;
  padding: 0.75rem 0.875rem;
  font-family: inherit;
  font-size: 0.938rem;
  color: #111111;
  outline: none;
  transition: border-color 0.2s ease;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #a0aec0;
}

input:focus,
textarea:focus {
  border-color: #111111;
}

/* ==========================================
   5. COMPONENTE TELEFONO & PREFISSO (DROPDOWN)
   ========================================== */
.phone-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background-color: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.2rem;
  height: 46px;
  width: 100%;
  min-width: 0;
  /* Permette al wrapper di rimpicciolirsi senza sforare */
  transition: border-color 0.2s ease;
}

.phone-wrapper:hover,
.phone-wrapper:focus-within,
.phone-wrapper.is-active {
  border-color: #111111;
}

.country-dropdown-container {
  position: relative;
  height: 100%;
  flex-shrink: 0;
  /* Il prefisso mantiene sempre la sua larghezza fissa */
}

.country-select-btn {
  background-color: transparent;
  border: none;
  border-radius: 0.2rem 0 0 0.2rem;
  padding: 0 0.625rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: #111111;
  height: 100%;
}

.dropdown-arrow {
  transition: transform 0.25s ease;
}

.country-dropdown-container.open .dropdown-arrow {
  transform: rotate(180deg);
}

.country-options-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background-color: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  width: 170px;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  z-index: 100;
}

.country-dropdown-container.open .country-options-list {
  display: block;
}

.country-option {
  padding: 0.625rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.15s ease;
}

.country-option:hover {
  background-color: #f1f5f9;
}

.phone-wrapper input {
  flex: 1;
  min-width: 0;
  /* PERMETTE ALL'INPUT TELEFONO DI RIMRICCIOLIRSI */
  border: none;
  background: transparent;
  height: 100%;
  border-radius: 0 0.2rem 0.2rem 0;
  padding-left: 0.5rem;
  font-family: inherit;
  font-size: 0.938rem;
  color: #111111;
  outline: none;
}

/* ==========================================
   6. GESTIONE ERRORI & VALIDAZIONE
   ========================================== */
.error-text {
  color: #e53e3e;
  font-size: 0.75rem;
  margin-top: 0.375rem;
  display: none;
}

.input-group.has-error input,
.input-group.has-error .phone-wrapper {
  border-color: #e53e3e;
}

.input-group.has-error input:focus {
  border-color: #e53e3e;
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.input-group.has-error .error-text {
  display: block;
}

/* ==========================================
   7. BOTTONE INVIO (SUBMIT)
   ========================================== */
.submit-btn {
  font-family: "Bebas Neue", sans-serif;
  width: 100%;
  min-width: unset;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  margin-top: 20px;
  background-color: #000000;
  color: #ffffff;
  border: none;
  border-radius: 0.5rem;
  padding: 0 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  transition:
    transform 0.1s ease,
    background-color 0.2s ease;
}

.submit-btn:hover {
  background-color: #222222;
}

.submit-btn:active {
  transform: scale(0.98);
}

/* ==========================================
   8. MESSAGGI DI SISTEMA (FEEDBACK)
   ========================================== */
.form-feedback {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  text-align: center;
}

.form-feedback.success {
  background-color: #def7ec;
  color: #03543f;
}

.form-feedback.error {
  background-color: #fde8e8;
  color: #9b1c1c;
}

.form-feedback.hidden {
  display: none;
}




/* ==========================================
   MEDIA QUERIES (Sotto 850px - Jeff Section come Sfondo Assoluto)
   ========================================== */
@media (max-width: 850px) {
  .form-row {
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
  }

  .form-row-names {
    flex-direction: row;
    /* torna orizzontale */
    gap: 0.75rem;
    /* un po' più stretto, sono due campi piccoli */
  }
}

@media (max-width: 600px) {
  .site-footer {
    padding: 12px 16px;
  }

  .footer-links {
    gap: 16px;
  }

  .footer-links a {
    font-size: 0.75rem;
  }
}

@media (max-width: 500px) {
  .form-container {
    overflow: hidden;
  }
}

@media (max-width: 480px) {
  .form-row-names {
    flex-direction: column;
  }
}