/* =============================================
   TEAM-KONTAKT.CSS
   Dialog mit Kontaktformular fuer die Team-Karten.
   Versand serverseitig ueber das WCMS – die
   E-Mail-Adresse steht nie im Markup.

   Eigenstaendig: nutzt keine Bootstrap-Klassen,
   nur die Custom Properties der Website mit
   Fallback-Werten.
   ============================================= */

/* ---------- Backdrop + Buehne ---------- */
.tkmail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1080;
  background: rgba(26, 26, 46, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.25s var(--ease-smooth, ease);
}
.tkmail-backdrop.is-visible { opacity: 1; }
.tkmail-backdrop[hidden]    { display: none; }

.tkmail-modal {
  position: fixed;
  inset: 0;
  z-index: 1090;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.25rem;
  overflow-y: auto;
}
.tkmail-modal[hidden] { display: none; }

.tkmail-dialog {
  width: 100%;
  max-width: 36rem;
  margin: auto;
  background: var(--warm-white, #fff);
  border: 1px solid var(--border, #e8e2d8);
  border-radius: var(--radius-lg, 1.25rem);
  box-shadow: var(--shadow-xl, 0 24px 64px rgba(26, 26, 46, 0.14));
  overflow: hidden;
  transform: translateY(14px) scale(0.97);
  opacity: 0;
  transition: transform 0.3s var(--ease-out, ease), opacity 0.3s var(--ease-out, ease);
}
.tkmail-modal.is-visible .tkmail-dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.tkmail-dialog::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--gold, #c8993f), var(--gold-light, #e2b964));
}

/* ---------- Kopfzeile ---------- */
.tkmail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 1.6rem 1.1rem;
  border-bottom: 1px solid var(--border-light, #f0ece4);
}
.tkmail-eyebrow {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold, #c8993f);
}
.tkmail-title {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink, #1a1a2e);
}
.tkmail-close {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light, #f0ece4);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-light, #4a4a5e);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.3s var(--ease-smooth, ease), color 0.3s var(--ease-smooth, ease);
}
.tkmail-close:hover {
  background: var(--primary-soft, rgba(27, 58, 92, 0.06));
  color: var(--ink, #1a1a2e);
}

/* ---------- Formularkoerper ---------- */
.tkmail-body { padding: 1.4rem 1.6rem 1.2rem; }

.tkmail-recipient {
  margin: 0 0 1.25rem;
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius, 0.75rem);
  background: var(--primary-soft, rgba(27, 58, 92, 0.06));
  color: var(--primary, #1b3a5c);
  font-size: 0.9rem;
}
.tkmail-recipient i { color: var(--gold, #c8993f); margin-right: 0.4rem; }
.tkmail-recipient strong { font-weight: 700; }

.tkmail-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
}
.tkmail-row > .tkmail-field { flex: 1 1 13rem; }

.tkmail-field { margin-bottom: 1rem; }

.tkmail-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-light, #4a4a5e);
}
.tkmail-label .tkmail-req { color: var(--gold, #c8993f); }
.tkmail-label .tkmail-opt {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted, #7a7a8e);
}

.tkmail-input,
.tkmail-textarea {
  display: block;
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border, #e8e2d8);
  border-radius: var(--radius-md, 0.625rem);
  background: #fff;
  color: var(--ink, #1a1a2e);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  transition: border-color 0.25s var(--ease-smooth, ease), box-shadow 0.25s var(--ease-smooth, ease);
}
.tkmail-textarea { resize: vertical; min-height: 7rem; }
.tkmail-input:focus,
.tkmail-textarea:focus {
  outline: none;
  border-color: var(--gold, #c8993f);
  box-shadow: 0 0 0 3px rgba(200, 153, 63, 0.18);
}
.tkmail-input.is-invalid,
.tkmail-textarea.is-invalid {
  border-color: #b02a2a;
  box-shadow: 0 0 0 3px rgba(176, 42, 42, 0.12);
}

.tkmail-feedback {
  display: none;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #a12626;
}
.tkmail-field.has-error .tkmail-feedback { display: block; }

.tkmail-counter {
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: var(--muted, #7a7a8e);
  text-align: right;
}

/* ---------- Spamschutz: Rechenaufgabe ---------- */
.tkmail-captcha {
  display: flex;
  align-items: flex-end;
  gap: 0.9rem;
  flex-wrap: wrap;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
  border: 1px dashed var(--border, #e8e2d8);
  border-radius: var(--radius, 0.75rem);
  background: var(--cream, #faf7f2);
}
.tkmail-captcha-text { flex: 1 1 12rem; }
.tkmail-captcha-text .tkmail-label { margin-bottom: 0.15rem; }
.tkmail-captcha-question {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink, #1a1a2e);
}
.tkmail-captcha-question i { color: var(--gold, #c8993f); margin-right: 0.35rem; }
.tkmail-captcha-input { flex: 0 0 6.5rem; }
.tkmail-captcha-input .tkmail-input { text-align: center; font-weight: 600; }
.tkmail-captcha .tkmail-feedback { flex: 1 1 100%; margin-top: 0; }
.tkmail-captcha.has-error .tkmail-feedback { display: block; }

/* ---------- Datenschutz-Haken ---------- */
.tkmail-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}
.tkmail-consent input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.15rem;
  accent-color: var(--gold, #c8993f);
}
.tkmail-consent label {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--ink-light, #4a4a5e);
}
.tkmail-consent a { color: var(--primary, #1b3a5c); text-decoration: underline; }
.tkmail-consent.has-error label { color: #a12626; }

/* ---------- Honeypot: fuer Menschen unsichtbar ---------- */
.tkmail-hp {
  position: absolute !important;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Meldungen ---------- */
.tkmail-alert {
  margin-top: 1rem;
  padding: 0.75rem 0.95rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md, 0.625rem);
  font-size: 0.88rem;
  line-height: 1.5;
}
.tkmail-alert[hidden] { display: none; }
.tkmail-alert--error {
  background: rgba(176, 42, 42, 0.07);
  border-color: rgba(176, 42, 42, 0.28);
  color: #a12626;
}
.tkmail-alert--info {
  background: rgba(27, 58, 92, 0.06);
  border-color: rgba(27, 58, 92, 0.2);
  color: var(--primary, #1b3a5c);
}

.tkmail-hint {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 1.1rem 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted, #7a7a8e);
}
.tkmail-hint i { color: var(--gold, #c8993f); margin-top: 0.1rem; }

/* ---------- Erfolgsansicht ---------- */
.tkmail-done {
  padding: 2.4rem 1.6rem 2rem;
  text-align: center;
}
.tkmail-done[hidden] { display: none; }
.tkmail-done-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1.1rem;
  border-radius: 50%;
  background: rgba(33, 136, 56, 0.1);
  color: #1a6b2c;
  font-size: 1.6rem;
}
.tkmail-done h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  color: var(--ink, #1a1a2e);
  margin-bottom: 0.5rem;
}
.tkmail-done p {
  margin: 0 auto 1.5rem;
  max-width: 26rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--ink-light, #4a4a5e);
}

/* ---------- Aktionen ---------- */
.tkmail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: flex-end;
  padding: 1.1rem 1.6rem 1.35rem;
  border-top: 1px solid var(--border-light, #f0ece4);
  background: var(--cream, #faf7f2);
}
.tkmail-actions[hidden] { display: none; }
.tkmail-btn {
  padding: 0.7rem 1.5rem;
  border-radius: 50rem;
  border: 2px solid transparent;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.3s var(--ease-smooth, ease);
}
.tkmail-btn--ghost {
  background: transparent;
  border-color: var(--border, #e8e2d8);
  color: var(--ink-light, #4a4a5e);
}
.tkmail-btn--ghost:hover {
  border-color: var(--ink-light, #4a4a5e);
  color: var(--ink, #1a1a2e);
}
.tkmail-btn--send {
  background: linear-gradient(135deg, var(--primary, #1b3a5c), var(--primary-light, #2a5a8c));
  color: #fff;
  box-shadow: var(--shadow, 0 4px 16px rgba(26, 26, 46, 0.06));
}
.tkmail-btn--send:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md, 0 8px 30px rgba(26, 26, 46, 0.08));
}
.tkmail-btn:disabled { opacity: 0.6; cursor: progress; }
.tkmail-btn:focus-visible {
  outline: 3px solid var(--gold-light, #e2b964);
  outline-offset: 2px;
}
.tkmail-spinner {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  margin-right: 0.45rem;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tkmail-spin 0.7s linear infinite;
  vertical-align: -1px;
}
@keyframes tkmail-spin { to { transform: rotate(360deg); } }

body.tkmail-open { overflow: hidden; }

/* ---------- Mobil ---------- */
@media (max-width: 575.98px) {
  .tkmail-modal  { padding: 0.75rem; }
  .tkmail-head   { padding: 1.15rem 1.15rem 0.95rem; }
  .tkmail-body   { padding: 1.15rem 1.15rem 1rem; }
  .tkmail-actions{ padding: 1rem 1.15rem 1.15rem; }
  .tkmail-title  { font-size: 1.2rem; }
  .tkmail-btn    { flex: 1 1 100%; text-align: center; }
  .tkmail-captcha-input { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .tkmail-backdrop,
  .tkmail-dialog { transition: none; }
  .tkmail-spinner { animation-duration: 2s; }
}
