/* ────────────────────────────────────────────────────────────
   TicMsg Website - Global Styles
   Dark glassmorphism theme with vibrant accents
──────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --bg: #0a0e1a;
  --bg2: #111827;
  --bg3: #1c2333;
  --glass: rgba(28, 35, 51, 0.7);
  --border: rgba(99, 120, 180, 0.18);
  --accent: #6366f1;
  --accent2: #818cf8;
  --accent3: #a78bfa;
  --success: #22d3a5;
  --warn: #f59e0b;
  --danger: #ef4444;
  --text: #e2e8f0;
  --text2: #94a3b8;
  --text3: #64748b;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  --glow: 0 0 40px rgba(99, 102, 241, 0.18);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(99, 102, 241, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 90% 90%, rgba(167, 139, 250, 0.08) 0%, transparent 50%);
}

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

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

/* ── Layout ── */
.page-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Navigation ── */
nav.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.nav-logo .logo-icon {
  color: var(--accent);
  font-size: 1.4rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text2);
  transition: all 0.2s;
}

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

.nav-links .btn-nav-cta {
  background: var(--accent);
  color: #fff;
  padding: 8px 20px;
}

.nav-links .btn-nav-cta:hover {
  background: var(--accent2);
  color: #fff;
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 100px 24px 80px;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent2);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #e2e8f0 0%, #818cf8 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text2);
  max-width: 540px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  background: var(--accent2);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
  color: #fff;
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  transform: translateY(-1px);
}

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

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

.btn-success {
  background: rgba(34, 211, 165, 0.12);
  color: var(--success);
  border: 1px solid rgba(34, 211, 165, 0.25);
}

.btn-success:hover {
  background: var(--success);
  color: #1a1a2e;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Cards ── */
.card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.card-sm {
  padding: 18px 22px;
}

/* ── Features section ── */
.features {
  padding: 60px 0;
}

.section-title {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.section-sub {
  text-align: center;
  color: var(--text2);
  margin-bottom: 48px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.feature-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(20px);
  transition: transform 0.2s, border-color 0.2s;
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.4);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.88rem;
  color: var(--text2);
  line-height: 1.6;
}

/* ── Auth Forms ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-box {
  width: 100%;
  max-width: 460px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 44px 40px;
  backdrop-filter: blur(30px);
  box-shadow: var(--shadow), var(--glow);
}

.auth-logo {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent2);
  margin-bottom: 8px;
}

.auth-title {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.auth-subtitle {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text2);
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 7px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-group textarea {
  resize: vertical;
  min-height: 90px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.5;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text3);
  margin-top: 5px;
}

.form-divider {
  text-align: center;
  color: var(--text3);
  font-size: 0.85rem;
  margin: 20px 0;
  position: relative;
}

.form-divider::before,
.form-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 24px);
  height: 1px;
  background: var(--border);
}

.form-divider::before {
  left: 0;
}

.form-divider::after {
  right: 0;
}

/* ── Alert Messages ── */
.alert {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.88rem;
  margin-bottom: 16px;
  display: none;
}

.alert.show {
  display: block;
}

.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.alert-success {
  background: rgba(34, 211, 165, 0.12);
  border: 1px solid rgba(34, 211, 165, 0.25);
  color: #6ee7b7;
}

.alert-info {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}

/* ── Dashboard ── */
.dashboard {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
  flex-wrap: wrap;
  gap: 12px;
}

.dash-greeting {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.dash-greeting span {
  color: var(--accent2);
}

.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text3);
  margin-bottom: 14px;
}

/* ── Activation key display ── */
.activation-key-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--success);
  text-align: center;
  word-break: break-all;
  margin: 16px 0;
}

/* ── Device list ── */
.device-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.device-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  transition: border-color 0.2s;
}

.device-item:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

.device-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.device-info {
  flex: 1;
  min-width: 0;
}

.device-name {
  font-size: 0.95rem;
  font-weight: 600;
}

.device-meta {
  font-size: 0.78rem;
  color: var(--text3);
  margin-top: 2px;
}

.device-actions {
  display: flex;
  gap: 8px;
}

/* ── Limit badge ── */
.device-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent2);
  margin-left: 10px;
}

.device-count-badge.full {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

/* ── Footer ── */
footer.site-footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 32px 24px;
  color: var(--text3);
  font-size: 0.85rem;
}

/* ── Spinner ── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

/* ── Step indicators ── */
.steps {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
  position: relative;
}

.steps::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 32px;
  right: 32px;
  height: 2px;
  background: var(--border);
}

.step {
  flex: 1;
  text-align: center;
  position: relative;
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg3);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-size: 0.8rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
  transition: all 0.3s;
}

.step.active .step-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.step.done .step-dot {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.step-label {
  font-size: 0.75rem;
  color: var(--text3);
}

.step.active .step-label {
  color: var(--text2);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .auth-box {
    padding: 32px 24px;
  }

  .hero {
    padding: 70px 16px 60px;
  }

  .dash-header {
    flex-direction: column;
    align-items: flex-start;
  }
}