/**
 * MaxBuddy — Home Screen Styles
 * "Captain Control" godkendt design — 7. marts 2026
 * Ref: DESIGN.md + playground/screens/screen-hjem.html
 */

/* ==================== TOKENS ==================== */
:root {
  --bg: #0A0A0F;
  --surface: #13131A;
  --card: #1A1A24;
  --card2: #1E1E2C;

  --primary: #E4002B;
  --primary-dim: rgba(228, 0, 43, 0.12);
  --primary-border: rgba(228, 0, 43, 0.28);
  --primary-glow: rgba(228, 0, 43, 0.45);

  --accent: #60A5FA;
  --accent-dim: rgba(96, 165, 250, 0.10);
  --accent-border: rgba(96, 165, 250, 0.22);

  --success: #10B981;
  --success-dim: rgba(16, 185, 129, 0.10);
  --success-border: rgba(16, 185, 129, 0.25);

  --warning: #F59E0B;
  --warning-dim: rgba(245, 158, 11, 0.10);
  --warning-border: rgba(245, 158, 11, 0.28);

  --text: #F9FAFB;
  --sub: #9CA3AF;
  --muted: #6B7280;
  --border: rgba(255, 255, 255, 0.06);
  --border2: rgba(255, 255, 255, 0.10);

  --tab-height: 72px;
  --sidebar-width: 260px;
}

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

/* ==================== BASE ==================== */
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==================== APP LAYOUT ==================== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ==================== SIDEBAR (desktop only) ==================== */
.app-sidebar {
  display: none;
  width: var(--sidebar-width);
  min-height: 100vh;
  background: #0D0D16;
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  flex-direction: column;
}

@media (min-width: 1024px) {
  .app-sidebar { display: flex; }
}

.sidebar-logo-area {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo-img {
  width: 100%;
  max-width: 220px;
  height: auto;
  object-fit: contain;
  display: block;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--sub);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
  border: 1px solid transparent;
  cursor: pointer;
  background: none;
  width: 100%;
  text-align: left;
}

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

.sidebar-nav-item.active {
  background: var(--primary-dim);
  color: var(--primary);
  border-color: var(--primary-border);
}

.sidebar-nav-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 10px;
}

.sidebar-log-btn {
  margin: 8px 12px;
  padding: 13px;
  background: var(--primary);
  border: none;
  border-radius: 14px;
  color: white;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(228, 0, 43, 0.4);
  transition: opacity 0.15s, transform 0.15s;
  font-family: inherit;
}

.sidebar-log-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(228, 0, 43, 0.55);
}

.sidebar-user {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}

.sidebar-user:hover { background: rgba(255, 255, 255, 0.03); }

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  border: 2px solid var(--primary-border);
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.sidebar-user-level {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

/* ==================== MAIN AREA ==================== */
.app-main {
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (min-width: 1024px) {
  .app-main {
    margin-left: var(--sidebar-width);
  }
}

/* ==================== MOBILE HEADER ==================== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 8px;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 1024px) {
  .app-header {
    display: none; /* Desktop uses topbar in content area */
  }
}

.header-logo {
  height: 28px;
  object-fit: contain;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-greeting {
  font-size: 14px;
  font-weight: 600;
  color: var(--sub);
  display: none;
}

@media (min-width: 480px) {
  .header-greeting { display: block; }
}

.notif-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 18px;
  transition: background 0.15s;
}

.notif-btn:hover { background: var(--card2); }

.notif-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  border: 2px solid var(--bg);
}

/* ==================== DESKTOP TOPBAR ==================== */
.desktop-topbar {
  display: none;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

@media (min-width: 1024px) {
  .desktop-topbar { display: flex; }
}

.topbar-greeting {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

/* ==================== SCROLL CONTENT ==================== */
.scroll-content {
  flex: 1;
  padding-bottom: calc(var(--tab-height) + 16px);
  overflow-y: auto;
}

@media (min-width: 1024px) {
  .scroll-content {
    padding: 28px 32px 60px;
    max-width: 900px;
  }
}

/* ==================== SECTION HELPERS ==================== */
.home-section {
  padding: 20px 16px 0;
}

@media (min-width: 1024px) {
  .home-section { padding: 0 0 20px; }
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.section-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.section-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.15s;
}

.section-link:hover { opacity: 0.8; }

/* ==================== SAVINGS BANNER ==================== */
.savings-banner {
  margin: 12px 16px 0;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(16, 185, 129, 0.08) 100%);
  border: 1px solid var(--success-border);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@media (min-width: 1024px) {
  .savings-banner { margin: 0 0 20px; border-radius: 18px; padding: 16px 20px; }
}

.savings-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.savings-text .savings-amount {
  color: var(--success);
  font-weight: 800;
  font-size: 15px;
}

.savings-badge {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid var(--success-border);
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ==================== HERO DEAL CARD ==================== */
.hero-deal {
  margin: 12px 16px 0;
  background: var(--card);
  border-radius: 24px;
  border: 1px solid var(--primary-border);
  overflow: hidden;
  position: relative;
}

@media (min-width: 1024px) {
  .hero-deal {
    margin: 0 0 20px;
    display: flex;
    border-radius: 20px;
    min-height: 200px;
  }
}

.hero-deal-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 2;
  letter-spacing: 0.3px;
}

.hero-img-wrap {
  background: linear-gradient(180deg, rgba(228, 0, 43, 0.06) 0%, rgba(228, 0, 43, 0.02) 100%);
  padding: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 160px;
}

@media (min-width: 1024px) {
  .hero-img-wrap {
    width: 220px;
    flex-shrink: 0;
    padding: 24px 20px;
    min-height: unset;
  }
}

.hero-deal-img {
  max-height: 140px;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(228, 0, 43, 0.2));
}

@media (min-width: 1024px) {
  .hero-deal-img { max-height: 160px; }
}

.hero-deal-body {
  padding: 0 16px 16px;
}

@media (min-width: 1024px) {
  .hero-deal-body {
    padding: 20px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

.hero-chain-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.hero-chain-logo {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  object-fit: contain;
  padding: 3px 5px;
  flex-shrink: 0;
}

.hero-chain-name {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-product-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.2;
}

@media (min-width: 1024px) {
  .hero-product-name { font-size: 20px; margin-bottom: 6px; }
}

.hero-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.hero-price {
  font-size: 32px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 1024px) {
  .hero-price { font-size: 36px; }
}

.hero-price-per {
  font-size: 13px;
  color: var(--sub);
  font-weight: 500;
}

.hero-score {
  font-size: 13px;
  color: var(--warning);
  font-weight: 700;
  margin-bottom: 6px;
}

.hero-score.score-high { color: var(--success); }
.hero-score.score-low { color: var(--primary); }

.hero-confidence {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.confidence-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  animation: confPulse 2.5s ease-in-out infinite;
}

@keyframes confPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0); }
}

.hero-cta {
  display: block;
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(228, 0, 43, 0.4);
  font-family: inherit;
  transition: opacity 0.15s, transform 0.1s;
}

.hero-cta:hover { opacity: 0.9; transform: translateY(-1px); }

@media (min-width: 1024px) {
  .hero-cta { display: inline-block; width: auto; padding: 12px 24px; font-size: 14px; }
}

/* Hero loading state */
.hero-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 20px;
  color: var(--muted);
  font-size: 13px;
}

.hero-error {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ==================== STATS SCROLL ==================== */
.stats-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 16px 4px;
  scrollbar-width: none;
}

.stats-scroll::-webkit-scrollbar { display: none; }

@media (min-width: 1024px) {
  .stats-scroll {
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    overflow-x: visible;
  }
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  min-width: 130px;
  flex-shrink: 0;
}

@media (min-width: 1024px) {
  .stat-card { min-width: unset; border-radius: 16px; padding: 16px; }
}

.stat-card.highlight {
  background: var(--success-dim);
  border-color: var(--success-border);
}

.stat-card.highlight .stat-value { color: var(--success); }

.stat-card.active-card {
  background: var(--primary-dim);
  border-color: var(--primary-border);
}

.stat-card.active-card .stat-value {
  color: var(--primary);
  font-size: 14px;
  padding-top: 3px;
}

.stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.stat-sub {
  font-size: 11px;
  color: var(--sub);
  margin-top: 4px;
}

/* ==================== NEARBY STORES ==================== */
.nearby-card {
  background: var(--card);
  border-radius: 20px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.nearby-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s;
}

.nearby-item:last-child { border-bottom: none; }
.nearby-item:hover { background: var(--card2); }

.nearby-chain-logo {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  object-fit: contain;
  padding: 4px 6px;
  flex-shrink: 0;
}

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

.nearby-store-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nearby-address {
  font-size: 12px;
  color: var(--sub);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nearby-right { text-align: right; flex-shrink: 0; }

.nearby-price {
  font-size: 16px;
  font-weight: 800;
  color: var(--success);
}

.nearby-price.price-avg { color: var(--warning); }
.nearby-price.price-high { color: var(--sub); }

.nearby-distance {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

/* Location prompt */
.nearby-location-prompt {
  padding: 24px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.location-prompt-icon { font-size: 32px; }

.location-prompt-text {
  font-size: 13px;
  color: var(--sub);
  line-height: 1.5;
  max-width: 240px;
}

.location-prompt-btn {
  background: var(--primary-dim);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  border-radius: 10px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.location-prompt-btn:hover { background: rgba(228, 0, 43, 0.2); }

/* ==================== WEEK ROW ==================== */
.week-row {
  display: flex;
  gap: 6px;
  padding: 4px 0 8px;
}

.day-circle {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.day-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card2);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  transition: background 0.2s, border-color 0.2s;
}

.day-dot.logged {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 2px 10px rgba(228, 0, 43, 0.4);
}

.day-dot.today {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-dim);
}

.day-dot.today.logged {
  background: var(--primary);
  color: white;
}

.day-name {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.week-footer {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.week-summary {
  font-size: 13px;
  color: var(--sub);
  flex: 1;
}

.week-summary .streak-fire { color: var(--warning); }

.log-quick-btn {
  background: var(--primary-dim);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s;
}

.log-quick-btn:hover { background: rgba(228, 0, 43, 0.2); }

/* ==================== MAXFEED PREVIEW ==================== */
.maxfeed-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mf-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.mf-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #FF6B6B);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.mf-content { flex: 1; min-width: 0; }

.mf-user {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.mf-text {
  font-size: 12px;
  color: var(--sub);
  margin-top: 2px;
  line-height: 1.4;
}

.mf-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.mf-xp {
  color: var(--warning);
  font-weight: 700;
}

/* ==================== LOG MODAL ==================== */
.log-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 200;
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.log-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.log-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: 28px 28px 0 0;
  border-top: 1px solid var(--border2);
  padding: 20px 20px 40px;
  z-index: 201;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh;
  overflow-y: auto;
}

@media (min-width: 1024px) {
  .log-sheet {
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 480px;
    border-radius: 28px 28px 0 0;
  }
}

.log-overlay.open .log-sheet {
  transform: translateY(0);
}

@media (min-width: 1024px) {
  .log-overlay.open .log-sheet {
    transform: translateX(-50%) translateY(0);
  }
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--border2);
  border-radius: 2px;
  margin: 0 auto 20px;
}

.modal-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
  text-align: center;
}

.modal-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.flavor-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.flavor-chip {
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--border2);
  font-size: 13px;
  font-weight: 600;
  color: var(--sub);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.flavor-chip:hover {
  background: var(--card2);
  color: var(--text);
}

.flavor-chip.active {
  background: var(--primary-dim);
  border-color: var(--primary-border);
  color: var(--primary);
}

.amount-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.amount-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border2);
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 300;
  transition: background 0.15s;
  font-family: inherit;
}

.amount-btn:hover { background: var(--card2); }

.amount-val {
  font-size: 24px;
  font-weight: 900;
  color: var(--text);
  min-width: 32px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.modal-note {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  outline: none;
  margin-bottom: 12px;
  font-family: inherit;
  height: 72px;
  resize: none;
  transition: border-color 0.15s;
}

.modal-note:focus { border-color: var(--primary-border); }

.modal-note::placeholder { color: var(--muted); }

.modal-submit {
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(228, 0, 43, 0.4);
  font-family: inherit;
  transition: opacity 0.15s, transform 0.1s;
}

.modal-submit:hover { opacity: 0.9; transform: translateY(-1px); }

.modal-auth-gate {
  padding: 32px 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.modal-auth-text {
  font-size: 14px;
  color: var(--sub);
  max-width: 280px;
  line-height: 1.5;
}

.modal-auth-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

/* ==================== XP TOAST ==================== */
.xp-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(16, 185, 129, 0.95);
  color: white;
  border-radius: 14px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  z-index: 300;
  box-shadow: 0 8px 28px rgba(16, 185, 129, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.xp-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==================== BOTTOM TAB BAR (mobile) ==================== */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--tab-height);
  background: rgba(13, 13, 18, 0.97);
  backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (min-width: 1024px) {
  .tab-bar { display: none; }
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.15s;
  text-decoration: none;
  padding-top: 8px;
  border: none;
  background: none;
  font-family: inherit;
  min-height: 44px;
}

.tab-item.active { opacity: 1; }

.tab-item:hover { opacity: 0.8; }

.tab-icon {
  font-size: 22px;
  line-height: 1;
}

.tab-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.3px;
}

.tab-item.active .tab-label { color: var(--primary); }

/* Center LOG tab */
.tab-item.tab-center {
  margin-top: -18px;
  opacity: 1;
  z-index: 10;
}

.tab-center-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 300;
  color: white;
  box-shadow: 0 4px 24px rgba(228, 0, 43, 0.55), 0 0 0 4px rgba(228, 0, 43, 0.15);
  border: 3px solid rgba(255, 255, 255, 0.15);
  line-height: 1;
}

.tab-item.tab-center .tab-label { color: var(--primary) !important; font-weight: 800; }

/* ==================== SPINNER ==================== */
.spinner-sm {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

/* ==================== SPACER ==================== */
.bottom-spacer { height: 8px; }

/* ── Modal luk-knap ── */
.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.modal-close-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--sub, #9CA3AF);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.modal-close-btn:hover { background: rgba(255,255,255,0.14); color: var(--text, #F9FAFB); }
