/* ── DM Sans lokal eingebunden (DSGVO-konform, kein Google-Server-Kontakt) ── */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
  font-optical-sizing: auto;
  src: url('../fonts/DMSans-Variable.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: italic;
  font-weight: 200 700;
  font-display: swap;
  font-optical-sizing: auto;
  src: url('../fonts/DMSans-Italic-Variable.woff2') format('woff2');
}

#lls-spenden-widget {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  color: #242625; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex; justify-content: center;
  padding: 20px 14px; box-sizing: border-box;
}
/* Versteckt bis JS das Widget ins Modal relocatet (kein Flash) */
#lls-spenden-widget.lls-modal-pending { display: none !important; }
#lls-spenden-widget *, #lls-spenden-widget *::before, #lls-spenden-widget *::after { box-sizing: border-box; }

.lls-card {
  width: 100%; max-width: 420px; background: #ffffff; border-radius: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 40px rgba(0,0,0,0.04);
  padding: 28px 22px;
}

@keyframes llsFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes llsSpin { to { transform: rotate(360deg); } }
.lls-fade-in { animation: llsFadeIn 0.35s ease; }

.lls-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.lls-brand-icon {
  width: 38px; height: 38px; border-radius: 50%; background: #fafaf8;
  display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0;
}
.lls-brand-name { font-size: 16px; font-weight: 700; color: #242625; letter-spacing: -0.3px; }
.lls-brand-sub { font-size: 12px; color: #c4c5c4; }

.lls-progress { margin-bottom: 32px; }
.lls-progress-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px; font-size: 14px; color: #8b8d8c;
}
.lls-progress-supporters { font-size: 13px; color: #c4c5c4; }
.lls-progress-bar { height: 6px; border-radius: 3px; background: #e8e8e6; overflow: hidden; }
.lls-progress-fill {
  height: 100%; border-radius: 3px; background: #fcc435;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.lls-btn {
  width: 100%; padding: 17px; border-radius: 12px; border: none;
  font-size: 16px; font-weight: 600; font-family: 'DM Sans', sans-serif;
  cursor: pointer; letter-spacing: -0.2px; transition: all 0.2s;
  text-align: center; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.lls-btn-accent { background: #fcc435; color: #242625; box-shadow: 0 2px 12px rgba(252,196,53,0.3); }
.lls-btn-accent:hover { background: #f5bc1a; }
.lls-btn-accent.disabled, .lls-btn-accent:disabled {
  background: #e8e8e6; color: #c4c5c4; box-shadow: none; cursor: not-allowed;
}
.lls-btn-accent.processing { opacity: 0.8; cursor: wait; }
.lls-btn-lg {
  padding: 18px; font-size: 17px; font-weight: 700; border-radius: 14px;
  letter-spacing: -0.3px; box-shadow: 0 2px 16px rgba(252,196,53,0.3);
}
.lls-btn-outline {
  padding: 12px 28px; border-radius: 10px; border: 1.5px solid #e8e8e6;
  background: #ffffff; color: #8b8d8c; font-size: 14px; width: auto;
}

.lls-back {
  background: none; border: none; cursor: pointer; font-size: 14px;
  color: #8b8d8c; font-family: 'DM Sans', sans-serif;
  padding: 0 0 16px; display: flex; align-items: center; gap: 4px;
}
.lls-back:hover { color: #242625; }

.lls-toggle {
  display: flex; border-radius: 10px; border: 1.5px solid #e8e8e6;
  overflow: hidden; margin-bottom: 24px;
}
.lls-toggle-btn {
  flex: 1; padding: 13px 8px; border: none; cursor: pointer;
  font-size: 15px; font-weight: 500; font-family: 'DM Sans', sans-serif;
  letter-spacing: -0.2px; background: #ffffff; color: #8b8d8c;
  border-bottom: 2.5px solid transparent; transition: all 0.2s;
}
.lls-toggle-btn.active {
  background: #fef8e6; color: #242625; font-weight: 700; border-bottom-color: #fcc435;
}

.lls-amount-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.lls-amount-btn {
  padding: 18px 12px; border-radius: 12px; border: 1.5px solid #e8e8e6;
  background: #ffffff; color: #242625; cursor: pointer; font-size: 20px;
  font-weight: 600; font-family: 'DM Sans', sans-serif;
  transition: all 0.15s; letter-spacing: -0.3px; text-align: center;
}
.lls-amount-btn.active { border-color: #fcc435; background: #fef8e6; box-shadow: 0 0 0 1px #fcc435; }
.lls-amount-btn:hover:not(.active) { border-color: #c4c5c4; }
.lls-amount-sub { font-size: 13px; font-weight: 400; opacity: 0.5; }

.lls-custom-amount {
  padding: 16px 18px; border-radius: 14px; border: 1.5px solid #ededeb;
  background: #fafaf8; cursor: text; transition: all 0.15s; margin-bottom: 28px;
  display: flex; align-items: center; gap: 10px;
}
.lls-custom-amount.active { border-color: #fcc435; background: #fef8e6; box-shadow: 0 0 0 1px #fcc435; }
#lls-spenden-widget .lls-custom-input {
  border: none !important; outline: none !important; background: transparent !important;
  font-size: 18px !important; font-weight: 600; font-family: 'DM Sans', sans-serif !important;
  color: #242625 !important; flex: 1; min-width: 0; padding: 0 !important; letter-spacing: -0.3px;
  height: auto !important; line-height: normal !important;
  box-shadow: none !important; border-radius: 0 !important;
  -webkit-appearance: none !important;
}
#lls-spenden-widget .lls-custom-input::placeholder { color: #c4c5c4 !important; font-weight: 500; }
.lls-custom-suffix { font-size: 15px; color: #b0b1b0; white-space: nowrap; flex-shrink: 0; }

.lls-summary {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-radius: 12px; background: #fafaf8;
  margin-bottom: 24px; border: 1px solid #e8e8e6;
}
.lls-summary-amount { font-size: 15px; font-weight: 600; color: #242625; }
.lls-summary-freq { font-size: 14px; color: #8b8d8c; margin-left: 6px; }
.lls-link {
  background: none; border: none; cursor: pointer; font-size: 14px;
  color: #8b8d8c; font-family: 'DM Sans', sans-serif;
  text-decoration: underline; text-underline-offset: 2px;
}
.lls-link:hover { color: #242625; }

.lls-stripe-element { margin-bottom: 20px; min-height: 100px; }
.lls-loading { text-align: center; padding: 32px 16px; font-size: 14px; color: #c4c5c4; }

/* ── Reset: kill WordPress/Elementor overrides on NON-styled inputs ── */
#lls-spenden-widget input,
#lls-spenden-widget select,
#lls-spenden-widget textarea,
#lls-spenden-widget button {
  box-shadow: none !important;
  text-shadow: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  margin: 0;
}
/* Only reset bare inputs (custom-amount inner input), NOT .lls-input fields */
#lls-spenden-widget input.lls-custom-input {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  height: auto !important;
  min-height: auto !important;
  line-height: normal !important;
  font-size: 18px !important;
}

.lls-field-label {
  display: block; font-size: 13px; font-weight: 500;
  color: #8b8d8c; margin-bottom: 5px; margin-top: 14px;
}
/* Styled form inputs – high specificity to beat any WP theme */
#lls-spenden-widget input.lls-input,
#lls-spenden-widget select.lls-input {
  width: 100% !important; padding: 14px 16px !important; border-radius: 14px !important;
  border: 1.5px solid #ededeb !important; font-size: 16px !important;
  font-family: 'DM Sans', sans-serif !important; color: #242625 !important;
  outline: none !important; background: #fafaf8 !important; transition: all 0.15s !important;
  height: auto !important; line-height: 1.4 !important;
  -webkit-appearance: none !important;
}
#lls-spenden-widget input.lls-input:focus,
#lls-spenden-widget select.lls-input:focus { border-color: #fcc435 !important; background: #ffffff !important; box-shadow: 0 0 0 1px #fcc435 !important; }
#lls-spenden-widget input.lls-input::placeholder { color: #c4c5c4 !important; font-weight: 400 !important; }
#lls-spenden-widget input.lls-input.lls-input-error { border-color: #d94040 !important; background: #fef8f8 !important; }
#lls-spenden-widget input.lls-input.lls-input-error:focus { box-shadow: 0 0 0 1px #d94040 !important; }
#lls-spenden-widget input.lls-input.lls-input-locked {
  background: #f3f3f1 !important; color: #8b8d8c !important;
  cursor: not-allowed !important; opacity: 1 !important;
}
#lls-spenden-widget select.lls-input {
  min-height: 48px !important;
  appearance: none !important; -webkit-appearance: none !important; -moz-appearance: none !important;
  background: #fafaf8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238b8d8c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E") no-repeat right 14px center !important;
  padding-right: 36px !important;
  cursor: pointer;
}
.lls-field-row { display: flex; gap: 10px; }
.lls-field-half { flex: 1; }

.lls-error {
  padding: 12px 16px; border-radius: 14px; background: #fef2f2;
  border: 1px solid #fecaca; color: #d94040; font-size: 14px; margin-bottom: 16px;
}
.lls-security-note {
  font-size: 12px; color: #c4c5c4; text-align: center; margin: 16px 0 0; line-height: 1.6;
}
.lls-payment-hint {
  font-size: 14px; color: #8b8d8c; margin: 0 0 12px; font-weight: 500;
}
.lls-spinner {
  width: 16px; height: 16px; border: 2px solid #242625;
  border-top-color: transparent; border-radius: 50%;
  animation: llsSpin 0.6s linear infinite; flex-shrink: 0; display: inline-block;
}

.lls-success-header { text-align: center; margin-bottom: 28px; }
.lls-success-header svg { margin-bottom: 16px; }
.lls-success-header h2 { font-size: 22px; font-weight: 700; margin: 0 0 6px; color: #242625; }
.lls-success-header p { font-size: 15px; color: #8b8d8c; margin: 0; line-height: 1.5; }

.lls-receipt-box {
  padding: 20px; border-radius: 14px; border: 1.5px solid #e8e8e6;
  background: #ffffff; margin-bottom: 20px;
}
#lls-spenden-widget .lls-styled-checkbox {
  width: 22px !important; height: 22px !important; border-radius: 6px !important;
  flex-shrink: 0; margin-top: 1px;
  border: 2px solid #c4c5c4 !important; background: #ffffff !important;
  appearance: none !important; -webkit-appearance: none !important; -moz-appearance: none !important;
  cursor: pointer; transition: all 0.15s !important;
  padding: 0 !important; position: relative;
  display: inline-block !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  z-index: 2;
  min-width: 22px !important; min-height: 22px !important;
}
#lls-spenden-widget .lls-styled-checkbox:checked {
  border-color: #fcc435 !important; background: #fcc435 !important;
}
#lls-spenden-widget .lls-styled-checkbox:checked::after {
  content: '✓'; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); font-size: 13px; font-weight: 700;
  color: #242625; line-height: 1;
}
.lls-checkbox-label {
  display: flex; align-items: flex-start; gap: 12px;
  cursor: pointer; user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  padding: 4px 0; /* bigger touch target */
}
.lls-checkbox-title { font-size: 15px; font-weight: 600; color: #242625; display: block; }
.lls-checkbox-desc { font-size: 13px; color: #8b8d8c; display: block; margin-top: 2px; }
.lls-checkbox-text { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.lls-address-fields { margin-top: 18px; animation: llsFadeIn 0.25s ease; }
.lls-address-fields.hidden { display: none !important; }

.lls-ac-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
  background: #ffffff; border: 1.5px solid #ededeb; border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08); margin-top: 4px;
  overflow: hidden; max-height: 240px; overflow-y: auto;
}
.lls-ac-item {
  padding: 12px 16px; cursor: pointer; transition: background 0.1s;
  display: flex; flex-direction: column; gap: 2px;
  font-size: 14px; color: #242625; border-bottom: 1px solid #f3f3f1;
}
.lls-ac-item:last-child { border-bottom: none; }
.lls-ac-item:hover { background: #fef8e6; }
.lls-ac-item strong { font-weight: 600; font-size: 14px; }
.lls-ac-sub { font-size: 12px; color: #8b8d8c; }

.lls-done-screen { text-align: center; padding: 40px 10px; display: flex; flex-direction: column; align-items: center; }
.lls-done-emoji { font-size: 40px; margin-bottom: 16px; }
.lls-done-screen h2 { font-size: 20px; font-weight: 700; margin: 0 0 8px; color: #242625; }
.lls-done-screen p { font-size: 15px; color: #8b8d8c; margin: 0 0 28px; line-height: 1.6; }

@media (max-width: 480px) {
  #lls-spenden-widget { padding: 12px 8px; }
  .lls-card { border-radius: 16px; padding: 24px 18px; }
}

/* ── Modal Overlay ── */
.lls-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  visibility: hidden;
  pointer-events: none;
}
.lls-modal-overlay.lls-modal-open {
  visibility: visible;
  pointer-events: auto;
}
.lls-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease;
  touch-action: none;
}
.lls-modal-open .lls-modal-backdrop {
  opacity: 1;
}
.lls-modal-container {
  position: relative; z-index: 1;
  max-width: 420px; width: 100%;
  opacity: 0;
  transform: scale(0.95) translateY(12px);
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.16,1,0.3,1);
}
.lls-modal-open .lls-modal-container {
  opacity: 1;
  transform: scale(1) translateY(0);
}
.lls-modal-container #lls-spenden-widget {
  padding: 0;
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.lls-modal-close {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%;
  border: none; background: rgba(0,0,0,0.06); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #8b8d8c; transition: background 0.15s, color 0.15s;
  padding: 0; line-height: 1;
}
.lls-modal-close:hover { background: rgba(0,0,0,0.1); color: #242625; }
.lls-modal-container .lls-card { padding-top: 52px; position: relative; }
.lls-modal-container .lls-back-top {
  position: absolute; top: 8px; left: 22px;
  height: 40px; padding: 0;
}
.lls-modal-close svg { pointer-events: none; }

@media (max-width: 639px) {
  .lls-modal-overlay { padding: 0; }
  .lls-modal-container {
    max-width: 100%; border-radius: 0;
  }
  .lls-modal-container #lls-spenden-widget {
    max-height: 100vh; max-height: 100dvh;
  }
  .lls-modal-container .lls-card { border-radius: 0; min-height: 100vh; min-height: 100dvh; }
  .lls-modal-close { top: 12px; right: 12px; background: rgba(0,0,0,0.08); }
  .lls-modal-container .lls-back-top { top: 12px; left: 18px; }
}

/* ── Barrierefreiheit: Animationen deaktivieren ── */
@media (prefers-reduced-motion: reduce) {
  .lls-fade-in { animation: none; }
  .lls-progress-fill { transition: none; }
  .lls-spinner { animation: llsSpin 0.6s linear infinite; /* Spinner bleibt — rein funktional */ }
  #lls-spenden-widget * { transition-duration: 0.01ms !important; }
  .lls-modal-overlay, .lls-modal-container { transition: none; }
}
