@import url("../../components/globals/base.css");
@import url("../../components/navbar/navbar.css");
@import url("../../components/globals/content.css");
@import url("../../components/footer/footer.css");
@import url("../../components/cookie/cookie.css");

/* Animations */
@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

@keyframes pulseIcon {
  0% { transform: scale(1); opacity: 0.5; }
  70% { transform: scale(1.3); opacity: 0; }
  100% { transform: scale(1.3); opacity: 0; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Form Layout */
.form-container {
  display: flex;
  flex-direction: column;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.form-success {
  grid-column: 1 / -1;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: fadeIn 0.5s ease-out;
}

.success-icon {
  width: 80px;
  height: 80px;
  background-color: rgba(46, 204, 113, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  position: relative;
}

.success-icon svg {
  width: 40px;
  height: 40px;
  stroke: #2ecc71;
  stroke-width: 3;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: drawCheck 0.8s ease-in-out forwards 0.3s;
}

.success-icon::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%;
  border: 2px solid rgba(46, 204, 113, 0.3);
  animation: pulseIcon 2s infinite;
}

.form-success h3 {
  color: rgba(var(--accent-rgb), 1);
  font-size: 2rem;
  margin-bottom: 15px;
}

.form-success p {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  max-width: 500px;
  margin-bottom: 30px;
}

/* Form Elements */
.form-title {
  margin-bottom: 24px;
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.3);
  padding-bottom: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.field label {
  font-weight: 500;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
}

.field label .required {
  color: rgba(var(--accent-rgb), 0.85);
  font-size: 0.85rem;
  font-weight: normal;
}

.field input,
.field textarea,
.field select {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 12px 16px;
  font: inherit;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  transition: all 0.2s ease;
  width: 100%;
}

.field select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 40px;
}

.field select option {
  background: #111;
  color: #fff;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 0;
  border-color: rgba(var(--accent-rgb), 0.6);
  background: rgba(var(--accent-rgb), 0.05);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.15);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.checkbox-field {
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  margin-top: 10px;
}

.checkbox-field input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: rgba(var(--accent-rgb), 1);
}

.checkbox-field label {
  cursor: pointer;
  line-height: 1.4;
}

.checkbox-field label a {
  color: rgba(var(--accent-rgb), 1);
  text-decoration: none;
}

.btn-full {
  width: 100%;
  margin-top: 10px;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  justify-content: center;
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-full:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  background: rgba(var(--accent-rgb), 0.5) !important;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

.honeypot {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Certificate Tiles */
.cert-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  width: 100%;
}

.cert-tile {
  border-radius: 12px;
  aspect-ratio: 1 / 1;
  padding: 15px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: auto;
  width: 100%;
}

.cert-tile strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 5px;
  color: rgba(var(--accent-rgb), 1);
}

.cert-tile span {
  font-size: 0.85rem;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.8);
}

.cert-tile .go {
  display: none;
}

/* Map Box */
.mapbox {
  margin-top: 40px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: var(--shadow-soft);
}

.map-placeholder {
  padding: 18px;
}

.map-placeholder h3 {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.92);
}

.map-embed {
  width: 100%;
  height: 380px;
  border: 0;
  display: none;
}

.center-head {
  text-align: center;
  max-width: 800px;
  margin: 40px auto 0;
}

/* References Section */
#referenz-cards {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  width: 100%;
  margin: 40px auto;
  justify-content: flex-start;
  overflow-x: auto;
  padding-bottom: 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(250, 177, 47, 0.5) rgba(255, 255, 255, 0.05);
}

#referenz-cards .card {
  flex: 0 0 200px;
  height: 120px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: all 0.3s ease;
}

#referenz-cards .card-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#referenz-cards .card-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: grayscale(1) brightness(1.5);
  opacity: 0.7;
  transition: all 0.3s ease;
}

.refs-cta {
  text-align: center;
  margin-top: 20px;
  margin-bottom: 60px;
}

/* Media Queries */
@media (min-width: 980px) {
  #referenz-cards {
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible;
  }
  
  #referenz-cards .card {
    flex: 0 0 calc(16.66% - 12px);
    min-width: 160px;
  }
}

@media (max-width: 991px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

@media (max-width: 767px) {
  .form-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    text-align: center;
  }

  .field label {
    font-size: 0.9rem;
  }

  .field input,
  .field textarea,
  .field select {
    padding: 10px 14px;
    font-size: 1rem; /* Prevent zoom on iOS */
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .checkbox-field label {
    font-size: 0.85rem;
  }

  .btn-full {
    padding: 14px;
    font-size: 1rem;
  }

  .cert-grid {
    grid-template-columns: 1fr;
  }
  
  .cert-tiles {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  
  .cert-tile strong { font-size: 0.9rem; }
  .cert-tile span { font-size: 0.7rem; }

  #referenz-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    overflow-x: hidden;
    padding-bottom: 0;
    margin: 20px auto;
  }

  #referenz-cards .card {
    flex: none;
    width: 100%;
    height: 80px;
    padding: 10px;
  }

  #referenz-cards .card-image img {
    max-height: 50px;
  }
}

@media (max-width: 480px) {
  .cert-tiles {
    grid-template-columns: 1fr;
  }
  
  .cert-tile {
    aspect-ratio: auto;
    padding: 20px;
  }

  .form-container {
    padding: 0;
  }
}
