:root {
  --surface-0: #0b0b0d;
  --surface-1: #17171b;
  --surface-2: #1f1f24;
  --border: rgba(255, 255, 255, 0.08);
  --text-primary: #f5f5f7;
  --text-secondary: #b4b4bc;
  --text-muted: #7a7a84;
  --brand: #e63946;
  --brand-hover: #ff5563;
  --text-success: #2ecc71;
  --bg-success: rgba(46, 204, 113, 0.12);
  --text-warning: #f39c12;
  --bg-warning: rgba(243, 156, 18, 0.12);
  --text-danger: #e74c3c;
  --bg-danger: rgba(231, 76, 60, 0.12);
  --radius: 10px;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--surface-0);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

h1, h2, h3, h4 { font-weight: 500; margin: 0 0 8px; }
p { margin: 0 0 12px; color: var(--text-secondary); }
a { color: inherit; text-decoration: none; }

label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }

input, textarea, select {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.25s var(--spring);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 0.5px solid transparent;
  transition: transform 0.25s var(--spring), background 0.25s var(--spring), border-color 0.25s var(--spring), color 0.25s var(--spring);
}
.btn:hover { transform: scale(1.03); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-secondary { background: transparent; border: 0.5px solid var(--border); color: var(--text-primary); }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }
.btn-full { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ===== Cards ===== */
.card {
  background: var(--surface-1);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: transform 0.3s var(--spring), border-color 0.3s var(--spring);
}
.card-hover:hover { transform: translateY(-4px); border-color: var(--border); }
.card-featured { border: 2px solid var(--brand); position: relative; }

.icon { transition: transform 0.3s var(--spring); display: inline-block; }
.icon:hover { transform: scale(1.15) rotate(-5deg); }

/* ===== Animations ===== */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: slideUp 0.4s var(--spring) both; }

@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.pulse-dot { animation: pulseDot 1.6s ease-in-out infinite; }

/* ===== Badges / pills ===== */
.badge { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.badge-success { background: var(--bg-success); color: var(--text-success); }
.badge-warning { background: var(--bg-warning); color: var(--text-warning); }
.badge-danger { background: var(--bg-danger); color: var(--text-danger); }
.badge-muted { background: var(--surface-2); color: var(--text-muted); }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.status-dot.success { background: var(--text-success); }
.status-dot.warning { background: var(--text-warning); }
.status-dot.danger { background: var(--text-danger); }

.alert {
  border-radius: 8px;
  padding: 13px 16px;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-danger { background: var(--bg-danger); color: var(--text-danger); }
.alert-warning { background: var(--bg-warning); color: var(--text-warning); }
.alert-success { background: var(--bg-success); color: var(--text-success); }

/* ===== Public nav / layout ===== */
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.public-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}
.logo { font-size: 20px; font-weight: 500; }
.logo .accent { color: var(--brand); }
.public-nav-links { display: flex; align-items: center; gap: 28px; font-size: 14px; color: var(--text-secondary); }
.public-nav-links a { transition: transform 0.25s var(--spring), color 0.25s var(--spring); display: inline-block; }
.public-nav-links a:hover { color: var(--text-primary); transform: translateX(3px); }

.hero { text-align: center; padding: 80px 0 60px; }
.hero-badge {
  display: inline-block;
  background: var(--surface-1);
  border: 0.5px solid var(--border);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.hero h1 { font-size: 48px; margin-bottom: 14px; letter-spacing: -1px; }
.hero .sub { font-size: 17px; max-width: 520px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.section { padding: 70px 0; }
.section-label { color: var(--brand); font-size: 12px; font-weight: 500; letter-spacing: 1.5px; text-align: center; margin-bottom: 10px; }
.section-title { text-align: center; font-size: 32px; margin-bottom: 44px; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.step-card { text-align: center; }
.step-num {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-danger);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-weight: 500;
  margin: 0 auto 14px;
}

.bundle-banner {
  border: 2px solid var(--brand);
  border-radius: 12px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.bundle-banner .badge-brand { background: var(--brand); color: #fff; }

.faq-item { }
.faq-item h4 { font-size: 15px; margin-bottom: 6px; }

.cta-footer { text-align: center; padding: 80px 0; }
.cta-footer h2 { font-size: 32px; }

.site-footer {
  border-top: 0.5px solid var(--border);
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 13px;
  flex-wrap: wrap;
  gap: 10px;
}
.site-footer a { transition: color 0.25s var(--spring); }
.site-footer a:hover { color: var(--text-primary); }

/* ===== Tier toggle ===== */
.tier-toggle {
  display: inline-flex;
  background: var(--surface-1);
  border: 0.5px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  margin: 0 auto 40px;
  gap: 4px;
}
.tier-toggle button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 9px 20px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  position: relative;
  transition: background 0.25s var(--spring), color 0.25s var(--spring);
}
.tier-toggle button.active { background: var(--brand); color: #fff; }
.tier-toggle .save-badge {
  position: absolute;
  top: -9px; right: -6px;
  background: var(--text-success);
  color: #06210f;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: 600;
}
.tier-toggle-wrap { text-align: center; }

/* ===== Pricing cards ===== */
.price-card { text-align: center; display: flex; flex-direction: column; }
.price-card .product-icon { font-size: 30px; margin-bottom: 10px; }
.price-card .tagline { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }
.price-card .price-num { font-size: 40px; font-weight: 500; transition: opacity 0.2s var(--spring), transform 0.2s var(--spring); }
.price-card .price-period { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.price-card .price-original { font-size: 13px; color: var(--text-muted); text-decoration: line-through; display: none; }
.price-card .price-permonth { font-size: 12px; color: var(--text-success); display: none; margin-bottom: 10px; }
.price-card hr { border: none; border-top: 0.5px solid var(--border); margin: 18px 0; }
.price-card .feature-list { list-style: none; padding: 0; margin: 0 0 20px; text-align: left; flex: 1; }
.price-card .feature-list li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }
.price-card .feature-list li .check { color: var(--brand); flex-shrink: 0; }
.price-fade { animation: priceFade 0.3s var(--spring); }
@keyframes priceFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.popular-badge {
  position: absolute;
  top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 14px;
  border-radius: 999px;
}

/* ===== Login page ===== */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.login-center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.login-card {
  width: 380px;
  background: var(--surface-1);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  cursor: pointer;
  transition: border-color 0.3s var(--spring);
}
.login-card.expanded { cursor: default; }
.login-card-header { display: flex; align-items: center; gap: 14px; }
.login-lock { font-size: 22px; }
.login-card-header h2 { font-size: 17px; margin: 0; }
.login-card-header .sub { font-size: 13px; margin: 2px 0 0; }
.click-hint { font-size: 12px; color: var(--text-muted); margin-top: 14px; display: flex; align-items: center; gap: 6px; transition: transform 0.25s var(--spring); }
.login-card:hover .click-hint { transform: translateX(3px); }
.login-form {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--spring), opacity 0.35s var(--spring), margin-top 0.4s var(--spring);
}
.login-card.expanded .login-form { max-height: 400px; opacity: 1; margin-top: 20px; }
.login-form .form-group { margin-bottom: 14px; }
.login-divider { border: none; border-top: 0.5px solid var(--border); margin: 18px 0; }
.login-footer-note { text-align: center; font-size: 13px; color: var(--text-muted); }
.support-note { text-align: center; color: var(--text-muted); font-size: 12px; margin-top: 24px; }

/* ===== Dashboard layout ===== */
.app-shell { display: flex; min-height: 100vh; }
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 64px;
  background: var(--surface-0);
  border-bottom: 0.5px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  z-index: 20;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.sidebar {
  position: fixed; top: 64px; bottom: 0; left: 0; width: 220px;
  background: var(--surface-0);
  border-right: 0.5px solid var(--border);
  padding: 20px 12px;
  overflow-y: auto;
}
.sidebar a, .sidebar .sidebar-label {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 2px;
  transition: transform 0.25s var(--spring), background 0.25s var(--spring), color 0.25s var(--spring);
}
.sidebar a:hover { transform: translateX(3px); background: var(--surface-1); color: var(--text-primary); }
.sidebar a.active { background: var(--surface-1); color: var(--text-primary); }
.sidebar-label { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; margin: 18px 0 6px; }
.sidebar hr { border: none; border-top: 0.5px solid var(--border); margin: 14px 0; }
.main-content { margin-left: 220px; margin-top: 64px; padding: 32px; flex: 1; max-width: 1000px; }

.days-bar { background: var(--surface-2); border-radius: 999px; height: 8px; overflow: hidden; margin: 10px 0; }
.days-bar-fill { background: var(--brand); height: 100%; border-radius: 999px; transition: width 0.4s var(--spring); }

.locked-icon { filter: grayscale(1); opacity: 0.5; }

/* ===== Account page ===== */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-grid .field label { margin-bottom: 4px; }
.field-grid .field .value { font-size: 14px; color: var(--text-primary); }

.license-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
  border-bottom: 0.5px solid var(--border);
  flex-wrap: wrap; gap: 10px;
}
.license-row:last-child { border-bottom: none; }
.license-key { font-family: monospace; font-size: 14px; }

.danger-zone { border: 1px solid var(--text-danger); }

.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 13px;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.35s var(--spring), opacity 0.3s var(--spring);
  z-index: 50;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ===== Portal page ===== */
.file-card { text-align: center; }
.file-card .icon { font-size: 30px; margin-bottom: 10px; }
.file-card h4 { font-size: 14px; }
.file-card p { font-size: 12px; }

.credential-box {
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-family: monospace;
  font-size: 13px;
  word-break: break-all;
}

.tabs { display: flex; gap: 6px; margin-bottom: 20px; border-bottom: 0.5px solid var(--border); }
.tab-btn {
  background: transparent; border: none; color: var(--text-secondary);
  padding: 10px 16px; cursor: pointer; font-size: 13px;
  border-bottom: 2px solid transparent;
  transition: color 0.25s var(--spring), border-color 0.25s var(--spring);
}
.tab-btn.active { color: var(--brand); border-color: var(--brand); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.step-list { list-style: none; padding: 0; counter-reset: step; }
.step-list li {
  counter-increment: step;
  padding: 10px 0 10px 36px;
  position: relative;
  font-size: 14px;
  color: var(--text-secondary);
  transition: transform 0.25s var(--spring);
}
.step-list li:hover { transform: translateX(4px); }
.step-list li::before {
  content: counter(step);
  position: absolute; left: 0; top: 8px;
  width: 24px; height: 24px;
  background: var(--surface-2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--brand);
}
.video-placeholder {
  aspect-ratio: 16/9;
  background: var(--surface-2);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  position: relative;
}

/* ===== Checkout / payment (shared with license-server style) ===== */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.plan-card { background: var(--surface-2); border: 2px solid var(--border); border-radius: var(--radius); padding: 18px; cursor: pointer; text-align: center; transition: border-color 0.25s var(--spring); }
.plan-card.selected { border-color: var(--brand); }
.plan-card .price { font-size: 22px; font-weight: 500; }
.plan-card .price span { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.tier-row { display: flex; gap: 8px; margin-top: 10px; justify-content: center; }
.summary-box { background: var(--surface-2); border: 0.5px solid var(--border); border-radius: var(--radius); padding: 16px; }
.summary-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; }
.summary-row.total { font-size: 16px; font-weight: 500; border-top: 0.5px solid var(--border); margin-top: 8px; padding-top: 8px; }
.pay-address-box { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 0.5px solid var(--border); border-radius: 8px; padding: 12px; font-family: monospace; font-size: 15px; word-break: break-all; }
.qr-box { text-align: center; margin: 20px 0; }
.qr-box img { border-radius: 6px; background: #fff; padding: 8px; }
.countdown-timer { text-align: center; font-size: 28px; font-weight: 500; margin: 14px 0; }
.countdown-timer.urgent { color: var(--text-danger); }
.status-banner { padding: 14px; border-radius: var(--radius); text-align: center; font-weight: 500; margin-bottom: 20px; }
.result-card { background: var(--surface-1); border: 0.5px solid var(--border); border-radius: var(--radius); padding: 40px; text-align: center; }
.result-icon { font-size: 48px; margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.form-group.full-width { grid-column: 1 / -1; }
.collapsible-toggle { cursor: pointer; color: var(--brand); font-size: 13px; margin: 10px 0; display: inline-block; }

@media (max-width: 860px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .field-grid { grid-template-columns: 1fr; }
}
