:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1f232c;
  --border: #2a2f3a;
  --text: #e6e8ec;
  --text-dim: #9aa1ac;
  --accent: #6ea8fe;
  --tier-s: #4caf7d;
  --tier-a: #e0b93a;
  --tier-b: #9aa1ac;
  --error-bg: #3a1c22;
  --error-border: #7a2e37;
  --error-text: #f4b3ba;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.site-header {
  margin-bottom: 32px;
}

.site-header h1 {
  margin: 0;
  font-size: 1.6rem;
}

.site-header h1 a {
  color: var(--text);
  text-decoration: none;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.site-footer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* Form */

form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}

label.field-spaced {
  margin-top: 18px;
}

input[type="url"],
input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
}

input[type="url"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
}

.field-hint {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.field-hint a {
  color: var(--accent);
}

button {
  margin-top: 20px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #0f1115;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.08);
}

button.secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 500;
  margin-top: 0;
}

.download-form {
  padding: 16px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
}

/* Alerts */

.alert-error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
}

/* Result page */

.back-link {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.video-header h2 {
  margin: 0 0 4px;
  font-size: 1.3rem;
}

.video-header .meta {
  color: var(--text-dim);
  margin: 0 0 20px;
  font-size: 0.9rem;
}

.video-header .meta a {
  color: var(--accent);
}

.tier-section {
  margin-top: 28px;
}

.tier-section h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  color: #0f1115;
  margin-right: 4px;
}

.tier-badge-S { background: var(--tier-s); }
.tier-badge-A { background: var(--tier-a); }
.tier-badge-B { background: var(--tier-b); }

.clip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 14px;
}

.clip-time {
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.clip-card blockquote {
  margin: 0 0 10px;
  padding: 10px 14px;
  border-left: 3px solid var(--border);
  color: var(--text);
  font-style: italic;
  background: var(--surface-2);
  border-radius: 0 6px 6px 0;
}

.clip-reason {
  margin: 0 0 8px;
  color: var(--text-dim);
  font-size: 0.92rem;
}

.captions-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.captions ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.captions li {
  font-size: 0.92rem;
}

.empty {
  color: var(--text-dim);
  margin-top: 24px;
}

/* Loading overlay */

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 21, 0.92);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 10;
  display: none;
}

.loading-overlay:not([hidden]) {
  display: flex;
}

.loading-overlay p {
  color: var(--text-dim);
  max-width: 320px;
  text-align: center;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Managed-Service-Ergänzungen --- */

input[type="email"],
input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
}

input[type="email"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

.header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.account-box {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 0.9rem;
}

.balance {
  color: var(--text-dim);
}

.balance strong {
  color: var(--tier-s);
}

.logout-link {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px dotted var(--border);
}

.logout-link:hover {
  color: var(--text);
}

.form-title {
  margin: 0 0 16px;
  font-size: 1.1rem;
}

.buy-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-top: 24px;
}

.buy-box p {
  color: var(--text-dim);
  margin: 0 0 4px;
}

.buy-box form {
  background: none;
  border: none;
  padding: 0;
}

.buy-inline {
  margin-top: 16px;
}

.buy-inline form {
  background: none;
  border: none;
  padding: 0;
}

.success-box {
  background: var(--surface);
  border: 1px solid var(--tier-s);
  border-radius: 12px;
  padding: 28px;
}

.success-box h2 {
  margin-top: 0;
}

.credentials {
  margin: 20px 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 20px;
}

.credentials dt {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.credentials dd {
  margin: 0;
}

.access-code {
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 1.2rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 20px 0 32px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  color: var(--text-dim);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
}

.stat-hint {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  color: var(--text-dim);
  font-weight: 500;
}

.legal-text {
  color: var(--text-dim);
  font-size: 0.95rem;
}

.legal-text h3 {
  color: var(--text);
  margin-top: 24px;
}

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

/* --- Persoenlicher Clip-Filter --- */

.onboarding-intro {
  margin-bottom: 24px;
}

.onboarding-intro h2 {
  margin: 0 0 8px;
  font-size: 1.3rem;
}

.onboarding-intro p {
  color: var(--text-dim);
  margin: 0;
}

.survey-question {
  border: none;
  padding: 0;
  margin: 0 0 24px;
}

.survey-question legend {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 10px;
  padding: 0;
}

.radio-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  margin-bottom: 0;
}

.radio-option input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--accent);
}

select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
}

textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
}

textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
}

.other-input {
  margin-top: 8px;
  font-size: 0.9rem !important;
}

.guide-details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.guide-details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}

.guide-text {
  margin-top: 14px;
  white-space: pre-wrap;
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.6;
}

.filter-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 0.9rem;
  text-decoration: none;
  border-bottom: 1px dotted var(--border);
}

.filter-link:hover {
  color: var(--text);
}

/* --- Landing Page --- */

.hero {
  text-align: center;
  padding: 40px 0 56px;
}

.hero-eyebrow {
  color: var(--accent);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 14px;
  font-weight: 600;
}

.hero-title {
  font-size: 2.1rem;
  line-height: 1.2;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

.hero-sub {
  color: var(--text-dim);
  font-size: 1.1rem;
  max-width: 540px;
  margin: 0 auto 28px;
}

.hero-cta .cta-big {
  font-size: 1.15rem;
  padding: 16px 36px;
  margin-top: 0;
}

.cta-hint {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 10px 0 0;
}

.hero-login {
  margin-top: 28px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.hero-login a {
  color: var(--accent);
}

.section-title {
  text-align: center;
  font-size: 1.4rem;
  margin: 0 0 24px;
}

.steps {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #0f1115;
  font-weight: 700;
  margin-bottom: 12px;
}

.step-card h4 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.step-card p {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin: 0;
}

.pricing {
  padding: 32px 0 8px;
  border-top: 1px solid var(--border);
  margin-top: 32px;
}

.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
}

.pricing-main {
  font-size: 1.25rem;
  margin: 0 0 16px;
}

.pricing-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.pricing-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.pricing-list li:last-child {
  border-bottom: none;
}

@media (max-width: 600px) {
  .hero-title {
    font-size: 1.6rem;
  }
}
