/* ==========================================================================
   SHARELY - COMPONENTS (components.css)
   Unified Responsive Navigation + Bottom Tab Bar, Theme Toggle, Cards,
   Skeletons, Strict Hidden AdSense Slots, Forms, Toasts, Modals & Footer
   ========================================================================== */

/* 1. Unified Single Navigation Header & Floating Bar */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  height: var(--header-height, 76px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 24px;
  background: transparent;
  border-bottom: none;
  pointer-events: none;
  box-sizing: border-box;
}

.site-header.is-scrolled {
  background: transparent;
  border-bottom: none;
  box-shadow: none;
}

.nav-floating {
  pointer-events: auto;
  width: 100%;
  max-width: 1360px;
  height: 60px;
  min-height: 60px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: relative;
  transition: background 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  flex-wrap: nowrap;
}

.site-header.is-scrolled .nav-floating {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(226, 232, 240, 0.95);
  box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .nav-floating {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(51, 65, 85, 0.85);
  box-shadow: 0 4px 16px rgba(2, 6, 23, 0.45);
}

[data-theme="dark"] .site-header.is-scrolled .nav-floating {
  background: rgba(15, 23, 42, 0.94);
  border-color: rgba(71, 85, 105, 0.9);
  box-shadow: 0 10px 28px -4px rgba(2, 6, 23, 0.65);
}

@media (max-width: 1024px) {
  .nav-floating {
    padding: 0 18px;
  }
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text-main);
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
}

.brand-logo-img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
  white-space: nowrap;
  pointer-events: auto;
  z-index: 2;
}

@media (max-width: 1024px) and (min-width: 768px) {
  .nav-links {
    gap: 18px;
  }
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
  position: relative;
  padding: 6px 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.4;
}

.nav-link-icon {
  display: none;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text-main);
}

.nav-link.is-active {
  color: var(--color-accent);
}

@media (min-width: 768px) {
  .nav-link.is-active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-accent);
    border-radius: var(--radius-pill);
  }
}

/* Nav Actions, Safety Pill & Theme Toggle */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
  pointer-events: auto;
}

.nav-safety-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
  background: rgba(241, 245, 249, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  white-space: nowrap;
}

.nav-safety-pill:hover {
  background: #FFFFFF;
  color: #059669;
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.12);
  transform: translateY(-1px);
}

.nav-safety-pill.is-active {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.35);
}

[data-theme="dark"] .nav-safety-pill {
  background: rgba(30, 41, 59, 0.92);
  border-color: rgba(51, 65, 85, 0.9);
  color: #CBD5E1;
}

[data-theme="dark"] .nav-safety-pill:hover,
[data-theme="dark"] .nav-safety-pill.is-active {
  background: rgba(16, 185, 129, 0.16);
  color: #34D399;
  border-color: rgba(52, 211, 153, 0.35);
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: var(--radius-pill);
  background: rgba(241, 245, 249, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.95);
  color: var(--text-main);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.theme-toggle-btn:hover {
  background: #FFFFFF;
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-1px);
}

[data-theme="dark"] .theme-toggle-btn {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(51, 65, 85, 0.95);
  color: #F8FAFC;
}

[data-theme="dark"] .theme-toggle-btn:hover {
  background: #1E293B;
  border-color: #818CF8;
  color: #818CF8;
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.theme-icon-sun { display: none; }
.theme-icon-moon { display: block; }
[data-theme="dark"] .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-icon-moon { display: none; }

/* Mobile Unified Top Header + Bottom Tab Bar (< 768px) */
@media (max-width: 767px) {
  .site-header {
    padding: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: calc(52px + env(safe-area-inset-top)) !important;
    padding-top: env(safe-area-inset-top) !important;
    pointer-events: auto !important;
    background: transparent !important;
  }

  .nav-floating {
    width: 100% !important;
    max-width: 100% !important;
    height: 52px !important;
    min-height: 52px !important;
    padding: 0 14px !important;
    gap: 8px !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    overflow: visible !important;
  }

  [data-theme="dark"] .nav-floating {
    background: rgba(15, 23, 42, 0.96) !important;
    border-bottom-color: rgba(51, 65, 85, 0.9) !important;
    box-shadow: 0 2px 12px rgba(2, 6, 23, 0.55) !important;
  }

  .brand-link {
    gap: 8px !important;
    font-size: 15px !important;
  }

  .brand-logo-img {
    width: 24px !important;
    height: 24px !important;
    border-radius: 6px !important;
  }

  .brand-link span {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
  }

  .nav-actions {
    gap: 8px !important;
  }

  .nav-safety-pill {
    display: inline-flex !important;
    padding: 4px 10px !important;
    min-height: 36px !important;
    font-size: 12px !important;
    gap: 4px !important;
  }

  .theme-toggle-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    border-radius: 12px !important;
  }

  /* Bottom Tab Bar driven by the exact same .nav-links DOM list */
  .nav-links {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100% !important;
    height: calc(58px + env(safe-area-inset-bottom)) !important;
    padding: 4px 6px env(safe-area-inset-bottom) 6px !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    gap: 4px !important;
    background: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border-top: 1px solid var(--border-subtle) !important;
    box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.08) !important;
    z-index: 1005 !important;
    box-sizing: border-box !important;
  }

  [data-theme="dark"] .nav-links {
    background: rgba(15, 23, 42, 0.97) !important;
    border-top-color: rgba(51, 65, 85, 0.95) !important;
    box-shadow: 0 -4px 20px rgba(2, 6, 23, 0.65) !important;
  }

  .nav-links li {
    display: flex !important;
    align-items: stretch !important;
    justify-content: center !important;
    min-width: 0 !important;
  }

  .nav-link {
    width: 100% !important;
    min-height: 48px !important;
    height: 100% !important;
    padding: 4px 2px !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1.15 !important;
    border-radius: 10px !important;
    color: var(--text-secondary) !important;
    white-space: nowrap !important;
  }

  .nav-link-icon {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
  }

  .nav-link.is-active {
    background: var(--color-accent-light) !important;
    color: var(--color-accent) !important;
    font-weight: 700 !important;
  }

  .nav-link.is-active::after {
    display: none !important;
  }
}

/* 2. Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  text-decoration: none;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4338CA 0%, #4F46E5 100%);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-card);
}

[data-theme="dark"] .btn-secondary {
  background: #1E293B;
  color: #F8FAFC;
  border-color: #334155;
}

[data-theme="dark"] .btn-secondary:hover {
  background: #283548;
  border-color: #475569;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
}

.btn-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border-color: rgba(220, 38, 38, 0.25);
}

.btn-danger:hover {
  background: rgba(220, 38, 38, 0.14);
  border-color: rgba(220, 38, 38, 0.4);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 13px 26px;
  font-size: 1rem;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

@media (max-width: 767px) {
  .btn-primary,
  .home-quick-submit-btn,
  a.btn-primary,
  button.btn-primary {
    min-height: 46px !important;
    height: 46px !important;
    max-height: 46px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .btn-secondary,
  a.btn-secondary,
  button.btn-secondary {
    min-height: 42px !important;
    height: 42px !important;
    max-height: 42px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .form-hint,
  .form-error {
    font-size: 13px !important;
  }
}

/* 3. Cards & 3D Layering */
.card-3d {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.card-3d:hover {
  transform: translateY(-4px);
  border-color: var(--border-card);
  box-shadow: var(--shadow-3d);
}

/* 4. Poster Card (Link representation) */
.poster-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
  box-shadow: var(--shadow-sm);
  position: relative;
  text-decoration: none;
  color: inherit;
}

.poster-card:hover {
  transform: translateY(-4px);
  border-color: rgba(79, 70, 229, 0.35);
  box-shadow: var(--shadow-3d);
}

.poster-thumbnail-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-surface-subtle);
  overflow: hidden;
}

.poster-thumbnail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.poster-card:hover .poster-thumbnail-img {
  transform: scale(1.03);
}

.poster-badge-platform {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #0F172A;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .poster-badge-platform {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(51, 65, 85, 0.9);
  color: #F8FAFC;
}

.poster-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
  background: var(--bg-surface);
}

.poster-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.poster-card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.poster-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
  margin-top: auto;
}

.poster-clicks-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  color: var(--color-info);
}

/* 5. Universal Skeleton Loading System */
.skeleton-pulse,
.skeleton,
.skeleton-box,
.skeleton-line,
.skeleton-pill,
.skeleton-btn {
  background-color: var(--bg-surface-subtle);
  border-radius: var(--radius-sm, 6px);
  animation: skeleton-pulse 1.4s cubic-bezier(0.4, 0, 0.6, 1) infinite ease-in-out;
  pointer-events: none;
  user-select: none;
  will-change: opacity;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.42; }
}

.skeleton-poster-card,
.skeleton-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  position: relative;
  box-sizing: border-box;
}

.skeleton-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--bg-surface-subtle);
  animation: skeleton-pulse 1.4s cubic-bezier(0.4, 0, 0.6, 1) infinite ease-in-out;
}

.skeleton-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
  background: var(--bg-surface);
  box-sizing: border-box;
}

.skeleton-line {
  height: 14px;
  background-color: var(--border-subtle);
  border-radius: 4px;
  margin-bottom: 8px;
}

.skeleton-line.title { height: 18px; width: 82%; margin-bottom: 10px; }
.skeleton-line.title-sub { height: 18px; width: 52%; margin-bottom: 12px; }
.skeleton-line.desc-1 { height: 13px; width: 96%; margin-bottom: 6px; }
.skeleton-line.desc-2 { height: 13px; width: 68%; margin-bottom: 16px; }
.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 70%; }

.skeleton-pill {
  height: 22px;
  background-color: var(--border-subtle);
  border-radius: 9999px;
  display: inline-block;
}

.skeleton-btn {
  height: 32px;
  background-color: var(--border-subtle);
  border-radius: 9999px;
}

.skeleton-category-card {
  min-height: 112px;
  padding: 22px 20px;
  border-radius: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.skeleton-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg, 16px);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

.skeleton-article-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 200px;
}

.skeleton-fade-enter {
  animation: skeletonFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* 6. Strict Hidden AdSense Slot Containers (zero height/margin/label until Google marks filled) */
.ad-slot-wrapper,
.ad-slot-container,
.ad-slot {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  min-height: 0 !important;
  max-height: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  opacity: 0;
  pointer-events: none;
  box-sizing: border-box;
  transition: opacity 0.25s ease;
}

.ad-slot-wrapper .ad-label,
.ad-slot-container .ad-label,
.ad-label {
  display: none !important;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
  text-align: center;
  user-select: none;
}

.ad-slot[data-ad-status="unfilled"],
ins.adsbygoogle[data-ad-status="unfilled"],
.ad-slot-wrapper[data-ad-status="unfilled"],
.ad-slot-container[data-ad-status="unfilled"],
.ad-slot-wrapper:has([data-ad-status="unfilled"]),
.ad-slot-container:has([data-ad-status="unfilled"]) {
  display: block !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.ad-slot:empty::before {
  content: none !important;
}

.ad-slot.is-filled,
.ad-slot-wrapper.is-filled,
.ad-slot-container.is-filled,
.ad-slot-wrapper:has(ins[data-ad-status="filled"]),
.ad-slot-container:has(ins[data-ad-status="filled"]) {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
  margin: 24px auto !important;
  padding: 0 !important;
  overflow: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  text-align: center !important;
}

.ad-slot-wrapper.is-filled .ad-label,
.ad-slot-container.is-filled .ad-label,
.ad-slot.is-filled .ad-label,
.ad-slot-wrapper:has(ins[data-ad-status="filled"]) .ad-label,
.ad-slot-container:has(ins[data-ad-status="filled"]) .ad-label {
  display: block !important;
}

.ad-slot ins.adsbygoogle,
.ad-slot-container ins.adsbygoogle,
.ad-slot-wrapper ins.adsbygoogle {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

ins.adsbygoogle iframe {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.ad-banner { max-width: 728px; }
.ad-leaderboard { max-width: 970px; }
.ad-rectangle { max-width: 300px; }

@media (min-width: 768px) {
  .ad-rectangle { max-width: 336px; }
}

/* 7. Forms & Inputs */
.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-label-optional {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.95rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea {
  background: #0F172A;
  border-color: #334155;
  color: #F8FAFC;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-hint { font-size: 0.75rem; color: var(--text-muted); }
.form-error { font-size: 0.75rem; color: var(--color-danger); }

.form-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.form-checkbox-label input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--color-accent);
}

/* 8. Toasts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

@media (max-width: 767px) {
  .toast-container {
    bottom: calc(68px + env(safe-area-inset-bottom));
    right: 12px;
    left: 12px;
    align-items: stretch;
  }
}

.toast {
  pointer-events: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  color: var(--text-main);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 360px;
}

.toast.toast-success { border-left: 4px solid var(--color-success); }
.toast.toast-error { border-left: 4px solid var(--color-danger); }
.toast.toast-info { border-left: 4px solid var(--color-accent); }

@keyframes toast-slide-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 9. Modal / Dialog */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 2000;
}

.modal-overlay.is-active {
  display: flex;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: modal-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-main);
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}

.modal-close-btn:hover { color: var(--text-main); }

/* 10. FAQ Accordion */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.faq-item.is-expanded {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
}

.faq-question {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
}

.faq-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
  color: var(--text-muted);
  flex-shrink: 0;
}

.faq-icon svg,
.faq-chevron {
  display: block;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-item.is-expanded .faq-icon {
  transform: rotate(180deg);
  color: var(--color-accent);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.faq-item.is-expanded .faq-answer {
  max-height: 460px;
}

.faq-answer-inner {
  padding: 0 20px 20px 20px;
}

/* 11. Static Footer (Premium Dark Navy Theme — Brand + 3 Columns Kept) */
.site-footer {
  width: 100%;
  background: #0b1220;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: clamp(56px, 7vw, 88px) 0 36px 0;
  margin-top: auto;
  color: #e6eaf2;
  position: relative;
  box-sizing: border-box;
}

.site-footer .container {
  max-width: 1920px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(24px, 4.5vw, 80px);
  padding-right: clamp(24px, 4.5vw, 80px);
  box-sizing: border-box;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  margin-bottom: clamp(40px, 5vw, 60px);
  width: 100%;
}

@media (min-width: 640px) and (max-width: 1023px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 36px 44px;
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: clamp(24px, 3vw, 60px);
    align-items: start;
  }
}

.footer-brand .brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-bottom: 12px;
}

.footer-brand .brand-link span,
.site-footer .brand-link span {
  color: #ffffff !important;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.footer-brand p {
  color: #94a3b8;
  font-size: 0.9rem;
  margin-top: 8px;
  max-width: 460px;
  line-height: 1.65;
}

.footer-heading {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #f1f5f9;
  margin-bottom: 18px;
}

.footer-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  margin: 0;
}

.footer-nav-link {
  color: #94a3b8;
  font-size: 0.88rem;
  text-decoration: none;
  display: inline-block;
  transition: color 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.footer-nav-link:hover {
  color: #ffffff;
  transform: translateX(3px);
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 32px;
  padding-bottom: 8px;
  font-size: 0.85rem;
  color: #94a3b8;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.footer-credits {
  font-size: 0.85rem;
  color: #94a3b8;
  opacity: 0.9;
}

.footer-credits a {
  color: #cbd5e1;
  text-decoration: underline;
}

.footer-credits a:hover {
  color: #ffffff;
}

@media (max-width: 767px) {
  .site-footer {
    padding: 28px 0 calc(84px + env(safe-area-inset-bottom)) 0 !important;
    overflow: hidden !important;
  }

  .site-footer .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .footer-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px 20px !important;
    margin-bottom: 24px !important;
  }

  .footer-brand {
    grid-column: 1 / -1 !important;
  }

  .footer-bottom {
    align-items: center !important;
    text-align: center !important;
  }
}

.animation-paused { animation-play-state: paused !important; }
