﻿/* ========================================================================== 
   Thema Design System — Shared foundation
   ==========================================================================
*/

:root {
  color-scheme: light dark;
  --ts-bg: #0a0d12;
  --ts-bg-alt: #101722;
  --ts-surface: rgba(255, 255, 255, 0.04);
  --ts-primary: #3b82f6;
  --ts-primary-accent: #60a5fa;
  --ts-accent: #22d3ee;
  --ts-text: #e3edf8;
  --ts-text-muted: #94a3b8;
  --ts-border: rgba(148, 163, 184, 0.2);
  --ts-radius: 0;
  --ts-shadow: 0 30px 60px -40px rgba(15, 118, 110, 0.6);
  --ts-font-heading: "Manrope", "Segoe UI", sans-serif;
  --ts-font-body: "Inter", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--ts-font-body);
  background: radial-gradient(120% 120% at 30% 20%, rgba(34, 211, 238, 0.25), transparent 60%) var(--ts-bg);
  color: var(--ts-text);
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  background: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover,
a:focus {
  color: var(--ts-primary);
}

img {
  max-width: 100%;
  display: block;
}

.ts-page {
  display: flex;
  flex-direction: column;
  gap: 72px;
  min-height: 100vh;
}

.ts-section {
  width: min(1200px, 92vw);
  margin: 0 auto;
}

.ts-section--narrow {
  width: min(960px, 92vw);
  margin: 0 auto;
}

.ts-container {
  width: min(1200px, 92vw);
  margin: 0 auto;
}

.ts-container--narrow {
  width: min(960px, 92vw);
  margin: 0 auto;
}

.ts-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.ts-shell__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.ts-shell__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: clamp(24px, 5vh, 48px) 0 calc(14px + var(--ts-safe-bottom, 0px));
}

.ts-shell__footer > * {
  margin: 0;
}

.ts-text-muted {
  color: var(--ts-text-muted);
}

.ts-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.15);
  color: var(--ts-accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
}

.ts-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  background: linear-gradient(135deg, var(--ts-primary), var(--ts-accent));
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--ts-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.ts-button:hover,
.ts-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 45px -30px rgba(59, 130, 246, 0.8);
}

.ts-button--ghost {
  background: transparent;
  color: var(--ts-primary-accent);
  border: 1px solid var(--ts-border);
  box-shadow: none;
}

.ts-button--sm {
  padding: 10px 18px;
  font-size: 0.9rem;
}

.ts-button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.ts-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
}

.ts-nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.2rem;
  font-family: var(--ts-font-heading);
  letter-spacing: 0.01em;
}

.ts-nav__links {
  display: flex;
  gap: 24px;
  font-size: 0.95rem;
}

.ts-nav__links a {
  color: var(--ts-text-muted);
  position: relative;
  padding-bottom: 6px;
  transition: color 0.2s ease;
}

.ts-nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(135deg, var(--ts-primary), var(--ts-accent));
  opacity: 0;
  transform: scaleX(0.8);
  transform-origin: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
  border-radius: 999px;
}

.ts-nav__links a:hover,
.ts-nav__links a:focus-visible {
  color: var(--ts-text);
}

.ts-nav__links a.is-active {
  color: var(--ts-text);
}

.ts-nav__links a:hover::after,
.ts-nav__links a:focus-visible::after,
.ts-nav__links a.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.ts-nav__cta {
  margin-left: auto;
}

.ts-surface {
  border-radius: var(--ts-radius);
  border: 1px solid var(--ts-border);
  background: var(--ts-surface);
  box-shadow: var(--ts-shadow);
  padding: 24px;
}

.ts-surface--flat {
  box-shadow: none;
}

.ts-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ts-stack--gap-sm {
  gap: 12px;
}

.ts-stack--gap-md {
  gap: 18px;
}

.ts-stack--gap-lg {
  gap: 28px;
}

.ts-flow {
  display: grid;
  gap: 18px;
}

.ts-flow--sm {
  gap: 12px;
}

.ts-flow--lg {
  gap: 24px;
}

.ts-flex-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ts-flex-column--gap-sm {
  gap: 12px;
}

.ts-flex-column--gap-md {
  gap: 24px;
}

.ts-flex-column--gap-lg {
  gap: 32px;
}

.ts-form-label {
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ts-text-muted);
}

.ts-form-hint {
  font-size: 0.85rem;
  color: var(--ts-text-muted);
}

.ts-select,
.ts-input,
.ts-textarea {
  width: min(420px, 100%);
  padding: 12px 16px;
  border-radius: var(--ts-radius);
  border: 1px solid var(--ts-border);
  background: rgba(15, 23, 42, 0.6);
  color: var(--ts-text);
  font-family: var(--ts-font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ts-select:focus,
.ts-input:focus,
.ts-textarea:focus {
  outline: none;
  border-color: var(--ts-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.ts-input--full,
.ts-select--full,
.ts-textarea--full {
  width: 100%;
}

.ts-textarea {
  min-height: 120px;
  resize: vertical;
}

.ts-alert {
  border-radius: var(--ts-radius);
  border: 1px solid rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
  padding: 16px;
}

.ts-divider {
  width: 100%;
  height: 1px;
  background: rgba(148, 163, 184, 0.12);
}

.ts-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;
}

@media (max-width: 720px) {
  .ts-section {
    width: min(640px, 92vw);
  }

  .ts-surface {
    padding: 24px;
  }

  .ts-nav {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 16px;
  }

  .ts-nav__links {
    width: 100%;
    order: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
  }

  .ts-shell__body {
    gap: 20px;
  }
}

