/*
 * Kontaktformular – Schneiderei Stichfest (v1-Designsystem)
 * Weiße Formular-Karte auf dunkler Kontakt-Sektion, umrandete Eingabefelder
 * (radius 8px), Schatten/Transform-Hover wie im Rest der Seite. Eigenständig,
 * keine Frameworks. Ersetzt die style-hover-Attribute (funktionieren nur in
 * der Design-Vorschau, nicht im echten Browser) durch echtes CSS :hover/:focus.
 */

.cf-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cf-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.cf-label {
  font-size: 13px;
  font-weight: 700;
  color: #1a1a1a;
  font-family: 'Karla', sans-serif;
}

.cf-req {
  color: #b3261e;
}

.cf-optional {
  font-weight: 400;
  color: #767676; /* 4.5:1 Kontrast auf Weiß, erfüllt WCAG AA */
}

.cf-input,
.cf-textarea {
  appearance: none;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cccccc;
  border-radius: 8px;
  padding: 12px 14px;
  min-height: 44px;
  font-family: 'Karla', sans-serif;
  font-size: 15px;
  color: #1a1a1a;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cf-textarea {
  min-height: 110px;
  resize: vertical;
}

.cf-input::placeholder,
.cf-textarea::placeholder {
  color: #767676; /* 4.5:1 Kontrast auf Weiß, erfüllt WCAG AA */
}

.cf-input:hover,
.cf-textarea:hover {
  border-color: #1a1a1a;
}

.cf-input:focus-visible,
.cf-textarea:focus-visible {
  border-color: #1a1a1a;
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.08);
}

.cf-input[aria-invalid="true"],
.cf-textarea[aria-invalid="true"] {
  border-color: #b3261e;
}

.cf-input[aria-invalid="true"]:focus-visible,
.cf-textarea[aria-invalid="true"]:focus-visible {
  box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.12);
}

.cf-input:disabled,
.cf-textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: #f7f7f7;
}

.cf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.cf-error {
  font-size: 13px;
  line-height: 1.5;
  color: #b3261e;
  margin: 0;
}

.cf-counter {
  align-self: flex-end;
  font-size: 12px;
  color: #767676; /* 4.5:1 Kontrast auf Weiß, erfüllt WCAG AA */
}

.cf-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 2px;
}

.cf-checkbox {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: #1a1a1a;
  cursor: pointer;
}

.cf-checkbox-label {
  font-size: 14px;
  line-height: 1.55;
  color: #555555;
  font-family: 'Karla', sans-serif;
}

.cf-checkbox-label a {
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Honeypot: unsichtbar für Menschen, aber im DOM/Accessibility-Tree für Bots erreichbar */
.cf-hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.cf-submit {
  margin-top: 6px;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #1a1a1a;
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 16px;
  padding: 14px 24px;
  border-radius: 8px;
  cursor: pointer;
  min-height: 48px;
  font-family: 'Karla', sans-serif;
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.cf-submit:hover:not(:disabled) {
  background: #000000;
  transform: translateY(-2px);
}

.cf-submit:focus-visible {
  outline: 2px solid #1a1a1a;
  outline-offset: 2px;
}

.cf-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.cf-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: cf-spin 0.7s linear infinite;
}

@keyframes cf-spin {
  to { transform: rotate(360deg); }
}

.cf-status {
  font-size: 14px;
  line-height: 1.6;
  padding: 12px 14px;
  border-radius: 6px;
  display: none;
  font-family: 'Karla', sans-serif;
}

.cf-status.is-visible {
  display: block;
}

.cf-status.is-success {
  background: #f2f2f2;
  border: 1px solid #cccccc;
  color: #1a1a1a;
}

.cf-status.is-error {
  background: #fdecea;
  border: 1px solid #b3261e;
  color: #7a1a13;
}

.cf-success-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.cf-success-panel.is-visible {
  display: flex;
}

.cf-success-panel h3 {
  margin: 0;
  font-family: 'Lora', serif;
  font-weight: 600;
  font-size: 21px;
  color: #1a1a1a;
}

.cf-success-panel p {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: #555555;
}

.cf-reset {
  align-self: flex-start;
  background: transparent;
  border: 1.5px solid #1a1a1a;
  color: #1a1a1a;
  font-weight: 700;
  font-size: 14px;
  padding: 11px 22px;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Karla', sans-serif;
  transition: background 0.2s ease, color 0.2s ease;
}

.cf-reset:hover {
  background: #1a1a1a;
  color: #ffffff;
}

.cf-reset:focus-visible {
  outline: 2px solid #1a1a1a;
  outline-offset: 2px;
}

.cf-noscript {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.6;
  color: #7a1a13;
  background: #fdecea;
  border: 1px solid #b3261e;
  border-radius: 6px;
  padding: 14px 16px;
}

/* Zweispaltige Reihe (Telefon/Betreff) stapelt auf schmalen Formular-Karten */
@media (max-width: 460px) {
  .cf-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}
