/* ---------------------------------------------------------------------------
   ClipTon - eigenstaendiges Stylesheet
   Keine externen Schriften, keine Frameworks.
   --------------------------------------------------------------------------- */

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f9;
  --text: #0f172a;
  --muted: #55627a;
  --border: #dde3ee;
  --primary: #0f766e;
  --primary-strong: #0b5f59;
  --primary-contrast: #ffffff;
  --accent: #14b8a6;
  --error: #b42318;
  --error-bg: #fef3f2;
  --success: #067647;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --surface: #121b2c;
    --surface-2: #182338;
    --text: #e6edf7;
    --muted: #9aa9bf;
    --border: #22304a;
    --primary: #2dd4bf;
    --primary-strong: #14b8a6;
    --primary-contrast: #04211e;
    --accent: #5eead4;
    --error: #fca5a5;
    --error-bg: #2a1515;
    --success: #6ee7b7;
    --shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--primary-strong);
}

h1, h2, h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); }
h2 { font-size: clamp(1.35rem, 2.5vw, 1.75rem); margin-top: 0; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 1em; }

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 0.12em 0.35em;
  border-radius: 6px;
}

[hidden] {
  display: none !important;
}

.shell {
  width: min(100% - 2.5rem, 760px);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--primary);
  color: var(--primary-contrast);
  padding: 0.6rem 1rem;
  z-index: 20;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Header ------------------------------------------------------------------ */

.site-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-name {
  font-size: 1.1rem;
}

.site-nav {
  display: flex;
  gap: 1.1rem;
  font-size: 0.92rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--text);
}

/* Hero und Formular ------------------------------------------------------- */

.hero {
  padding: 2.6rem 0 1rem;
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 60ch;
}

.accent {
  color: var(--primary);
}

.converter {
  margin-top: 1.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.field-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.input-row {
  display: flex;
  gap: 0.5rem;
}

input[type="url"] {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.78rem 0.9rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="url"]::placeholder {
  color: color-mix(in srgb, var(--muted) 75%, transparent);
}

input[type="url"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
}

input[type="url"][aria-invalid="true"] {
  border-color: var(--error);
}

.field-hint {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.field-error {
  margin: 0.45rem 0 0;
  font-size: 0.85rem;
  color: var(--error);
}

.format-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 1rem;
}

.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  --btn-border: var(--border);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.72rem 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  border-color: color-mix(in srgb, var(--btn-border) 45%, var(--text));
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn[hidden] {
  display: none !important;
}

.btn-primary {
  --btn-bg: var(--primary);
  --btn-fg: var(--primary-contrast);
  --btn-border: var(--primary);
}

.btn-primary:hover {
  --btn-bg: var(--primary-strong);
  --btn-border: var(--primary-strong);
}

.btn-secondary {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  --btn-border: color-mix(in srgb, var(--primary) 35%, var(--border));
}

.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-border: var(--border);
  flex-direction: row;
  padding: 0.55rem 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

.btn-link {
  --btn-bg: transparent;
  --btn-border: transparent;
  --btn-fg: var(--muted);
  padding: 0.2rem 0.35rem;
  font-weight: 500;
  text-decoration: underline;
}

.btn-title {
  font-size: 1rem;
}

.btn-sub {
  font-size: 0.76rem;
  font-weight: 500;
  opacity: 0.82;
}

.legal-note {
  margin: 1rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Status ------------------------------------------------------------------ */

.status-card {
  margin-top: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.status-text {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.status-detail {
  margin: 0.6rem 0 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.status-detail[data-error="true"] {
  color: var(--error);
}

.status-card[data-state="failed"] {
  border-color: color-mix(in srgb, var(--error) 45%, var(--border));
  background: var(--error-bg);
}

.progressbar {
  margin-top: 0.7rem;
  height: 10px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}

.progressbar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.35s ease;
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

/* Abschnitte -------------------------------------------------------------- */

.section {
  padding: 2.4rem 0 0.6rem;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 1.2rem 0 0;
  display: grid;
  gap: 0.9rem;
  counter-reset: step;
}

.steps li {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem 0.9rem 3.2rem;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
}

.steps h3 {
  margin-bottom: 0.25rem;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th, td {
  text-align: left;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

thead th {
  background: var(--surface-2);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: none;
}

tbody th {
  font-weight: 700;
  color: var(--primary);
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.9rem;
}

details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
}

details summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::after {
  content: "+";
  float: right;
  color: var(--muted);
  font-weight: 400;
}

details[open] summary::after {
  content: "–";
}

details p {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Footer ------------------------------------------------------------------ */

.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  padding: 1.6rem 0 2rem;
  display: grid;
  gap: 0.7rem;
}

.footer-brand {
  margin: 0;
  font-weight: 700;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  font-size: 0.86rem;
}

.site-footer nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer nav a:hover {
  color: var(--text);
}

.footer-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  max-width: 70ch;
}

/* Rechtstexte ------------------------------------------------------------- */

.legal-page {
  padding: 2rem 0 3rem;
}

.legal-page h1 {
  margin-bottom: 0.3rem;
}

.legal-page h2 {
  margin-top: 1.8rem;
}

.legal-page .back {
  font-size: 0.9rem;
  display: inline-block;
  margin-bottom: 1.2rem;
}

.legal-page .notice {
  border: 1px solid color-mix(in srgb, var(--primary) 40%, var(--border));
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  font-size: 0.9rem;
}

.legal-page ul {
  padding-left: 1.2rem;
}

/* Responsive / Motion ----------------------------------------------------- */

@media (max-width: 560px) {
  .header-inner {
    min-height: 56px;
  }

  .site-nav {
    gap: 0.8rem;
    font-size: 0.85rem;
  }

  .input-row {
    flex-direction: column;
  }

  .format-actions {
    grid-template-columns: 1fr;
  }

  .btn-ghost {
    justify-content: center;
  }

  .status-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
