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

:root {
  --bg-page: #020617;
  --bg-card: #0f172a;
  --bg-card-hover: #1e293b;
  --bg-input: #1e293b;
  --border-color: rgba(51, 65, 85, 0.6);
  --border-accent: rgba(59, 130, 246, 0.4);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #64748b;
  --brand-primary: #2563eb;
  --brand-hover: #1d4ed8;
  --brand-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --incy-gradient: linear-gradient(135deg, #06b6d4 0%, #2563eb 100%);
  --happ-gradient: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
  --success: #10b981;
  --amber: #f59e0b;
  --danger: #ef4444;
  --radius-2xl: 16px;
  --radius-xl: 12px;
  --radius-lg: 8px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 12px 24px 12px;
}

.container {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

/* Header (1:1 with webapp/src/components/layout/AppHeader.vue) */
.app-header-wrapper {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(30, 41, 59, 0.8);
  margin-bottom: 16px;
}

.app-header {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px;
}

.logo-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #f8fafc;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  transition: opacity 0.2s;
}

.logo-badge:hover {
  opacity: 0.9;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: #2f353b;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
  overflow: hidden;
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-text {
  display: flex;
  align-items: center;
}

.logo-tag {
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid rgba(51, 65, 85, 0.6);
  line-height: 1;
}

.cabinet-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 12px;
  background: #1e293b;
  border: 1px solid rgba(51, 65, 85, 0.7);
  border-radius: 9999px;
  color: #f8fafc;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.2s ease;
  user-select: none;
}

.cabinet-btn:hover {
  background: #334155;
  border-color: rgba(148, 163, 184, 0.4);
}

.user-avatar-icon {
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  background: #334155;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Cards (1:1 with INFRA/webapp) */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-2xl);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.card-header-flex {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid transparent;
}
.status-active {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.25);
}
.status-expired {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.25);
}

.sub-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  margin-top: 4px;
}

.sub-id {
  font-family: monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 700;
}

/* Connection Link Section */
.input-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: block;
}

.link-group {
  display: flex;
  gap: 8px;
}

.link-input {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  color: var(--text-main);
  font-family: monospace;
  font-size: 0.75rem;
  outline: none;
}

.btn-copy {
  height: 40px;
  padding: 0 16px;
  background: var(--brand-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-xl);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.btn-copy:hover {
  opacity: 0.9;
}

/* Quick Add 1-Click Buttons */
.quick-add-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.btn-deeplink {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-xl);
  color: #fff;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s, opacity 0.15s;
}
.btn-deeplink:active {
  transform: scale(0.98);
}
.btn-incy {
  background: var(--incy-gradient);
}
.btn-happ {
  background: var(--happ-gradient);
}

.btn-renew {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 10px;
  transition: background 0.2s;
}
.btn-renew:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* OS Tabs Selector (1:1 with DocsView) */
.os-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 12px 0 16px 0;
}

.os-chip {
  padding: 10px 4px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}
.os-chip svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.os-chip.active {
  background: #ffffff;
  color: #0f172a;
  border-color: #ffffff;
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* App Box inside Instructions */
.app-box {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 14px;
  margin-bottom: 10px;
}

.app-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.app-box-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
}

.app-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.app-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.4;
}

.app-links-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.app-store-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--brand-primary);
  color: #fff;
  border-radius: var(--radius-lg);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.2s;
}
.app-store-link:hover {
  opacity: 0.9;
}

.app-store-link-alt {
  background: rgba(51, 65, 85, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.app-store-link-alt:hover {
  background: rgba(71, 85, 105, 0.9);
}

/* Modal for QR Code */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 340px;
  text-align: center;
}

.qr-box {
  background: #ffffff;
  padding: 16px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0;
}
.qr-box canvas {
  display: block;
  max-width: 200px;
  max-height: 200px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #10b981;
  color: #fff;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transition: transform 0.25s ease;
  z-index: 1100;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* Features Grid & Cards */
.features-header {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.features-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feature-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px;
  border-radius: var(--radius-xl);
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.feature-item:hover {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(99, 102, 241, 0.25);
}

.feature-icon-wrapper {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.feature-icon-speed {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.feature-icon-security {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.feature-icon-devices {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.feature-icon-payment {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.feature-icon-support {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.3);
}

.feature-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 3px;
  line-height: 1.3;
}

.feature-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Footer Links */
.app-footer {
  text-align: center;
  padding: 24px 0 16px 0;
  color: var(--text-sub);
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.75rem;
  transition: color 0.2s;
}

.footer-link:hover {
  color: #ffffff;
}

/* Legal Pages Styling */
.legal-header-bar {
  margin-bottom: 20px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #a5b4fc;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 12px;
  transition: color 0.2s;
}

.back-link:hover {
  color: #ffffff;
}

.legal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-2xl);
  padding: 28px 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  margin-bottom: 20px;
}

.legal-main-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
  line-height: 1.25;
}

.legal-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.legal-section {
  margin-bottom: 20px;
}

.legal-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.legal-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 8px;
}

.legal-list {
  padding-left: 20px;
  margin-bottom: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.legal-list li {
  margin-bottom: 4px;
}

