/* Self-hosted fonts (no CDN dependency, CSP-safe, GDPR-compliant) */
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/roboto-400.woff2') format('woff2'); }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/roboto-500.woff2') format('woff2'); }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/roboto-700.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/ibm-plex-mono-400.ttf') format('truetype'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/ibm-plex-mono-500.ttf') format('truetype'); }

/* ═══════════════════════════════════════════
   TELEPORT.LI — Swiss Typographic System
   ═══════════════════════════════════════════ */

:root {
  /* Brand — from Post.li logo */
  --brand-blue: #0060a0;
  --brand-red: #dd3b41;
  --brand-yellow: #fcd133;

  /* Surfaces */
  --bg: #f7f6f3;
  --bg-warm: #efeee9;
  --surface: #ffffff;
  --surface-raised: #ffffff;

  /* Text */
  --text: #1a1a1a;
  --text-secondary: #5c5c5c;
  --text-muted: #8a8a86;
  --text-inverse: #ffffff;

  /* Borders */
  --border: #d8d7d2;
  --border-light: #eae9e4;
  --border-heavy: #1a1a1a;

  /* Interactive */
  --accent: var(--brand-blue);
  --accent-hover: #004d80;
  --danger: var(--brand-red);
  --danger-hover: #c42f35;
  --warning: #c29100;
  --success: #1a7a4c;

  /* Spacing scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* Typography */
  --font-display: 'Roboto', 'Helvetica Neue', sans-serif;
  --font-body: 'Roboto', 'Helvetica Neue', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Menlo', monospace;

  /* Transitions */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Reset ─────────────────────────────── */

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

html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* ── Links ─────────────────────────────── */

a { color: var(--accent); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--accent-hover); }

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

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; color: var(--text); }
h1 { font-size: 2.75rem; letter-spacing: -0.02em; }
h2 { font-size: 1.75rem; letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }

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

header {
  border-bottom: 2px solid var(--border-heavy);
}

header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
  padding: var(--space-md) var(--space-xl);
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
  letter-spacing: -0.02em;
  position: relative;
}

.logo-img {
  height: 28px;
  width: auto;
}

.logo::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--brand-yellow);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.logo:hover { color: var(--text); text-decoration: none; }
.logo:hover::after { transform: scaleX(1); }

.nav-right {
  display: flex;
  gap: var(--space-lg);
  align-items: center;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.nav-right a {
  color: var(--text-secondary);
  position: relative;
  padding-bottom: 2px;
}

.nav-right a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}

.nav-right a:hover { color: var(--text); text-decoration: none; }
.nav-right a:hover::after { transform: scaleX(1); }

.nav-right .btn { color: var(--text); }
.nav-right .btn:hover { color: var(--text-inverse); }
.nav-right .btn::after { display: none; }

/* ── Main Content ──────────────────────── */

main {
  flex: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-xl);
  width: 100%;
}

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

footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: var(--space-lg) var(--space-xl);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.625rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 2px solid var(--border-heavy);
  border-radius: 0;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  text-decoration: none;
}

.btn:hover {
  background: var(--text);
  color: var(--text-inverse);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-inverse);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--text-inverse);
}

.btn-danger:hover {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
}

.btn-large {
  padding: 0.875rem 2.5rem;
  font-size: 0.9375rem;
}

.btn-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0;
  transition: color 0.2s var(--ease);
}

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

.btn-block { width: 100%; }

/* ── Hero Section ──────────────────────── */

.hero {
  text-align: center;
  padding: var(--space-3xl) 0;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(252, 209, 51, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero > * { position: relative; z-index: 1; }

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: var(--space-md);
  animation: fadeUp 0.6s var(--ease) both;
}

.hero .subtitle {
  color: var(--text-secondary);
  font-size: 1.125rem;
  font-weight: 300;
  margin-bottom: var(--space-xl);
  animation: fadeUp 0.6s var(--ease) 0.1s both;
}

.hero .btn {
  animation: fadeUp 0.6s var(--ease) 0.2s both;
}

.hint {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin-top: var(--space-md);
  animation: fadeUp 0.6s var(--ease) 0.3s both;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 300;
}

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

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-xs);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

input, select, textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  transition: border-color 0.2s var(--ease);
}

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

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
  font-weight: 300;
}

input[type="checkbox"], input[type="radio"] {
  width: auto;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%235c5c5c' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.form-row {
  display: flex;
  gap: var(--space-lg);
}

.form-row .form-group { flex: 1; }

/* ── Dropzone ──────────────────────────── */

.dropzone {
  border: 2px dashed var(--border);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  position: relative;
  margin-bottom: var(--space-lg);
  background: var(--surface);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: rgba(0, 96, 160, 0.03);
}

.dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-sm);
  opacity: 0.6;
}

.dropzone-label {
  font-weight: 500;
  color: var(--text);
  margin-bottom: var(--space-xs);
}

/* ── File List ─────────────────────────── */

.file-list {
  margin: 0 0 var(--space-lg);
  font-size: 0.875rem;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-light);
}

.file-item span:first-child {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.file-remove {
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  transition: color 0.2s var(--ease);
}

.file-remove:hover { color: var(--danger); }

/* ── Tables ────────────────────────────── */

.transfer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.transfer-table thead {
  border-bottom: 2px solid var(--border-heavy);
}

.transfer-table th {
  text-align: left;
  padding: var(--space-sm) var(--space-md) var(--space-sm) 0;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.transfer-table td {
  padding: var(--space-md) var(--space-md) var(--space-md) 0;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.transfer-table tbody tr {
  transition: background 0.15s var(--ease);
}

.transfer-table tbody tr:hover {
  background: var(--bg-warm);
}

/* ── Status Badges ─────────────────────── */

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-ready { color: var(--success); }
.status-ready::before { background: var(--success); }
.status-limit { color: var(--warning); }
.status-limit::before { background: var(--warning); }
.status-expired { color: var(--text-muted); }
.status-expired::before { background: var(--text-muted); }
.status-processing { color: var(--accent); }
.status-processing::before { background: var(--accent); animation: pulse 1.5s ease infinite; }

/* ── Cards ─────────────────────────────── */

.card {
  background: var(--surface);
  border: 2px solid var(--border);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  position: relative;
  animation: fadeUp 0.5s var(--ease) both;
}

.card h2 {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-light);
}

.card .meta {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: var(--space-lg);
}

/* ── KPI Cards ─────────────────────────── */

.kpi-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.kpi-card {
  background: var(--surface);
  border: 2px solid var(--border);
  padding: var(--space-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.5s var(--ease) both;
}

.kpi-card:nth-child(1) { animation-delay: 0s; }
.kpi-card:nth-child(2) { animation-delay: 0.08s; }
.kpi-card:nth-child(3) { animation-delay: 0.16s; }

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.kpi-card:nth-child(1)::before { background: var(--brand-blue); }
.kpi-card:nth-child(2)::before { background: var(--brand-yellow); }
.kpi-card:nth-child(3)::before { background: var(--brand-red); }

.kpi-value {
  font-family: var(--font-display);
  font-size: 2.25rem;
  line-height: 1;
  margin-bottom: var(--space-xs);
  color: var(--text);
}

.kpi-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Progress Bar ──────────────────────── */

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  overflow: hidden;
  margin-top: var(--space-sm);
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s var(--ease);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 40px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
}

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

.alert {
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  font-size: 0.875rem;
  border-left: 4px solid;
}

.alert-error {
  background: #fef2f2;
  border-color: var(--danger);
  color: #991b1b;
}

.alert-success {
  background: #f0fdf4;
  border-color: var(--success);
  color: #166534;
}

/* ── Page Headers ──────────────────────── */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 2px solid var(--border-heavy);
}

.page-header h2 { margin: 0; }

/* ── Section Headings ──────────────────── */

h3.section-title {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

/* ── Filter Bar ────────────────────────── */

.filter-bar {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.filter-bar input,
.filter-bar select {
  flex: 1;
  min-width: 140px;
  font-size: 0.8125rem;
  padding: 0.5rem 0.75rem;
}

.filter-bar select {
  min-width: 160px;
}

.filter-bar .btn {
  flex-shrink: 0;
}

/* ── Verification / Auth Cards ─────────── */

.auth-card {
  max-width: 420px;
  margin: var(--space-2xl) auto;
  background: var(--surface);
  border: 2px solid var(--border);
  padding: var(--space-xl);
  animation: fadeUp 0.5s var(--ease) both;
  position: relative;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-red));
}

.auth-card h2 {
  margin-bottom: var(--space-sm);
  padding-bottom: 0;
  border-bottom: none;
}

.auth-card hr {
  margin: var(--space-xl) 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.auth-card .subtitle {
  margin-bottom: var(--space-xl);
}

/* OTP Input */
.otp-input {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: 0.75rem;
  padding: 0.875rem;
}

/* ── Success State ─────────────────────── */

.success-card {
  text-align: center;
  padding: var(--space-2xl);
}

.success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 2px solid var(--success);
  border-radius: 50%;
  margin-bottom: var(--space-lg);
  color: var(--success);
  font-size: 1.5rem;
  animation: scaleIn 0.4s var(--ease) both;
}

.success-card h2 {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: var(--space-md);
}

.success-card p {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  font-size: 0.9375rem;
}

/* ── Download Page ─────────────────────── */

.download-card {
  max-width: 480px;
  margin: var(--space-2xl) auto;
}

.download-meta {
  display: flex;
  gap: var(--space-xl);
  padding: var(--space-md) 0;
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  font-size: 0.875rem;
}

.download-meta dt {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.download-meta dd {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

/* ── Inline Actions ────────────────────── */

.action-link {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-body);
  transition: color 0.2s var(--ease);
  padding: 0;
}

.action-link--danger { color: var(--danger); }
.action-link--danger:hover { color: var(--danger-hover); }
.action-link--warning { color: var(--warning); }
.action-link--warning:hover { color: #a67c00; }

/* ── Decorative Stripe ─────────────────── */

.brand-stripe {
  height: 3px;
  background: linear-gradient(90deg,
    var(--brand-blue) 0%,
    var(--brand-blue) 33%,
    var(--brand-yellow) 33%,
    var(--brand-yellow) 66%,
    var(--brand-red) 66%,
    var(--brand-red) 100%
  );
}

/* ── Empty State ───────────────────────── */

.empty-state {
  text-align: center;
  padding: var(--space-2xl) 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 300;
}

/* ── Animations ────────────────────────── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Stagger Utility ───────────────────── */

.stagger > * { animation: fadeUp 0.5s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: 0s; }
.stagger > *:nth-child(2) { animation-delay: 0.06s; }
.stagger > *:nth-child(3) { animation-delay: 0.12s; }
.stagger > *:nth-child(4) { animation-delay: 0.18s; }
.stagger > *:nth-child(5) { animation-delay: 0.24s; }

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

@media (max-width: 768px) {
  header nav { padding: var(--space-md); }
  main { padding: var(--space-lg) var(--space-md); }
  h1 { font-size: 2rem; }
  .hero h1 { font-size: 2.25rem; }
  .hero { padding: var(--space-2xl) 0; }
  .form-row { flex-direction: column; gap: 0; }
  .kpi-cards { grid-template-columns: 1fr; }
  .nav-right { gap: var(--space-md); font-size: 0.75rem; }
  .page-header { flex-direction: column; align-items: flex-start; gap: var(--space-md); }
  .filter-bar { flex-direction: column; }
  .download-meta { flex-direction: column; gap: var(--space-md); }
  .transfer-table { font-size: 0.75rem; }
  .transfer-table th, .transfer-table td { padding: var(--space-sm) var(--space-sm) var(--space-sm) 0; }
}
