/* ============================================================
   Konzepthaus — Components (Buttons, Inputs, Checkboxes, etc.)
   ============================================================ */

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  padding: 14px 28px;
  font-size: 0.95rem;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-large { width: 100%; padding: 16px 24px; font-size: 1rem; }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 8px 16px;
  font-size: 0.8rem;
}

.btn-outline:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.btn-small { padding: 7px 14px; font-size: 0.8rem; border-radius: 8px; }

.btn-danger {
  background: rgba(255,85,85,0.1);
  color: var(--error);
  border: 1px solid rgba(255,85,85,0.3);
  padding: 8px 16px;
  font-size: 0.8rem;
}

.btn-danger:hover { background: rgba(255,85,85,0.2); }

/* ---- Input Fields ---- */
.input-field {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.input-field::placeholder { color: var(--text-dim); }
.input-field:focus { border-color: rgba(0,200,160,0.4); }

/* ---- Search Field ---- */
.search-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: var(--text-dim);
  pointer-events: none;
}

.search-field {
  width: 100%;
  padding: 12px 16px 12px 40px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-field::placeholder { color: var(--text-dim); }
.search-field:focus { border-color: rgba(0,200,160,0.4); }

/* ---- Checkbox Toggle ---- */
.checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.checkbox-toggle {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}

.checkbox-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.checkbox-track {
  position: absolute;
  inset: 0;
  background: var(--bg-btn-ghost-h);
  border-radius: 13px;
  border: 1px solid var(--border);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.checkbox-toggle input:checked + .checkbox-track {
  background: var(--accent-dim);
  border-color: rgba(0,200,160,0.4);
}

.checkbox-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform 0.25s ease, background 0.25s ease;
}

.checkbox-toggle input:checked ~ .checkbox-thumb {
  transform: translateX(18px);
  background: var(--accent);
}

.checkbox-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.checkbox-toggle input:checked ~ .checkbox-label-ref {
  color: var(--text-primary);
}

/* ---- Simple Checkbox (Quadrat) ---- */
.check-square {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}

.check-square input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--text-dim);
  border-radius: 6px;
  background: var(--bg-input);
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.check-square input[type="checkbox"]:hover {
  border-color: var(--text-secondary);
}

.check-square input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.check-square input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 6px;
  width: 5px;
  height: 10px;
  border: solid #000;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.check-square span {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.check-square input:checked + span {
  color: var(--text-primary);
}

/* ---- Error / Info Messages ---- */
.msg-error {
  padding: 12px 16px;
  background: rgba(255,85,85,0.1);
  border: 1px solid rgba(255,85,85,0.3);
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--error);
  text-align: center;
}

.msg-info {
  padding: 12px 16px;
  background: var(--accent-dim);
  border: 1px solid rgba(0,200,160,0.3);
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--accent);
  text-align: center;
}

/* ---- Password Input ---- */
.password-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.password-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px 24px;
  width: 100%;
  max-width: 340px;
  box-shadow: var(--shadow-card);
  text-align: center;
}

.password-dialog h3 {
  margin-bottom: 16px;
  color: var(--text-primary);
}

.password-dialog .input-field {
  margin-bottom: 12px;
  text-align: center;
  font-size: 1.2rem;
  letter-spacing: 0.2em;
}

/* ---- Sliders (from ledapp) ---- */
.slider-track { position: relative; padding: 4px 0; }

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--track-color, rgba(255,255,255,0.1));
  outline: none;
  cursor: pointer;
  transition: background 0.15s;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--thumb-color, var(--accent));
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.5);
  transition: transform 0.15s, box-shadow 0.15s;
}

.slider::-webkit-slider-thumb:active {
  transform: scale(1.2);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.4), 0 0 12px var(--thumb-color, var(--accent));
}

.slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--thumb-color, var(--accent));
  cursor: pointer;
  border: none;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.5);
}

/* ---- Password Input mit Sichtbarkeits-Toggle ---- */
.pw-input {
  position: relative;
}

.pw-input .input-field {
  padding-right: 46px;
}

.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text-dim);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s;
}

.pw-toggle:hover,
.pw-toggle:focus-visible {
  background: var(--bg-btn-ghost-h);
  color: var(--text-primary);
  outline: none;
}

.pw-toggle:active {
  transform: translateY(-50%) scale(0.92);
}

/* ---- Legal-Seiten (Impressum, Datenschutz) ---- */
.legal-page h3 {
  font-size: 0.95rem;
  color: var(--accent);
  margin-top: 20px;
  margin-bottom: 8px;
}

.legal-page h4 {
  font-size: 0.88rem;
  color: var(--text-primary);
  margin-top: 14px;
  margin-bottom: 6px;
}

.legal-page p,
.legal-page ul,
.legal-page li {
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.legal-page ul {
  padding-left: 20px;
  margin: 6px 0 12px;
}

.legal-page li {
  margin-bottom: 4px;
}

.legal-page a {
  color: var(--accent);
  text-decoration: underline;
}

.legal-page strong {
  color: var(--text-primary);
}

/* ---- Footer mit Legal-Links ---- */
.app-footer .footer-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.app-footer .footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  cursor: pointer;
}

.app-footer .footer-links a:hover {
  color: var(--text-secondary);
  text-decoration: underline;
}

/* ---- Landscape ---- */
@media (max-height: 500px) and (orientation: landscape) {
  .card { padding: 14px; }
}
