/* TruckyBeach — közös webes design system */

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

:root {
  --bg:            #0a0f1e;
  --bg-card:       #111827;
  --bg-card-hover: #141f30;
  --bg-input:      #0d1424;
  --border:        #1f2d45;
  --border-focus:  #f59e0b;
  --text:          #e2e8f0;
  --text-muted:    #64748b;
  --text-sub:      #94a3b8;
  --accent:        #f59e0b;
  --accent-hover:  #d97706;
  --accent-dim:    rgba(245,158,11,0.12);
  --success:       #22c55e;
  --success-dim:   rgba(34,197,94,0.12);
  --error:         #ef4444;
  --error-dim:     rgba(239,68,68,0.12);
  --info:          #38bdf8;
  --info-dim:      rgba(56,189,248,0.12);
  --radius:        10px;
  --radius-sm:     6px;
  --font:          -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono:     'Consolas', 'JetBrains Mono', 'Cascadia Code', monospace;
  --shadow:        0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm:     0 2px 8px rgba(0,0,0,0.3);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

/* ─── Header ───────────────────────────────────── */

.tb-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(10,15,30,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  height: 58px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.tb-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.tb-logo-icon {
  font-size: 20px;
  line-height: 1;
}

.tb-logo:hover { color: var(--accent); }

.tb-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.tb-nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.tb-nav-link:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.tb-nav-link.active {
  color: var(--accent);
  background: var(--accent-dim);
}

/* ─── Page layouts ──────────────────────────────── */

.tb-page-center {
  min-height: calc(100dvh - 58px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
}

.tb-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}

.tb-section {
  padding: 64px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ─── Card ──────────────────────────────────────── */

.tb-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 480px;
}

.tb-card-wide  { max-width: 640px; }
.tb-card-full  { max-width: 100%; }

.tb-card-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.tb-card-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ─── State containers (loading / success / error) ─ */

.tb-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 8px 0;
}

/* ─── Icon circles ──────────────────────────────── */

.tb-icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  flex-shrink: 0;
}

.tb-icon-circle.success { background: var(--success-dim); color: var(--success); }
.tb-icon-circle.error   { background: var(--error-dim);   color: var(--error); }
.tb-icon-circle.accent  { background: var(--accent-dim);  color: var(--accent); }
.tb-icon-circle.info    { background: var(--info-dim);    color: var(--info); }

/* ─── Typography ────────────────────────────────── */

.tb-h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.2; }
.tb-h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }
.tb-h3 { font-size: 17px; font-weight: 600; }
.tb-h4 { font-size: 14px; font-weight: 600; }

.tb-text-muted { color: var(--text-muted); font-size: 14px; }
.tb-text-sub   { color: var(--text-sub);   font-size: 13px; }

/* ─── Forms ─────────────────────────────────────── */

.tb-form { display: flex; flex-direction: column; gap: 18px; width: 100%; }

.tb-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.tb-form-group { display: flex; flex-direction: column; gap: 6px; }

.tb-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.tb-label span.req { color: var(--accent); margin-left: 2px; }

.tb-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  padding: 10px 14px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -webkit-appearance: none;
}

.tb-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.12);
}

.tb-input::placeholder { color: var(--text-muted); opacity: 0.7; }

.tb-input.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px var(--error-dim);
}

/* Checkbox */
.tb-checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.tb-checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.tb-checkbox-group .tb-checkbox-label {
  font-size: 13px;
  color: var(--text-sub);
  cursor: pointer;
  user-select: none;
}

.tb-checkbox-group .tb-checkbox-label a {
  color: var(--accent);
}

/* Field hint */
.tb-field-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── Buttons ────────────────────────────────────── */

.tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, opacity 0.15s, transform 0.1s;
  white-space: nowrap;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.tb-btn:active:not(:disabled) { transform: scale(0.98); }

.tb-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tb-btn-primary {
  background: var(--accent);
  color: #0a0f1e;
}

.tb-btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  color: #0a0f1e;
}

.tb-btn-secondary {
  background: rgba(255,255,255,0.07);
  color: var(--text);
  border: 1px solid var(--border);
}

.tb-btn-secondary:hover:not(:disabled) {
  background: rgba(255,255,255,0.12);
  color: var(--text);
}

.tb-btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.tb-btn-ghost:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.tb-btn-danger {
  background: var(--error-dim);
  color: var(--error);
  border: 1px solid rgba(239,68,68,0.25);
}

.tb-btn-danger:hover:not(:disabled) {
  background: rgba(239,68,68,0.2);
}

.tb-btn-full { width: 100%; }
.tb-btn-sm   { padding: 7px 14px; font-size: 13px; }
.tb-btn-lg   { padding: 13px 28px; font-size: 16px; }

/* ─── Spinner ────────────────────────────────────── */

.tb-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: tb-spin 0.75s linear infinite;
  flex-shrink: 0;
}

.tb-spinner-sm {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

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

/* ─── Alerts ─────────────────────────────────────── */

.tb-alert {
  border-radius: 8px;
  font-size: 13px;
  padding: 12px 16px;
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}

.tb-alert-error   { background: var(--error-dim);   border: 1px solid rgba(239,68,68,0.25);  color: #fca5a5; }
.tb-alert-success { background: var(--success-dim); border: 1px solid rgba(34,197,94,0.25);  color: #86efac; }
.tb-alert-info    { background: var(--info-dim);    border: 1px solid rgba(56,189,248,0.25); color: #7dd3fc; }
.tb-alert-warn    { background: var(--accent-dim);  border: 1px solid rgba(245,158,11,0.25); color: #fde68a; }

/* ─── Actions row ────────────────────────────────── */

.tb-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

/* ─── Divider ────────────────────────────────────── */

.tb-divider {
  border: none;
  border-top: 1px solid var(--border);
  width: 100%;
}

.tb-divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
  width: 100%;
}

.tb-divider-text::before,
.tb-divider-text::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}

/* ─── Badge ──────────────────────────────────────── */

.tb-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  white-space: nowrap;
}

.tb-badge-accent  { background: var(--accent-dim);  color: var(--accent); }
.tb-badge-success { background: var(--success-dim); color: var(--success); }
.tb-badge-error   { background: var(--error-dim);   color: var(--error); }
.tb-badge-muted   { background: rgba(255,255,255,0.07); color: var(--text-muted); }

/* ─── Stat chip ──────────────────────────────────── */

.tb-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.tb-stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
}

.tb-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ─── Feature card ───────────────────────────────── */

.tb-feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s, background 0.2s;
}

.tb-feature-card:hover {
  border-color: rgba(245,158,11,0.3);
  background: var(--bg-card-hover);
}

.tb-feature-icon {
  font-size: 28px;
  margin-bottom: 12px;
  display: block;
}

.tb-feature-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.tb-feature-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ─── News card ──────────────────────────────────── */

.tb-news-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tb-news-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tb-news-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.tb-news-body {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Table ──────────────────────────────────────── */

.tb-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.tb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tb-table th {
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.tb-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(31,45,69,0.5);
  color: var(--text);
  vertical-align: middle;
}

.tb-table tr:last-child td { border-bottom: none; }

.tb-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.tb-table .rank-col {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  width: 48px;
}

.tb-table .rank-1 { color: #fbbf24; }
.tb-table .rank-2 { color: #94a3b8; }
.tb-table .rank-3 { color: #cd7f32; }

/* ─── Skeleton loading ───────────────────────────── */

.tb-skeleton {
  background: linear-gradient(90deg, var(--border) 25%, rgba(31,45,69,0.8) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: tb-shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes tb-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Footer ─────────────────────────────────────── */

.tb-footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 2;
}

.tb-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.tb-footer a:hover { color: var(--accent); }

.tb-footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* ─── Utils ──────────────────────────────────────── */

.hidden { display: none !important; }
.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;
}

.tb-link-sm {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}

.tb-link-sm:hover { color: var(--accent); }

.tb-mono {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-sub);
}

/* ─── Responsive ─────────────────────────────────── */

@media (max-width: 640px) {
  .tb-card        { padding: 24px 18px; }
  .tb-section     { padding: 40px 16px; }
  .tb-h1          { font-size: 24px; }
  .tb-h2          { font-size: 19px; }
  .tb-form-row    { grid-template-columns: 1fr; }
  .tb-nav-link    { padding: 6px 8px; font-size: 12px; }
  .tb-header      { padding: 0 16px; }
}

@media (max-width: 480px) {
  .tb-btn-lg { padding: 12px 20px; font-size: 15px; }
}
