/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }

:root {
  /* Фоны */
  --bg-page:    #f5f0ff;
  --bg-surface: #ffffff;
  --bg-soft:    #f5f0ff;

  /* Градиенты */
  --grad-hero:   linear-gradient(135deg, #6d28d9 0%, #9333ea 40%, #db2777 80%, #f472b6 100%);
  --grad-btn:    linear-gradient(135deg, #7c3aed, #db2777);
  --grad-icon-a: linear-gradient(135deg, #7c3aed, #a855f7);
  --grad-icon-b: linear-gradient(135deg, #db2777, #f472b6);
  --grad-name:   linear-gradient(90deg, #9333ea, #ec4899);

  /* Текст */
  --text-primary:   #0d0020;
  --text-secondary: rgba(0, 0, 0, 0.55);
  --text-muted:     rgba(0, 0, 0, 0.30);
  --text-hint:      rgba(0, 0, 0, 0.20);

  /* Акценты */
  --accent-purple: #9333ea;
  --accent-pink:   #ec4899;
  --accent-soft:   #e9d5ff;

  /* Статусы */
  --status-active:  #4ade80;
  --status-warning: #fb923c;
  --status-expired: #f87171;

  /* Тени */
  --shadow-card: 0 2px 12px rgba(147, 51, 234, 0.06);

  --nav-h: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* ===== APP SHELL ===== */
#app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg-surface);
}

.view {
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  min-height: 100vh;
}

/* ===== PAGE ANIMATION ===== */
.page { animation: pageIn 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94); }

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

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 10px 0 max(20px, var(--safe-bottom));
  display: flex;
  justify-content: space-around;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 16px;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav-item .nav-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 18px;
  transition: background 0.15s;
}

.nav-item.active .nav-icon { background: var(--bg-soft); }

.nav-item .nav-label {
  font-size: 9px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.25);
  letter-spacing: 0.3px;
}

.nav-item.active .nav-label {
  color: var(--accent-purple);
  font-weight: 700;
}

/* ===== BUTTONS ===== */
button {
  font-family: 'Inter', -apple-system, sans-serif;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
button:active { transform: scale(0.97); opacity: 0.9; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 20px;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  width: 100%;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--grad-btn);
  color: #fff;
  letter-spacing: -0.2px;
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 55%);
  pointer-events: none;
}

.btn-soft, .btn-outline {
  background: var(--bg-soft);
  border: 1.5px solid var(--accent-soft);
  color: var(--accent-purple);
  font-size: 13px;
  font-weight: 600;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-soft);
  color: var(--text-secondary);
  border: 1px solid rgba(0,0,0,0.06);
  font-size: 13px;
  font-weight: 500;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 12px;
  border-radius: 12px;
}

.btn-pair { display: flex; gap: 10px; }
.btn-pair .btn { flex: 1; width: auto; }

/* ===== CARDS ===== */
.card {
  background: var(--bg-surface);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--shadow-card);
}
.card + .card { margin-top: 12px; }

.card-conn {
  background: linear-gradient(135deg, #fdf4ff, #fce7f3);
  border: 1.5px solid var(--accent-soft);
  border-radius: 20px;
  padding: 16px;
}

/* ===== HERO CARD ===== */
.hero-card {
  background: var(--grad-hero);
  border-radius: 26px;
  padding: 22px 20px;
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%);
  border-radius: 26px 26px 0 0;
  pointer-events: none;
}
.hero-card::after {
  content: '';
  position: absolute;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  top: -60px; right: -40px;
  pointer-events: none;
}

/* ===== BADGE STATUS ===== */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}

.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.badge-dot.green  { background: #4ade80; box-shadow: 0 0 6px rgba(74,222,128,0.9); }
.badge-dot.orange { background: #fb923c; box-shadow: 0 0 6px rgba(251,146,60,0.9); }
.badge-dot.red    { background: #f87171; box-shadow: 0 0 6px rgba(248,113,113,0.9); }

/* Legacy badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 600;
}
.badge-active  { background: rgba(74,222,128,0.15); color: #16a34a; }
.badge-warning { background: rgba(251,146,60,0.15); color: #ea580c; }
.badge-expired { background: rgba(248,113,113,0.15); color: #dc2626; }

/* ===== PROGRESS ===== */
.progress-track, .progress-wrap {
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-fill, .progress-bar {
  height: 100%;
  background: #fff;
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ===== NEWS ICON ===== */
.news-icon {
  width: 46px; height: 46px;
  border-radius: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.news-icon-a { background: var(--grad-icon-a); }
.news-icon-b { background: var(--grad-icon-b); }

/* ===== SECTIONS ===== */
.section { padding: 0 16px; margin-top: 14px; }

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  padding: 0 16px;
  margin-top: 20px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-purple);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 0 16px;
  margin-top: 20px;
  margin-bottom: 8px;
  display: block;
}

/* ===== INPUT ===== */
.input-field, .input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-soft);
  border: 1.5px solid var(--accent-soft);
  border-radius: 16px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  box-sizing: border-box;
}
.input-field:focus, .input:focus {
  border-color: var(--accent-purple);
  background: #fff;
}
.input-field::placeholder, .input::placeholder { color: var(--text-hint); }
textarea.input-field, textarea.input { resize: none; min-height: 80px; }

.input-group { margin-bottom: 14px; }
.input-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: #fff;
  border-radius: 14px;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  z-index: 200;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.hidden { display: none; }
.toast.error { background: #dc2626; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(16px) scale(0.95); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-box {
  background: var(--bg-surface);
  border-radius: 24px;
  padding: 24px;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-title { font-size: 18px; font-weight: 800; margin-bottom: 12px; color: var(--text-primary); }
.modal-body { font-size: 14px; line-height: 1.7; color: var(--text-secondary); }

/* ===== SPINNER ===== */
.spinner-wrap { display: flex; justify-content: center; padding: 60px 20px; }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== STEPS ===== */
.steps { list-style: none; }
.steps li {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-size: 13px;
  color: var(--text-secondary);
  align-items: flex-start;
  line-height: 1.6;
}
.steps li:last-child { border-bottom: none; }

.step-num {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--grad-btn);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== CONNECT PAGE ===== */
.sub-url-box {
  background: rgba(109, 40, 217, 0.06);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 10px;
  color: #6b21a8;
  word-break: break-all;
  font-family: monospace;
  line-height: 1.6;
  margin-bottom: 12px;
}

.copy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--grad-btn);
  border: none;
  border-radius: 18px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  padding: 15px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, background 0.2s;
  letter-spacing: -0.2px;
}
.copy-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 55%);
  pointer-events: none;
}
.copy-btn.copied { background: #16a34a; }
.copy-btn:active { transform: scale(0.98); }

#qr-container {
  display: flex;
  justify-content: center;
  padding: 16px;
  margin: 16px 0 0;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}
#qr-container canvas, #qr-container img { border-radius: 8px; }

/* ===== NEWS ===== */
.news-item {
  background: var(--bg-surface);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
}
.news-item.pinned {
  border-left: 3px solid var(--accent-pink);
  border-radius: 0 20px 20px 0;
}
.news-pin-badge {
  font-size: 9px;
  font-weight: 700;
  color: var(--accent-pink);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.news-date { font-size: 10px; color: var(--text-muted); margin-bottom: 6px; }
.news-title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.news-body { font-size: 13px; line-height: 1.7; color: var(--text-secondary); white-space: pre-wrap; }
.news-image { width: 100%; border-radius: 12px; margin-top: 12px; object-fit: cover; max-height: 200px; display: block; }

/* ===== PLAN CARDS ===== */
.plan-card {
  background: var(--bg-surface);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}
.plan-card.popular { border: 2px solid var(--accent-pink); }

.plan-popular-badge {
  display: inline-block;
  background: rgba(236, 72, 153, 0.1);
  color: var(--accent-pink);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.plan-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
.plan-info h3 { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.plan-info .plan-days { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.plan-price { font-size: 22px; font-weight: 800; color: var(--accent-purple); white-space: nowrap; }

.plan-buy-btn {
  background: var(--grad-btn);
  color: #fff;
  border: none;
  border-radius: 18px;
  padding: 14px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s;
  letter-spacing: -0.2px;
}
.plan-buy-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 55%);
  pointer-events: none;
}
.plan-buy-btn:active { transform: scale(0.98); }
.plan-buy-btn:disabled { opacity: 0.5; pointer-events: none; }

/* ===== AUTH PAGE ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at top left, rgba(217, 137, 88, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(123, 49, 70, 0.18), transparent 34%),
    linear-gradient(180deg, #f5eee6 0%, #f9f5f1 54%, #ffffff 100%);
}

.auth-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px 20px 34px;
  overflow: hidden;
}

.auth-hero-topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.auth-brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-logo-circle {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, #2f1827, #b8563a);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff4ee;
  font-size: 20px;
  box-shadow: 0 18px 34px rgba(62, 28, 35, 0.22);
}

.auth-brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.auth-status-pill {
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 248, 242, 0.64);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #603140;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 9px 12px;
  border-radius: 999px;
}

.auth-hero-copy,
.auth-hero-points {
  position: relative;
  z-index: 1;
}

.auth-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(96, 49, 64, 0.78);
  margin-bottom: 12px;
}

.auth-title {
  max-width: 320px;
  font-size: 34px;
  line-height: 1.02;
  font-family: 'Instrument Serif', Georgia, serif;
  letter-spacing: -0.05em;
  font-weight: 400;
  color: #1f1417;
  margin: 0;
}

.auth-lead {
  max-width: 310px;
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.62;
  color: var(--text-secondary);
}

.auth-hero-points {
  display: grid;
  gap: 10px;
}

.auth-point {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 252, 249, 0.68);
  border: 1px solid rgba(110, 60, 52, 0.08);
  font-size: 13px;
  line-height: 1.4;
  color: #4b2e35;
  box-shadow: 0 14px 30px rgba(62, 28, 35, 0.05);
}

.auth-point-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8f3d32, #c77b54);
  box-shadow: 0 0 0 4px rgba(184, 86, 58, 0.12);
  flex-shrink: 0;
}

.auth-hero-backdrop {
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
  pointer-events: none;
}

.auth-hero-backdrop-left {
  width: 180px;
  height: 180px;
  left: -70px;
  top: 40px;
  background: radial-gradient(circle, rgba(123, 49, 70, 0.18) 0%, rgba(123, 49, 70, 0) 72%);
}

.auth-hero-backdrop-right {
  width: 220px;
  height: 220px;
  right: -90px;
  top: -10px;
  background: radial-gradient(circle, rgba(217, 137, 88, 0.28) 0%, rgba(217, 137, 88, 0) 70%);
}

.auth-body {
  flex: 1;
  background: var(--bg-surface);
  border-radius: 34px 34px 0 0;
  padding: 26px 20px 40px;
  overflow-y: auto;
  box-shadow: 0 -12px 40px rgba(62, 28, 35, 0.06);
}

.auth-panel-intro {
  margin-bottom: 18px;
}

.auth-panel-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.auth-panel-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.auth-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 13px 14px;
  border-radius: 16px;
  background: #f8f2ec;
  border: 1px solid rgba(110, 60, 52, 0.08);
  font-size: 13px;
  line-height: 1.45;
  color: #5f4043;
}

.auth-note-mark {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2f1827, #b8563a);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
}

.auth-tabs {
  display: flex;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}
.auth-tab {
  flex: 1;
  padding: 10px 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.auth-tab.active {
  color: var(--accent-purple);
  border-bottom-color: var(--accent-purple);
}

.auth-panel { display: none; }
.auth-panel.active { display: block; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(0,0,0,0.07);
}
.auth-divider span { font-size: 12px; color: var(--text-hint); font-weight: 600; }

/* ===== PAGE HERO (gradient header for inner pages) ===== */
.page-hero {
  background: var(--grad-hero);
  padding: 22px 20px 26px;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 100%);
  pointer-events: none;
}
.page-hero-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  position: relative;
  z-index: 1;
}

.sparkle {
  position: absolute;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  pointer-events: none;
}

/* ===== INFO BOX ===== */
.info-box {
  background: var(--bg-soft);
  border: 1.5px solid var(--accent-soft);
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
}

/* ===== PWA BANNER ===== */
.pwa-banner {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: var(--bg-surface);
  border-top: 1px solid rgba(0,0,0,0.06);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  z-index: 99;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
}
.pwa-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ===== DETAILS/ACCORDION ===== */
details summary {
  cursor: pointer;
  color: var(--accent-purple);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 0;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}
details summary::-webkit-details-marker { display: none; }
details[open] summary { margin-bottom: 8px; }
.details-content {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  padding: 4px 4px 4px 8px;
  border-left: 2px solid var(--accent-soft);
}

@media (max-width: 380px) {
  .auth-hero-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-title {
    font-size: 30px;
  }

  .auth-point {
    width: 100%;
  }
}

/* ===== HELPERS ===== */
.hidden  { display: none !important; }
.mt-8   { margin-top: 8px; }
.mt-12  { margin-top: 12px; }
.mt-16  { margin-top: 16px; }
.mt-20  { margin-top: 20px; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); font-size: 13px; }
.divider { height: 1px; background: rgba(0,0,0,0.06); margin: 16px 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; }

/* ===== COPY PULSE ===== */
@keyframes pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}
.copy-success { animation: pulse 0.3s ease; }

/* ===== STATE-SPECIFIC GRADIENTS ===== */
:root {
  --grad-hero-warn:    linear-gradient(135deg, #b45309, #d97706, #db2777);
  --btn-warn:          linear-gradient(135deg, #b45309, #dc2626);
  --grad-hero-expired: linear-gradient(135deg, #991b1b, #dc2626, #9333ea);
  --grad-hero-winback: linear-gradient(135deg, #065f46, #059669, #9333ea);
  --btn-winback:       linear-gradient(135deg, #065f46, #7c3aed);
  --grad-hero-trial:   linear-gradient(135deg, #0891b2, #0e7490, #6d28d9);
}

/* ===== WYG CARD (What You Get) ===== */
.wyg-card {
  background: #f8f4ff;
  border: 1.5px solid #e9d5ff;
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.wyg-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.wyg-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.wyg-row:last-child { margin-bottom: 0; }

.wyg-icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.wyg-icon-purple { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.wyg-icon-blue   { background: linear-gradient(135deg, #2563eb, #0891b2); }
.wyg-icon-green  { background: linear-gradient(135deg, #059669, #10b981); }

.wyg-text { font-size: 13px; color: rgba(0,0,0,0.55); line-height: 1.4; }
.wyg-text strong { color: #0d0020; font-weight: 600; }

/* ===== STEPS CARD ===== */
.steps-card {
  background: #f8f4ff;
  border: 1.5px solid #e9d5ff;
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.steps-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.step-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.step-row:last-child { margin-bottom: 0; }

.step-num-sm {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #db2777);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.step-num-sm.success { background: linear-gradient(135deg, #059669, #10b981); }

.step-text { font-size: 13px; color: rgba(0,0,0,0.5); line-height: 1.5; }
.step-text strong { color: #0d0020; font-weight: 600; }

/* ===== INFO BOX VARIANTS ===== */
.ib-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.ib-text  { font-size: 12px; line-height: 1.6; }

.info-box-blue {
  background: #eff6ff;
  border: 1.5px solid rgba(59, 130, 246, 0.2);
  border-radius: 16px;
  padding: 13px 15px;
  margin-bottom: 10px;
}
.info-box-blue .ib-title { color: #1e40af; }
.info-box-blue .ib-text  { color: rgba(30, 64, 175, 0.6); }

.info-box-green {
  background: #f0fdf4;
  border: 1.5px solid rgba(74, 222, 128, 0.25);
  border-radius: 16px;
  padding: 13px 15px;
  margin-bottom: 10px;
}
.info-box-green .ib-title { color: #065f46; }
.info-box-green .ib-text  { color: rgba(6, 95, 70, 0.6); }

.info-box-amber {
  background: #fffbeb;
  border: 1.5px solid rgba(251, 191, 36, 0.3);
  border-radius: 16px;
  padding: 13px 15px;
  margin-bottom: 10px;
}
.info-box-amber .ib-title { color: #92400e; }
.info-box-amber .ib-text  { color: rgba(146, 64, 14, 0.6); }

.info-box-red {
  background: #fff1f1;
  border: 1.5px solid rgba(248, 113, 113, 0.3);
  border-radius: 16px;
  padding: 13px 15px;
  margin-bottom: 10px;
}
.info-box-red .ib-title { color: #991b1b; }
.info-box-red .ib-text  { color: rgba(153, 27, 27, 0.6); }

/* ===== AUTO-RENEWAL TOGGLE ===== */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  margin-bottom: 12px;
}

.toggle {
  position: relative;
  width: 44px; height: 26px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.12);
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle input:checked + .toggle-slider { background: var(--grad-btn); }
.toggle input:checked + .toggle-slider::after { transform: translateX(18px); }

/* ===== PLAN FEATURES ===== */
.plan-features { list-style: none; margin: 10px 0 14px; }
.plan-features li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 3px 0;
}
.plan-features li::before { content: '✓'; color: var(--accent-purple); font-weight: 700; flex-shrink: 0; }

/* ===== WINBACK TIMER ===== */
.winback-timer-wrap { text-align: center; margin: 14px 0 6px; position: relative; z-index: 1; }
.winback-timer {
  font-size: 30px; font-weight: 800; color: #fff;
  letter-spacing: 3px;
  font-variant-numeric: tabular-nums;
}
.winback-timer-label { font-size: 10px; color: rgba(255,255,255,0.5); letter-spacing: 0.5px; margin-top: 2px; }

/* ===== POST-PAYMENT SCREEN ===== */
.post-payment-emoji  { font-size: 56px; text-align: center; margin-bottom: 12px; }
.post-payment-title  { font-size: 22px; font-weight: 800; color: var(--text-primary); text-align: center; margin-bottom: 4px; }
.post-payment-sub    { font-size: 14px; color: var(--text-muted); text-align: center; margin-bottom: 24px; }

/* ===== SECTION SEPARATOR ===== */
.section-sep { height: 1px; background: rgba(0,0,0,0.05); margin: 20px 0 16px; }

@media (min-width: 960px) {
  body {
    padding: 32px;
    background:
      radial-gradient(circle at top left, rgba(147, 51, 234, 0.10), transparent 32%),
      radial-gradient(circle at top right, rgba(236, 72, 153, 0.08), transparent 28%),
      var(--bg-page);
  }

  #app {
    max-width: 1180px;
    border-radius: 32px;
    overflow: visible;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.10);
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    background: transparent;
  }

  .page-shell {
    padding: 28px 32px 40px;
  }

  #app > .view {
    grid-column: 2;
    grid-row: 1;
  }

  #app > .bottom-nav {
    grid-column: 1;
    grid-row: 1;
  }

  .page-shell-narrow {
    max-width: 900px;
    margin: 0 auto;
  }

  .view {
    min-height: auto;
    padding-bottom: 36px;
    background: var(--bg-surface);
    border-radius: 28px;
    min-height: calc(100vh - 64px);
    overflow: hidden;
  }

  .page {
    min-height: 100%;
  }

  .bottom-nav {
    position: sticky;
    top: 0;
    left: auto;
    transform: none;
    align-self: start;
    width: 100%;
    max-width: none;
    min-height: calc(100vh - 64px);
    justify-content: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 24px 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.78) 0%, rgba(255,255,255,0.92) 100%);
    border: 1px solid rgba(255,255,255,0.55);
    border-radius: 28px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 10;
  }

  .bottom-nav::before {
    content: 'Diana Access';
    display: block;
    margin-bottom: 16px;
    padding: 0 10px 14px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
  }

  .nav-item {
    width: 100%;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 16px;
  }

  .nav-item.active {
    background: rgba(147, 51, 234, 0.08);
  }

  .nav-item .nav-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    font-size: 19px;
    background: rgba(147, 51, 234, 0.06);
  }

  .nav-item .nav-label {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.5);
  }

  .content-page-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
  }

  .content-page-subtitle {
    max-width: 520px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    text-align: right;
  }

  .dashboard-layout,
  .connect-layout,
  .support-layout,
  .plans-footer-grid {
    display: grid;
    gap: 24px;
  }

  .dashboard-layout {
    grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
    align-items: start;
  }

  .dashboard-hero-col {
    position: sticky;
    top: 90px;
  }

  .dashboard-content-col > div:first-child {
    margin-top: 0 !important;
  }

  .dashboard-topbar {
    margin-bottom: 10px !important;
  }

  .dashboard-greeting {
    font-size: 38px !important;
    margin-bottom: 28px !important;
  }

  .connect-layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, 420px);
    align-items: start;
  }

  .support-layout {
    grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
    align-items: start;
  }

  .support-form-card {
    position: sticky;
    top: 90px;
  }

  .content-stack {
    display: grid;
    gap: 18px;
  }

  .connect-subscription-card {
    padding: 22px;
  }

  .plans-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
  }

  .plans-grid .plan-popular-badge {
    margin-bottom: -2px;
  }

  .plans-grid .plan-card {
    height: 100%;
    margin-bottom: 0;
  }

  .plans-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  #news-list {
    display: grid;
    gap: 14px;
  }

  .section {
    padding: 0 24px;
  }

  .section-title,
  .section-label {
    padding-left: 24px;
    padding-right: 24px;
  }

  .card,
  .card-conn,
  .plan-card,
  .news-item {
    border-radius: 24px;
  }

  .hero-card,
  .page-hero {
    border-radius: 0;
    padding-left: 24px;
    padding-right: 24px;
  }

  .hero-card {
    border-radius: 28px;
    padding: 28px 24px;
    min-height: 320px;
  }

  .pwa-banner {
    max-width: 1180px;
    border-radius: 18px 18px 0 0;
  }

  .auth-page {
    min-height: calc(100vh - 64px);
    justify-content: center;
    padding: 40px 24px;
  }

  .auth-hero {
    padding: 0 20px 28px;
  }

  .auth-body {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    border-radius: 28px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
  }
}

@media (min-width: 960px) and (max-width: 1180px) {
  .plans-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) and (max-width: 1080px) {
  #app {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .bottom-nav {
    padding-left: 12px;
    padding-right: 12px;
  }

  .page-shell {
    padding: 24px 24px 36px;
  }
}
