/* ============================================================
   TimeGuardian – Wspólny design system
   Używany przez: index.html, generate_key.php,
   payment_return.php, install.php, admin panel
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;700&display=swap');

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Zmienne ────────────────────────────────────────────────── */
:root {
  --primary:   #0d5c63;
  --pDark:     #083d42;
  --pLight:    #0e6b73;
  --accent:    #f9b115;
  --aLight:    #fbc94a;
  --dark:      #0a0c12;
  --dark2:     #0f1117;
  --card:      #141721;
  --card2:     #1a1e2e;
  --border:    #252838;
  --border2:   #2e3248;
  --text:      #e8eaf0;
  --muted:     #6b7280;
  --muted2:    #9ca3af;
  --green:     #22c55e;
  --red:       #ef4444;
  --teal:      #2dd4bf;
  --radius:    12px;
  --radius-lg: 18px;
  --shadow:    0 4px 24px rgba(0,0,0,.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.3);
}

/* ── Base ───────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--dark2);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Nagłówek ───────────────────────────────────────────────── */
.tg-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--pDark) 100%);
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 0 40px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.tg-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.tg-logo-icon {
  width: 38px; height: 38px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 2px 8px rgba(249,177,21,.3);
  flex-shrink: 0;
}
.tg-logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.tg-logo-name { font-size: 18px; font-weight: 800; color: var(--accent); letter-spacing: .5px; }
.tg-logo-ver  { font-size: 10px; color: #a0d4d8; font-weight: 500; }
.tg-header-right { display: flex; align-items: center; gap: 12px; }
.tg-header-link {
  font-size: 13px; font-weight: 600; color: #a0d4d8;
  text-decoration: none; padding: 6px 12px;
  border-radius: 8px; transition: all .15s;
}
.tg-header-link:hover { background: rgba(255,255,255,.1); color: var(--text); }

/* ── Hero ───────────────────────────────────────────────────── */
.tg-hero {
  text-align: center;
  padding: 80px 20px 60px;
  position: relative;
  overflow: hidden;
}
.tg-hero::before {
  content: '';
  position: absolute;
  top: -100px; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(13,92,99,.15) 0%, transparent 70%);
  pointer-events: none;
}
.tg-hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(249,177,21,.1);
  border: 1px solid rgba(249,177,21,.3);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px; font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
}
.tg-hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.15;
}
.tg-hero h1 span { color: var(--accent); }
.tg-hero p {
  font-size: 17px;
  color: var(--muted2);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.75;
}

/* ── Karty ───────────────────────────────────────────────────── */
.tg-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s;
}
.tg-card:hover { border-color: var(--border2); }
.tg-card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tg-card-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Plany cenowe ───────────────────────────────────────────── */
.tg-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 20px;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px 70px;
}
.tg-plan {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.tg-plan:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 8px 32px rgba(13,92,99,.2);
}
.tg-plan.featured {
  border-color: var(--accent);
  background: linear-gradient(160deg, var(--card2) 0%, var(--card) 100%);
  box-shadow: 0 4px 24px rgba(249,177,21,.1);
}
.tg-plan-badge {
  position: absolute;
  top: -13px; left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 16px;
  border-radius: 20px;
  letter-spacing: 1px;
  white-space: nowrap;
}
.tg-plan-name {
  font-size: 12px; font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
}
.tg-plan-price {
  font-size: 52px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}
.tg-plan-price sup { font-size: 22px; vertical-align: top; margin-top: 10px; }
.tg-plan-price sub { font-size: 14px; color: var(--muted); font-weight: 400; }
.tg-plan-desc {
  color: var(--muted2);
  font-size: 13px;
  margin: 14px 0 22px;
  line-height: 1.6;
}
.tg-features {
  list-style: none;
  margin-bottom: 28px;
  flex: 1;
}
.tg-features li {
  padding: 7px 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.tg-features li:last-child { border: none; }
.tg-features li::before {
  content: '✓';
  color: var(--teal);
  font-weight: 700;
  font-size: 13px;
  width: 18px;
  flex-shrink: 0;
}

/* ── Przyciski ──────────────────────────────────────────────── */
.tg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .3px;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
}
.tg-btn:hover { opacity: .88; transform: translateY(-1px); }
.tg-btn:active { transform: translateY(0); }
.tg-btn-primary { background: var(--primary); color: var(--accent); }
.tg-btn-accent  { background: var(--accent);  color: #000; }
.tg-btn-ghost   {
  background: transparent;
  color: var(--muted2);
  border: 1.5px solid var(--border2);
}
.tg-btn-ghost:hover { border-color: var(--primary); color: var(--text); }
.tg-btn-danger  { background: rgba(239,68,68,.15); color: var(--red); border: 1px solid rgba(239,68,68,.3); }
.tg-btn-full    { width: 100%; }
.tg-btn-lg      { padding: 16px 28px; font-size: 15px; border-radius: 14px; }
.tg-btn-sm      { padding: 7px 14px; font-size: 12px; border-radius: 8px; }

/* ── Formularze ──────────────────────────────────────────────── */
.tg-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 6px;
  margin-top: 16px;
}
.tg-input {
  width: 100%;
  background: var(--dark);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.tg-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,92,99,.2);
}
.tg-input::placeholder { color: var(--muted); }
.tg-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' fill='none' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ── Tabela ──────────────────────────────────────────────────── */
.tg-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tg-table th {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.tg-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: middle;
}
.tg-table tr:last-child td { border: none; }
.tg-table tr:hover td { background: rgba(255,255,255,.02); }

/* ── Odznaki ─────────────────────────────────────────────────── */
.tg-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.tg-badge-active   { background: rgba(34,197,94,.12);  color: #4ade80; border: 1px solid rgba(34,197,94,.2); }
.tg-badge-expired  { background: rgba(249,177,21,.1);  color: var(--accent); border: 1px solid rgba(249,177,21,.2); }
.tg-badge-blocked  { background: rgba(239,68,68,.12);  color: #f87171; border: 1px solid rgba(239,68,68,.2); }
.tg-badge-full     { background: rgba(45,212,191,.1);  color: var(--teal); border: 1px solid rgba(45,212,191,.2); }
.tg-badge-trial    { background: rgba(249,177,21,.08); color: var(--aLight); border: 1px solid rgba(249,177,21,.15); }
.tg-badge-pending  { background: rgba(107,114,128,.1); color: var(--muted2); border: 1px solid rgba(107,114,128,.2); }
.tg-badge-paid     { background: rgba(34,197,94,.12);  color: #4ade80; border: 1px solid rgba(34,197,94,.2); }

/* ── Alerty / komunikaty ──────────────────────────────────────── */
.tg-alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.tg-alert-ok   { background: rgba(34,197,94,.1);  color: #4ade80; border: 1px solid rgba(34,197,94,.2); }
.tg-alert-err  { background: rgba(239,68,68,.1);  color: #f87171; border: 1px solid rgba(239,68,68,.2); }
.tg-alert-warn { background: rgba(249,177,21,.08); color: var(--accent); border: 1px solid rgba(249,177,21,.2); }
.tg-alert-info { background: rgba(13,92,99,.15);  color: #a0d4d8; border: 1px solid rgba(13,92,99,.3); }

/* ── Key box ─────────────────────────────────────────────────── */
.tg-key-box {
  background: rgba(13,92,99,.15);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius);
  padding: 18px 22px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 2px;
  text-align: center;
  word-break: break-all;
  cursor: pointer;
  transition: background .15s;
  user-select: all;
}
.tg-key-box:hover { background: rgba(13,92,99,.25); }

/* ── Mono tekst ─────────────────────────────────────────────── */
.tg-mono {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 12px;
  color: var(--muted2);
}

/* ── Modal ────────────────────────────────────────────────────── */
.tg-modal-bg {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.tg-modal-bg.open { display: flex; }
.tg-modal {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 100%;
  max-width: 460px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1)  translateY(0); }
}
.tg-modal-close {
  position: absolute; top: 16px; right: 18px;
  background: none; border: none;
  color: var(--muted); font-size: 22px;
  cursor: pointer; line-height: 1;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; transition: all .15s;
}
.tg-modal-close:hover { background: var(--border); color: var(--text); }
.tg-modal h3 { font-size: 20px; font-weight: 800; color: var(--accent); margin-bottom: 4px; }
.tg-modal-sub { font-size: 13px; color: var(--muted2); margin-bottom: 24px; }

/* ── Sekcja FAQ ──────────────────────────────────────────────── */
.tg-faq { max-width: 740px; margin: 0 auto; padding: 0 20px 70px; }
.tg-faq-title {
  font-size: 28px; font-weight: 800;
  color: var(--text); text-align: center;
  margin-bottom: 10px;
}
.tg-faq-title span { color: var(--accent); }
.tg-faq-sub { text-align: center; color: var(--muted2); margin-bottom: 32px; font-size: 15px; }
.tg-faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .2s;
}
.tg-faq-item:hover { border-color: var(--border2); }
.tg-faq-q {
  padding: 18px 22px;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.tg-faq-q::after { content: '+'; color: var(--accent); font-size: 20px; flex-shrink: 0; }
.tg-faq-item.open .tg-faq-q::after { content: '−'; }
.tg-faq-a {
  display: none;
  padding: 0 22px 18px;
  color: var(--muted2);
  font-size: 14px;
  line-height: 1.7;
}
.tg-faq-item.open .tg-faq-a { display: block; }

/* ── Stopka ───────────────────────────────────────────────────── */
.tg-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 28px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.tg-footer-copy { font-size: 12px; color: var(--muted); }
.tg-footer-links { display: flex; gap: 20px; }
.tg-footer-links a {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.tg-footer-links a:hover { color: var(--accent); }

/* ── Sekcja z funkcjami ───────────────────────────────────────── */
.tg-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px 60px;
}
.tg-feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  transition: border-color .2s;
}
.tg-feature-card:hover { border-color: var(--primary); }
.tg-feature-icon { font-size: 32px; margin-bottom: 12px; }
.tg-feature-title { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.tg-feature-desc  { font-size: 13px; color: var(--muted2); line-height: 1.6; }

/* ── Separator sekcji ─────────────────────────────────────────── */
.tg-section-header {
  text-align: center;
  padding: 60px 20px 36px;
}
.tg-section-header h2 {
  font-size: 30px; font-weight: 800;
  color: var(--text); margin-bottom: 10px;
}
.tg-section-header h2 span { color: var(--accent); }
.tg-section-header p { font-size: 15px; color: var(--muted2); max-width: 500px; margin: 0 auto; }

/* ── Spinner ──────────────────────────────────────────────────── */
.tg-spinner {
  width: 22px; height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsywność ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .tg-header { padding: 0 16px; }
  .tg-footer { padding: 20px 16px; flex-direction: column; align-items: center; text-align: center; }
  .tg-modal  { padding: 24px 20px; }
  .tg-plan   { padding: 24px 20px; }
  .tg-card   { padding: 20px; }
}
