/* ─────────────────────────────────────────────────────────────────────────────
   TrustTunnel Portal — Premium Dark UI
   Design: teal accent, deep navy background, glassmorphism cards
───────────────────────────────────────────────────────────────────────────── */

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

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

:root {
  --bg-base:      #080C14;
  --bg-card:      #0D1520;
  --bg-elevated:  #111B2E;
  --bg-overlay:   #162035;

  --accent:       #22C5D4;
  --accent-dim:   #1A9BA8;
  --accent-glow:  rgba(34, 197, 212, 0.15);
  --accent-ring:  rgba(34, 197, 212, 0.40);

  --green:        #34D399;
  --green-soft:   rgba(52, 211, 153, 0.10);
  --green-border: rgba(52, 211, 153, 0.28);
  --amber:        #F59E0B;
  --amber-soft:   rgba(245, 158, 11, 0.10);
  --amber-border: rgba(245, 158, 11, 0.28);

  --text-primary:   #E8EFF8;
  --text-secondary: #7A90B0;
  --text-tertiary:  #4A607A;
  --text-mono:      #A8C4E0;

  --border-subtle:  rgba(255, 255, 255, 0.06);
  --border-medium:  rgba(255, 255, 255, 0.10);
  --border-accent:  rgba(34, 197, 212, 0.35);

  --radius:    18px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --font:      'Inter', system-ui, -apple-system, sans-serif;
  --mono:      'JetBrains Mono', 'Courier New', monospace;
  --ease:      cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Base ───────────────────────────────────────────────────────────────────── */

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(ellipse 800px 400px at 50% -80px, rgba(34,197,212,0.04) 0%, transparent 70%),
    var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Layout ─────────────────────────────────────────────────────────────────── */

.page {
  width: 100%;
  max-width: 500px;
  padding: 28px 20px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

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

.header { width: 100%; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-decoration: none;
  letter-spacing: -0.2px;
  transition: color 0.2s ease;
}
.logo:hover { color: var(--text-secondary); }
.logo span  { font-size: 18px; }
.logo strong { color: #ff6030; font-weight: 700; }

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

.card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.02) inset,
    0 24px 48px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(34, 197, 212, 0.025);
}

/* Subtle top-edge shimmer */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34,197,212,0.15), transparent);
  pointer-events: none;
}

/* ── Step transitions ───────────────────────────────────────────────────────── */

.step { display: none; }

.step.active {
  display: flex;
  animation: stepIn 280ms var(--ease) forwards;
}

.step.exiting {
  display: flex;
  animation: stepOut 200ms ease-in forwards;
}

@keyframes stepIn {
  from { opacity: 0; transform: translateY(16px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

@keyframes stepOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}

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

.icon-wrap {
  font-size: 52px;
  line-height: 1;
  filter: drop-shadow(0 4px 20px rgba(34, 197, 212, 0.25));
}

h1 {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.8px;
  line-height: 1.15;
  color: var(--text-primary);
}

h2 {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text-primary);
}

.subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.65;
  max-width: 340px;
}

.hint {
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: 0.1px;
}

/* ── Feature list ───────────────────────────────────────────────────────────── */

.feature-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.feature {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: left;
  letter-spacing: -0.1px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.feature:hover {
  background: var(--bg-overlay);
  border-color: var(--border-accent);
  color: var(--accent);
}

/* ── CTA Button ─────────────────────────────────────────────────────────────── */

.btn-primary {
  width: 100%;
  height: 56px;
  padding: 0 24px;
  background: var(--accent);
  color: #080C14;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  box-shadow: 0 4px 20px rgba(34, 197, 212, 0.25);
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 60%);
  pointer-events: none;
}
.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 32px rgba(34, 197, 212, 0.45), 0 0 0 1px rgba(34, 197, 212, 0.4);
  transform: translateY(-1px);
}
.btn-primary:active { transform: scale(0.975); box-shadow: 0 2px 12px rgba(34, 197, 212, 0.3); }

.btn-secondary {
  padding: 12px 28px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn-secondary:hover {
  background: var(--bg-overlay);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

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

.spinner {
  width: 52px;
  height: 52px;
  border: 2px solid rgba(34, 197, 212, 0.12);
  border-top-color: var(--accent);
  border-right-color: rgba(34, 197, 212, 0.4);
  border-radius: 50%;
  animation: spin 0.85s cubic-bezier(0.4, 0.15, 0.6, 0.85) infinite;
  box-shadow: 0 0 20px rgba(34, 197, 212, 0.2);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Trial badge ────────────────────────────────────────────────────────────── */

.trial-badge {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
}

.trial-badge-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Pulsing dot */
.trial-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5);
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0   rgba(52, 211, 153, 0.5); }
  50%       { box-shadow: 0 0 0 5px rgba(52, 211, 153, 0); }
}

/* Timer — amber when low time (toggled via JS class, or CSS alone via heuristic) */
#trialTimer {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.5px;
  color: var(--green);
  transition: color 0.3s ease;
}
.trial-badge.low #trialTimer,
.trial-badge.low { color: var(--amber); }
.trial-badge.low { background: var(--amber-soft); border-color: var(--amber-border); }
.trial-badge.low .trial-dot { background: var(--amber); animation: none; }

/* ── Credentials box ────────────────────────────────────────────────────────── */

.creds-box {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.cred-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  padding: 12px 14px;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s ease;
}
.cred-row:last-child { border-bottom: none; }
.cred-row:not(.highlight):hover { background: rgba(255,255,255,0.02); }

/* Highlighted rows (username / password) */
.cred-row.highlight {
  background: rgba(34, 197, 212, 0.05);
  border-left: 2px solid rgba(34, 197, 212, 0.5);
  position: relative;
}
.cred-row.highlight:hover { background: rgba(34, 197, 212, 0.08); }

.cred-label {
  font-size: 10.5px;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  white-space: nowrap;
}
.cred-row.highlight .cred-label { color: var(--accent); }

.cred-value {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mono);
  word-break: break-all;
  text-align: left;
}
.cred-row.highlight .cred-value {
  color: var(--accent);
  font-weight: 600;
}
.cred-password { letter-spacing: 0.5px; }

/* DNS multiline */
.cred-multiline { align-items: start; }
.dns-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}
.dns-list span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-mono);
}

/* ── Copy button ────────────────────────────────────────────────────────────── */

.copy-btn {
  padding: 5px 11px;
  background: var(--bg-elevated);
  color: var(--text-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  letter-spacing: 0.2px;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.copy-btn:hover {
  background: var(--bg-overlay);
  color: var(--accent);
  border-color: var(--border-accent);
  box-shadow: 0 0 8px rgba(34, 197, 212, 0.15);
}
.copy-btn:active { transform: scale(0.93); }

.copy-btn.copied {
  color: var(--green);
  border-color: var(--green-border);
  background: var(--green-soft);
}

/* ── Cooldown countdown ─────────────────────────────────────────────────────── */

.countdown-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.countdown {
  font-family: var(--mono);
  font-size: 58px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  line-height: 1;
  filter: drop-shadow(0 0 20px rgba(34, 197, 212, 0.4));
  letter-spacing: 2px;
}

/* ── Section divider ────────────────────────────────────────────────────────── */

.section-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-medium), transparent);
}

/* ── Download section ───────────────────────────────────────────────────────── */

.download-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.download-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--text-tertiary);
  text-align: left;
}

.download-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dl-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.18s ease, box-shadow 0.2s ease;
  position: relative;
}
.dl-btn:hover {
  background: var(--bg-overlay);
  border-color: var(--border-medium);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
.dl-btn:active { transform: scale(0.97); }

/* Detected / highlighted platform */
.dl-btn.detected {
  background: rgba(34, 197, 212, 0.07);
  border-color: var(--border-accent);
  order: -1;
  box-shadow: 0 0 20px rgba(34, 197, 212, 0.08);
}
.dl-btn.detected:hover {
  background: rgba(34, 197, 212, 0.12);
  border-color: rgba(34, 197, 212, 0.55);
}
.dl-btn.detected .dl-name { color: var(--accent); }

/* "Recommended" badge on detected button */
.dl-btn.detected::after {
  content: 'Recommended';
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(34, 197, 212, 0.12);
  border: 1px solid rgba(34, 197, 212, 0.25);
  border-radius: 4px;
  padding: 2px 6px;
}

.dl-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.dl-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  /* Push below badge on detected */
  padding-right: 60px;
}
.dl-btn:not(.detected) .dl-info { padding-right: 0; }

.dl-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}
.dl-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

@media (max-width: 440px) {
  .page      { padding: 20px 14px 60px; }
  .card      { padding: 28px 18px; }
  h1         { font-size: 24px; }
  .countdown { font-size: 44px; }
  .feature-list   { grid-template-columns: 1fr; }
  .download-grid  { grid-template-columns: 1fr; }
  .cred-row       { grid-template-columns: 60px 1fr auto; }
  .cred-label     { font-size: 10px; }
  .cred-value     { font-size: 12px; }
}

@media (max-width: 360px) {
  .card     { padding: 24px 14px; }
  .cred-row { padding: 10px 12px; gap: 8px; }
}
