/* ==========================================================================
   CONTACT FORM – BASISSTYLES
   --------------------------------------------------------------------------
   Ziel: Konsistente Grundgestaltung für Formular, Felder & Button.
   ========================================================================== */

/* .contact-form – Formularcontainer (halbtransparenter Hintergrund, Card-Optik) */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
  margin-top: 4vh;
  padding: 1.5em;
  display: flex;
  flex-direction: column;
  gap: 1em;
  box-sizing: border-box;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
}

/* .contact-form label – Block-Labels in Weiß */
.contact-form label {
  display: flex;
  flex-direction: column;
  font-size: 1em;
  color: #fff;
}

/* .contact-form input/select – Grundinputs (leicht transparent) */
.contact-form input,
.contact-form select {
  margin-top: 0.4em;
  padding: 0.6em 0.8em;
  font-size: 1em;
  border: none;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.7);
  color: #000;
  box-sizing: border-box;
}

/* .contact-form select – Cursor als Hinweis auf Dropdown */
.contact-form select {
  cursor: pointer;
}

/* Fokuszustände für Grundinputs */
.contact-form input:focus,
.contact-form select:focus {
  outline: 2px solid #3399ff;
}

/* .contact-form button – Basis für Schaltflächen */
.contact-form button {
  padding: 0.8em 1.2em;
  font-size: 1em;
  color: #fff;
  background-color: #005ea2;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease;
}

/* Hover-Effekt für Buttons */
.contact-form button:hover {
  background-color: #004080;
}

/* ==========================================================================
   ENHANCED FIELD LAYOUT – NEUTRALER, WIEDERVERWENDBARER Block
   ========================================================================== */

/* .contact-form-field – Ein Feldblock mit Label + Control */
.contact-form-field {
  margin-bottom: 1rem;
}

/* .contact-form-field label – Typografie & Abstand */
.contact-form-field label {
  display: block;
  margin-bottom: 0.5rem;
  color: #fff;
  font-weight: 500;
  font-size: 1em;
}

/* .contact-form-field input/select/textarea – Einheitliche Inputs */
.contact-form-field input,
.contact-form-field select,
.contact-form-field textarea {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  box-sizing: border-box;
  transition: background-color 0.3s ease, outline 0.3s ease;
}

/* .contact-form-field textarea – variable Höhe */
.contact-form-field textarea {
  resize: vertical;
  min-height: 100px;
}

/* Fokus: klare Outline & volle Deckkraft */
.contact-form-field input:focus,
.contact-form-field select:focus,
.contact-form-field textarea:focus {
  outline: 2px solid #3399ff;
  background-color: rgba(255, 255, 255, 1);
}

/* ==========================================================================
   OPTIONALE FELDER – Trigger (Link- oder Button-Stil ab JS konfiguriert)
   ========================================================================== */

/* .optional-fields-trigger – Wrapper für den Öffnen-Trigger */
.optional-fields-trigger { margin: 1rem 0; }

/* .optional-toggle – Standard (Link-Stil), per JS ggf. als Button gestylt */
.optional-fields-trigger .optional-toggle {
  background: none;
  border: none;
  color: #fff;
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.5rem 0;
  transition: color 0.3s ease;
}

/* Hoverfarbe für Link-Trigger */
.optional-fields-trigger .optional-toggle:hover { color: #3399ff; }

/* ==========================================================================
   SUBMIT-BUTTON – erweiterte Variante im Formularfluss
   ========================================================================== */

/* .submit-button – Primärer Sende-Button (volle Breite) */
.contact-form .submit-button {
  background-color: #005ea2;
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: 100%;
  margin-top: 1rem;
}

/* Hover-Effekt Submit */
.contact-form .submit-button:hover { background-color: #004080; }

/* Disabled-State Submit */
.contact-form .submit-button:disabled {
  background-color: #666;
  cursor: not-allowed;
  opacity: 0.7;
}

/* ==========================================================================
   FIXED-SIZE MODAL – für optionale Felder (kompakter, scrollbar)
   ========================================================================== */

/* .fixed-size-modal – Overlay & Ein-/Ausblend-Animation */
.fixed-size-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: modalFadeIn 0.2s ease forwards;
}

/* .modal-closing – Ausblend-Animation */
.fixed-size-modal.modal-closing { animation: modalFadeOut 0.2s ease forwards; }

/* .fixed-size-modal-content – Kartencontainer des Modals */
.fixed-size-modal-content {
  background: rgba(0, 0, 0, 0.9);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* .modal-header – Titelzeile mit Close */
.modal-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

/* .modal-title – Headline im Modal */
.modal-title {
  color: #fff;
  margin: 0;
  font-size: 1.2rem;
  font-weight: 500;
}

/* .modal-close-fixed – Close-Button (Icon) */
.modal-close-fixed {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

/* Hover-Effekt Close */
.modal-close-fixed:hover { background-color: rgba(255, 255, 255, 0.1); }

/* .modal-scrollable-content – Scrollbereich für Felder */
.modal-scrollable-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
  min-height: 0; /* wichtig für Flexbox */
}

/* Inputs im Modal – explizit hell mit schwarzem Text */
.modal-scrollable-content .contact-form-field input,
.modal-scrollable-content .contact-form-field select,
.modal-scrollable-content .contact-form-field textarea {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.95);
  color: #000 !important;
  font-size: 1rem;
  box-sizing: border-box;
  transition: background-color 0.3s ease, outline 0.3s ease;
}

/* Fokus im Modal */
.modal-scrollable-content .contact-form-field input:focus,
.modal-scrollable-content .contact-form-field select:focus,
.modal-scrollable-content .contact-form-field textarea:focus {
  outline: 2px solid #3399ff;
  background-color: rgba(255, 255, 255, 1);
  color: #000 !important;
}

/* Placeholder-Farbe im Modal */
.modal-scrollable-content .contact-form-field input::placeholder,
.modal-scrollable-content .contact-form-field textarea::placeholder {
  color: #666 !important;
  opacity: 0.7;
}

/* .modal-footer – Buttonbereich unten (Abbrechen/Speichern) */
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* .modal-cancel-button – sekundärer Flat-Button */
.modal-cancel-button {
  width: 100%;
  background-color: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

/* Hover Cancel */
.modal-cancel-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

/* .modal-save-button – primärer Call-to-Action im Modal */
.modal-save-button {
  width: 100%;
  background-color: #005ea2;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

/* Hover Save */
.modal-save-button:hover { background-color: #004080; }

/* Keyframes – Ein-/Ausblenden des Modals */
@keyframes modalFadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes modalFadeOut { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.95); } }

/* Scrollbar-Design im Modal */
.modal-scrollable-content::-webkit-scrollbar { width: 6px; }
.modal-scrollable-content::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }
.modal-scrollable-content::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.3); border-radius: 3px; }
.modal-scrollable-content::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.5); }

/* ==========================================================================
   VALIDATION & LOADING
   ========================================================================== */

/* .error – Fehlermarkierung an Inputs */
.contact-form-field input.error,
.contact-form-field select.error,
.contact-form-field textarea.error {
  border: 2px solid #ff4444;
  background-color: rgba(255, 68, 68, 0.1);
}

/* .contact-form.loading – Deaktiviert & Spinner am Button */
.contact-form.loading { opacity: 0.7; pointer-events: none; }
.contact-form.loading .submit-button { position: relative; }
.contact-form.loading .submit-button::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  margin: auto;
  border: 2px solid transparent;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 1s ease infinite;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
}
@keyframes spin { from { transform: translate(-50%, -50%) rotate(0deg);} to { transform: translate(-50%, -50%) rotate(360deg);} }

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* ≤768px – Mobiles Layout, Sticky-Button, iOS-Zoom-Fix */
@media (max-width: 768px) {
  /* .contact-form – kompakter & höhenoptimiert */
  .contact-form {
    padding: 1rem;
    margin-top: 2vh;
    min-height: calc(100vh - 20vh);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  /* .main-fields – kann schrumpfen (entscheidend für iOS Safari) */
  .contact-form .main-fields { flex: 1 1 auto; min-height: 0; }

  /* .submit-button – unten sticky (robust am Handy) */
  .contact-form .submit-button {
    margin-top: auto;
    position: sticky;
    bottom: 1rem;
    z-index: 10;
  }

  /* iOS: Verhindert Zoom bei Fokus */
  .contact-form-field input,
  .contact-form-field select,
  .contact-form-field textarea { font-size: 16px !important; }

  /* Modal: auf volle Viewportfläche (mit Rand) */
  .fixed-size-modal-content {
    margin: 1rem;
    width: calc(100% - 2rem) !important;
    height: calc(100% - 2rem) !important;
    max-height: calc(100% - 2rem) !important;
  }
}

/* 769–1024px – Tablet: etwas kleineres max-width */
@media (min-width: 769px) and (max-width: 1024px) {
  .contact-form { max-width: 500px; margin: 0 auto; padding: 1.5rem; }
}

/* ≥1025px – Desktop: großzügigere Polsterung + Hover-Helligkeit */
@media (min-width: 1025px) {
  .contact-form { max-width: 600px; margin: 0 auto; padding: 2rem; }
  .contact-form-field input:hover,
  .contact-form-field select:hover,
  .contact-form-field textarea:hover { background-color: rgba(255, 255, 255, 0.95); }
}

/* Bevorzugt: reduzierte Bewegung – Transitionen abschalten */
@media (prefers-reduced-motion: reduce) {
  .contact-form-field input,
  .contact-form-field select,
  .contact-form-field textarea,
  .optional-toggle,
  .submit-button { transition: none; }
}

/* Bevorzugt: hoher Kontrast – klarere Konturen */
@media (prefers-contrast: high) {
  .contact-form-field input,
  .contact-form-field select,
  .contact-form-field textarea { border: 2px solid #ffffff; }
}

/* Print – Modal & Trigger ausblenden, Hintergrund neutralisieren */
@media print {
  .fixed-size-modal, .optional-toggle { display: none; }
  .contact-form { background: transparent !important; }
}

/* ==========================================================================
   CONTACT SECTION – LAYOUT-OVERRIDES FÜR #contact (FullPage-Box)
   ========================================================================== */

/* .border-layout-container – graue Außenfläche zentriert & tiefer */
.section[data-anchor="contact"] .border-layout-container{
  top: 18vh;
  left: 10vw;
  width: 80vw;
  height: calc(100vh - 26vh); /* unten ~8vh Luft */
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* .border-layout-mid-content – Boxhöhe = Inhalt (ohne Zusatzboden) */
.section[data-anchor="contact"] .border-layout-mid-content{
  width: 100%;
  min-height: 0 !important;
  height: auto !important;
  padding-bottom: 0 !important;
}

/* Tablet-Feinjustage der Außenfläche */
@media (min-width: 768px) and (max-width: 1023px){
  .section[data-anchor="contact"] .border-layout-container{
    top: 16vh;
    left: 8vw;
    width: 84vw;
    height: calc(100vh - 24vh);
  }
}

/* Mobile – symmetrischer Rand oben/unten */
@media (max-width: 767px){
  .section[data-anchor="contact"] .border-layout-container{
    top: 12vh !important;
    height: calc(100vh - 24vh) !important;
    left: 6vw;
    width: 88vw;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* iOS/Safari – Button-Glitch & „alles muss in Viewport passen“ */
@supports (-webkit-touch-callout: none) {
  @media (max-width: 820px){
    /* Container oben ansetzen & Safe-Area berücksichtigen */
    .section[data-anchor="contact"] .border-layout-container{
      top: 10vh !important;
      bottom: calc(14vh + env(safe-area-inset-bottom, 0px)) !important;
      height: auto !important;
      align-items: flex-start !important; /* Button-Glitch vermeiden */
    }
    /* Formular nicht zusätzlich nach unten schieben */
    .section[data-anchor="contact"] .contact-form{ margin-top: 0 !important; }
    /* Kein Clipping auf iOS */
    .section[data-anchor="contact"] .border-layout-mid-content{ overflow: visible !important; }
    /* Submit statisch & mit Abstand */
    .section[data-anchor="contact"] .contact-form .submit-button,
    .section[data-anchor="contact"] .contact-form button[type="submit"]{
      position: static !important;
      margin-top: 1.25em;
    }
  }
}

/* Optionaler iOS-Sicherheitsmodus: statische Buttons & ruhiger Flow (≤768px) */
@media (max-width: 768px){
  .contact-form{ min-height: auto; }                 /* statt calc(...) */
  .contact-form .submit-button{ position: static; margin-top: 0.75rem; }
}

/* ==========================================================================
   CONTACT SECTION – VISUELLE ANPASSUNGEN (Scrim, Card, Inputs, CTA)
   ========================================================================== */

/* .textbox-black-half-transparent – Scrim vereinheitlicht */
.section[data-anchor="contact"] .textbox-black-half-transparent{
  background: rgba(10,14,20,0.58) !important;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  backdrop-filter: saturate(110%) blur(1.5px);
}

/* form – Innenkarte (Glass-Optik) */
.section[data-anchor="contact"] form{
  background: rgba(15,19,28,0.82);
  border: 1px solid rgba(255,255,255,0.065);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.28);
  padding: 1.2rem 1.2rem 1rem;
  max-width: 720px;
  margin: 2rem auto;
}

/* h1 – Titel mit feiner Akzentlinie unten */
.section[data-anchor="contact"] h1{
  margin: 0 0 .75rem 0;
  line-height: 1.15;
}
.section[data-anchor="contact"] h1.default-text-medium-lg::after{
  content:"";
  display:block;
  width: 64px; height: 3px;
  margin-top: .5rem; border-radius: 2px;
  background: linear-gradient(90deg,#60A5FA,#2563EB);
  opacity: .9;
}

/* h1::before – dezentes Glanz-Overlay */
.section[data-anchor="contact"] h1::before{
  content: none !important;
  position:absolute; inset:0; border-radius: 6px;
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
  mix-blend-mode: screen; pointer-events:none;
}

/* Labels in der Contact-Card */
.section[data-anchor="contact"] label{
  color: #E5E7EB; font-weight: 600; margin-bottom: .25rem; display:block;
}

/* Inputs/Select/Textarea in der Contact-Card */
.section[data-anchor="contact"] input[type="text"],
.section[data-anchor="contact"] input[type="email"],
.section[data-anchor="contact"] input[type="tel"],
.section[data-anchor="contact"] select,
.section[data-anchor="contact"] textarea{
  width: 100%;
  background: rgba(8,12,18,0.9);
  border: 1px solid rgba(255,255,255,0.10);
  color: #F3F4F6;
  border-radius: 10px;
  height: 46px;
  padding: .55rem .75rem;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

/* Textarea in der Contact-Card */
.section[data-anchor="contact"] textarea{ min-height: 120px; height: auto; }

/* Placeholder dezenter */
.section[data-anchor="contact"] ::placeholder{ color: #9CA3AF; }

/* Fokus in Brand-Blau */
.section[data-anchor="contact"] input:focus,
.section[data-anchor="contact"] select:focus,
.section[data-anchor="contact"] textarea:focus{
  border-color: #3B82F6;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.35);
}

/* Feldabstände in der Card */
.section[data-anchor="contact"] .form-row,
.section[data-anchor="contact"] .form-group{ margin-bottom: .75rem; }

/* Submit in der Card – gebrandet & mit Schatten */
.section[data-anchor="contact"] button[type="submit"],
.section[data-anchor="contact"] .btn-submit{
  width: 100%;
  background: linear-gradient(180deg,#3B82F6,#2563EB);
  border: 0;
  color: #fff;
  font-weight: 700;
  border-radius: 10px;
  height: 46px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(37,99,235,0.35);
}

/* Hover-Effekt für Submit in der Card */
.section[data-anchor="contact"] button[type="submit"]:hover,
.section[data-anchor="contact"] .btn-submit:hover{ filter: brightness(1.05); }

/* Mobile: etwas engeres Padding der Card */
@media (max-width: 640px){
  .section[data-anchor="contact"] form{
    padding: 1rem;
    margin: 0 0.5rem;
  }
}

/* ==========================================================================
   CTA-LINKS – Optik & Farbe vereinheitlichen
   ========================================================================== */

/* .link-cta – überall gleich (auch Triple-V-Boxen) */
.triple-v-box a.link-cta,
.triple-v-box a[href="#contact"],
.textbox-black-half-transparent a.link-cta,
.textbox-black-half-transparent a[href="#contact"]{
  border-bottom: 0 !important;
  text-decoration: none !important;
  color: #3B82F6 !important;
  font-weight: 600;
  display: inline-block;
  line-height: 1.2;
  margin-top: .6rem;
  padding-left: 0;
}

/* Hover/Visited – stimmige Farbzustände */
.triple-v-box a.link-cta:hover,
.triple-v-box a[href="#contact"]:hover,
.textbox-black-half-transparent a.link-cta:hover,
.textbox-black-half-transparent a[href="#contact"]:hover{ color: #2563EB !important; }
.triple-v-box a.link-cta:visited,
.triple-v-box a[href="#contact"]:visited,
.textbox-black-half-transparent a.link-cta:visited,
.textbox-black-half-transparent a[href="#contact"]:visited{ color: #3B82F6 !important; }


