/* ================================================================
   shared/style-base.css — staff-os.de (statische Landing/Legal-Pages)
   Self-hosted Geist Sans (aus /public/fonts/geist-sans/), Base-Layer,
   Custom Utilities, Form & Button Components.
   Erst NACH /shared/tailwind.css einbinden.
   Vorbild: tkone88/tk-comp-landing — Farben auf staffOS-Orange angepasst.
   ================================================================ */

/* ── Self-hosted Geist Sans → /fonts/geist-sans/ ─────────── */
@font-face {
  font-family: "Geist Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/fonts/geist-sans/geist-sans-latin-400.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("/fonts/geist-sans/geist-sans-latin-500.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("/fonts/geist-sans/geist-sans-latin-600.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("/fonts/geist-sans/geist-sans-latin-700.woff2") format("woff2");
}

/* ── Base ──────────────────────────────────────────────────── */
* {
  border-color: hsl(var(--border));
}
html {
  scroll-behavior: smooth;
}
body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: "Geist Sans", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "rlig" 1, "calt" 1;
}
section[id] {
  scroll-margin-top: 80px;
}

/* ── Custom Utilities ─────────────────────────────────────── */
.container-narrow {
  margin-inline: auto;
  width: 100%;
  max-width: 80rem;
  padding-inline: 1rem;
}
@media (min-width: 640px) {
  .container-narrow { padding-inline: 1.5rem; }
}
@media (min-width: 1024px) {
  .container-narrow { padding-inline: 2rem; }
}

.text-balance {
  text-wrap: balance;
}

/* ── Hero-Gradient — Orange (staffOS) ──────────────────────── */
.hero-gradient {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, hsl(21 90% 53% / 0.15), transparent 60%),
    radial-gradient(ellipse 60% 80% at 100% 100%, hsl(21 90% 60% / 0.08), transparent 60%),
    hsl(var(--background));
}
.dark .hero-gradient {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, hsl(21 90% 60% / 0.22), transparent 60%),
    radial-gradient(ellipse 60% 80% at 100% 100%, hsl(21 90% 60% / 0.14), transparent 60%),
    hsl(var(--background));
}

.grid-pattern {
  background-image:
    linear-gradient(to right, hsl(var(--border) / 0.5) 1px, transparent 1px),
    linear-gradient(to bottom, hsl(var(--border) / 0.5) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 80% 50% at 50% 0%, black 40%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 50% at 50% 0%, black 40%, transparent 70%);
}

/* ── Reveal animation ──────────────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal {
  animation: fade-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; }
}

/* ── Form components ───────────────────────────────────────── */
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
  color: hsl(var(--foreground));
}
.form-required { color: hsl(var(--destructive)); }

.form-input,
.form-textarea,
.form-select {
  display: block;
  width: 100%;
  padding: 0.625rem 0.875rem;
  border-radius: 0.625rem;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-height: 44px;
  font-family: inherit;
}
.form-textarea {
  min-height: 144px;
  resize: vertical;
}
.form-input::placeholder,
.form-textarea::placeholder {
  color: hsl(var(--muted-foreground));
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.18);
}
.form-input[aria-invalid="true"],
.form-textarea[aria-invalid="true"],
.form-select[aria-invalid="true"] {
  border-color: hsl(var(--destructive));
}

.form-error {
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: hsl(var(--destructive));
}

.form-error-box {
  padding: 0.875rem 1rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  border: 1px solid hsl(var(--destructive) / 0.3);
  background: hsl(var(--destructive) / 0.05);
  color: hsl(var(--destructive));
}

.form-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.125rem;
  border-radius: 0.25rem;
  border: 1.5px solid hsl(var(--border));
  background-color: hsl(var(--background));
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: background-color 0.15s, border-color 0.15s;
}
.form-checkbox:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}
.form-checkbox:checked {
  background-color: hsl(var(--primary));
  border-color: hsl(var(--primary));
}
.form-checkbox:checked::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 75%;
}

/* ── Button base ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6875rem 1.25rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition:
    filter 0.15s,
    transform 0.15s,
    box-shadow 0.15s,
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s;
  min-height: 44px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-lg {
  padding: 0.875rem 1.5rem;
  font-size: 0.9375rem;
}
.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 8px 24px -8px hsl(var(--primary) / 0.45);
}
.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.btn-outline {
  background: transparent;
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}
.btn-outline:hover {
  background: hsl(var(--muted));
}
.btn-secondary {
  background-color: white;
  /* Auf der custom-dev-gradient-Section (Orange-Banner) bleibt der Text
     dunkel-orange fest verankert — sonst zu hell im Dark-Mode. */
  color: hsl(21 90% 40%);
  border-color: white;
}
.btn-secondary:hover {
  background-color: hsl(0 0% 96%);
  box-shadow: 0 8px 24px -8px rgb(15 23 42 / 0.18);
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25;
  border: 1px solid transparent;
}
.badge-orange {
  background-color: hsl(21 90% 53% / 0.12);
  color: hsl(21 90% 40%);
  border-color: hsl(21 90% 53% / 0.25);
}
.dark .badge-orange {
  background-color: hsl(21 90% 60% / 0.15);
  color: hsl(21 90% 70%);
  border-color: hsl(21 90% 60% / 0.30);
}
.badge-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.badge-outline {
  background-color: transparent;
  color: hsl(var(--muted-foreground));
  border-color: hsl(var(--border));
  font-size: 0.625rem;
  padding: 0.125rem 0.5rem;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  border-radius: 0.75rem;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  padding: 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card-hover:hover {
  border-color: hsl(var(--primary) / 0.3);
  box-shadow: 0 4px 14px -4px hsl(21 90% 53% / 0.25);
}
.card-featured {
  border-color: hsl(var(--primary));
  background: linear-gradient(to bottom, hsl(var(--primary) / 0.10), transparent);
  box-shadow: 0 4px 14px -4px hsl(21 90% 53% / 0.35);
  position: relative;
}

/* ── CTA Orange Gradient (CTASection Banner) ─────────────── */
.custom-dev-gradient {
  /* Bewusst HART KODIERT — die CTA-Section bleibt in beiden Modi
     orange, sonst würde der Banner im Dark-Mode kippen. */
  background: linear-gradient(
    135deg,
    hsl(21 90% 53%) 0%,
    hsl(21 90% 45%) 100%
  );
}
.custom-dev-overlay {
  background-image:
    radial-gradient(circle at 20% 0%, rgb(255 255 255 / 0.15), transparent 40%),
    radial-gradient(circle at 80% 100%, rgb(255 255 255 / 0.10), transparent 40%);
}

/* ── Header glass effect when scrolled ───────────────────── */
.header-scrolled {
  background-color: hsl(var(--background) / 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid hsl(var(--border) / 0.6);
  box-shadow: 0 2px 6px -2px rgb(0 0 0 / 0.05), 0 4px 12px -4px rgb(0 0 0 / 0.06);
}

/* ── Prose (Legal-Pages) ─────────────────────────────────── */
.prose-legal h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 2rem;
  letter-spacing: -0.025em;
}
.prose-legal h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.015em;
}
.prose-legal h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}
.prose-legal p {
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}
.prose-legal ul {
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  padding-left: 1.25rem;
  list-style-type: disc;
}
.prose-legal ul li {
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 0.25rem;
}
.prose-legal a {
  color: hsl(var(--primary));
  text-decoration: none;
}
.prose-legal a:hover {
  text-decoration: underline;
}
.prose-legal strong {
  font-weight: 600;
}

/* ── Touch targets (WCAG 2.5.5) ───────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  .btn { min-height: 48px; }
  .form-input, .form-textarea, .form-select { min-height: 48px; }
  nav a, footer nav a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* ── Form Input iOS Safari (verhindert Zoom-In bei Focus) ── */
@media (max-width: 640px) {
  .form-input, .form-textarea, .form-select { font-size: 16px; }
}
