/*
 * VibeScan Component Styles
 * Responsive shell, viewport matrix, and shared component styles.
 * Content-driven CSS with container queries.
 */

/* ===========================
   Reset & Base
   =========================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 620;
  line-height: 1.2;
  margin: 0;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

button, input, select, textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===========================
   Shell Structure
   =========================== */
.shell {
  display: flex;
  min-height: 100dvh;
}

.shell__sidebar {
  display: none;
}

.shell__main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}

.shell__content {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-md);
  width: 100%;
}

/* ===========================
   Off-canvas Mobile Drawer
   =========================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 36, 48, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-out-expo);
  z-index: 900;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(85vw, 320px);
  background: var(--color-card);
  transform: translateX(-100%);
  transition: transform var(--duration-normal) var(--ease-out-expo);
  z-index: 910;
  overflow-y: auto;
  padding: var(--space-md);
  /* The drawer is position:fixed, so it inherits none of body's safe-area padding. Top was already
     handled; left matters in landscape on a notched device (the drawer is pinned to the left edge)
     and bottom keeps the last nav item clear of the home indicator. */
  padding-top: calc(var(--space-md) + env(safe-area-inset-top));
  padding-left: calc(var(--space-md) + env(safe-area-inset-left));
  padding-bottom: calc(var(--space-md) + env(safe-area-inset-bottom));
}

.drawer.open {
  transform: translateX(0);
}

/* Mobile app bar */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  height: 56px;
  padding: 0 var(--space-md);
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
}

.app-bar__menu-btn {
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 8px;
}

.app-bar__menu-btn:focus-visible {
  outline: 2px solid var(--color-violet-start);
  outline-offset: 2px;
}

/* ===========================
   Sidebar (Desktop)
   =========================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-card);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  height: 100dvh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  padding: var(--space-md) var(--space-sm);
}

.sidebar__group-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-secondary);
  padding: var(--space-sm) var(--space-xs);
  margin-top: var(--space-md);
}

.sidebar__item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  min-height: var(--touch-target-min);
  color: var(--color-text);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out-expo);
  text-decoration: none;
}

.sidebar__item:hover {
  background: var(--color-page);
}

.sidebar__item:focus-visible {
  outline: 2px solid var(--color-violet-start);
  outline-offset: -2px;
}

.sidebar__item--active {
  background: var(--color-page);
  font-weight: 600;
}

.sidebar__item--locked {
  color: var(--color-secondary);
}

.sidebar__account {
  margin-top: auto;
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

/* Icon rail (tablet) */
.sidebar--rail {
  width: var(--sidebar-rail-width);
  padding: var(--space-sm) 4px;
  align-items: center;
}

.sidebar--rail .sidebar__item {
  flex-direction: column;
  font-size: var(--text-xs);
  gap: 2px;
  padding: var(--space-xs) 4px;
  text-align: center;
  justify-content: center;
}

.sidebar--rail .sidebar__group-label {
  display: none;
}

/* ===========================
   Touch Targets
   =========================== */
.touch-target {
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
}

/* ===========================
   Buttons
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: var(--touch-target-min);
  padding: var(--space-xs) var(--space-lg);
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out-expo),
              box-shadow var(--duration-fast) var(--ease-out-expo);
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--color-violet-start);
  outline-offset: 2px;
}

.btn:active {
  transform: scale(0.97);
}

.btn--coral {
  background: var(--gradient-coral-flame);
  color: #fff;
  box-shadow: var(--shadow-coral-glow);
}

.btn--coral:hover {
  box-shadow: 0 12px 32px -8px rgba(255, 61, 110, 0.45);
}

.btn--violet {
  background: var(--gradient-electric-violet);
  color: #fff;
  box-shadow: var(--shadow-violet-glow);
}

.btn--violet:hover {
  box-shadow: 0 12px 32px -8px rgba(139, 92, 246, 0.45);
}

.btn--ghost,
.btn--outline {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn--ghost:hover,
.btn--outline:hover {
  border-color: var(--color-secondary);
}

.btn--sunshine {
  background: var(--color-sunshine-gold);
  color: var(--color-text);
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ===========================
   Input Pill
   =========================== */
.input-pill {
  display: flex;
  align-items: center;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 6px 6px 6px var(--space-md);
  gap: var(--space-xs);
  box-shadow: var(--shadow-md);
  max-width: 560px;
  width: 100%;
}

.input-pill__input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--text-base);
  min-width: 0;
  color: var(--color-text);
}

.input-pill__input::placeholder {
  color: var(--color-secondary);
}

.input-pill__favicon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  flex-shrink: 0;
  object-fit: contain;
  opacity: 0;
  animation: favicon-appear 0.2s ease forwards;
}

@keyframes favicon-appear {
  to { opacity: 1; }
}

.input-pill__input--with-favicon {
  padding-left: var(--space-xs);
}

/* ===========================
   Cards
   =========================== */
.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

/* ===========================
   Content Sections
   Shared page-layout primitives. Blazor CSS isolation does not cascade across .razor.css
   files (each isolated stylesheet only applies to its own matching component's markup), so
   any class used by more than one page belongs here rather than duplicated per page.
   =========================== */
.section {
  padding: var(--space-3xl) var(--space-md);
}

.section__inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.section__inner--center {
  text-align: center;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.section__inner--narrow {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.section__heading {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-sm);
  text-align: center;
}

.section__subheading {
  font-size: var(--text-lg);
  color: var(--color-secondary);
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-xl);
}

/* ===========================
   Dark Band Section
   =========================== */
.section--dark {
  background: var(--color-dark-band);
  color: var(--billing-text);
  padding: var(--space-3xl) var(--space-md);
}

.section--dark .text-secondary {
  color: var(--billing-muted);
}

/* ===========================
   Prose (legal / long-form content pages)
   =========================== */
.prose {
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.7;
}

.prose h2 {
  font-size: var(--text-xl);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

.prose p,
.prose ul,
.prose ol {
  margin-bottom: var(--space-md);
  color: var(--color-secondary);
}

.prose ul,
.prose ol {
  padding-left: var(--space-lg);
}

.prose__updated {
  font-size: var(--text-sm);
  color: var(--color-secondary);
  text-align: center;
  margin-bottom: var(--space-xl);
}

/* ===========================
   Content Grid (product sub-pages, blog index, compare)
   =========================== */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.content-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.content-card h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-xs);
}

.content-card p {
  color: var(--color-secondary);
  margin: 0;
}

.content-card__link {
  display: inline-block;
  margin-top: var(--space-sm);
  font-weight: 600;
}

/* ===========================
   Status Page
   =========================== */
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
}

.status-row__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-leaf-green);
  display: inline-block;
  margin-right: var(--space-xs);
}

.status-row__label {
  display: flex;
  align-items: center;
}

.status-row__dot--up {
  background: var(--color-leaf-green);
}

.status-row__dot--down {
  background: var(--color-danger, #e5484d);
}

.status-row__dot--unknown {
  background: var(--color-text-secondary, #9a9a9a);
}

.status-monitor__heading {
  margin-top: var(--space-lg);
}

.status-monitor__subheading {
  font-size: var(--text-sm);
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
  color: var(--color-text-secondary);
}

.status-monitor__history {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.status-monitor__tick {
  width: 8px;
  height: 20px;
  border-radius: 2px;
  display: inline-block;
}

.status-monitor__tick--up {
  background: var(--color-leaf-green);
}

.status-monitor__tick--down {
  background: var(--color-danger, #e5484d);
}

.account__connected-repo-list {
  list-style: none;
  margin: var(--space-xs) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.account__connected-repo-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  font-size: var(--text-sm);
}

/* ===========================
   Contact Form
   =========================== */
.contact-form {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.contact-form label {
  font-weight: 600;
  font-size: var(--text-sm);
  display: block;
  margin-bottom: var(--space-xs);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--text-base);
  background: var(--color-card);
  color: var(--color-text);
}

.contact-form__note {
  font-size: var(--text-sm);
  color: var(--color-secondary);
}

/* ===========================
   Sub-page Hero (product pages)
   =========================== */
.hero--sub {
  padding: var(--space-3xl) var(--space-md) var(--space-lg);
  text-align: center;
}

.hero--sub h1 {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-sm);
}

.hero--sub p {
  font-size: var(--text-lg);
  color: var(--color-secondary);
  max-width: 640px;
  margin: 0 auto;
}

/* ===========================
   Pricing Page
   =========================== */
.pricing-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--color-page);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 4px;
  margin-top: var(--space-lg);
}

.pricing-toggle__option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  border-radius: var(--radius-full);
  padding: var(--space-xs) var(--space-lg);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-secondary);
  cursor: pointer;
  min-height: var(--touch-target-min);
}

.pricing-toggle__option--active {
  background: var(--color-card);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

.pricing-toggle__badge {
  font-size: var(--text-xs);
  color: var(--color-leaf-green);
  font-weight: 700;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
  align-items: stretch;
}

.pricing-card {
  position: relative;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  display: flex;
  flex-direction: column;
}

.pricing-card--popular {
  border-color: var(--color-coral-start, var(--color-violet-start));
  box-shadow: var(--shadow-lg);
}

.pricing-card__badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-coral-start, var(--color-violet-start));
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 14px;
  border-radius: var(--radius-full);
}

.pricing-card__name {
  font-size: var(--text-xl);
  margin: var(--space-sm) 0 0;
}

.pricing-card__audience {
  color: var(--color-secondary);
  font-size: var(--text-sm);
  margin: 0 0 var(--space-md);
}

.pricing-card__price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 2px;
}

.pricing-card__strike {
  font-size: var(--text-lg);
  color: var(--color-secondary);
  text-decoration: line-through;
}

.pricing-card__amount {
  font-size: var(--text-4xl);
  font-weight: 700;
  font-family: var(--font-heading);
}

.pricing-card__period {
  color: var(--color-secondary);
  font-size: var(--text-sm);
}

.pricing-card__annual {
  font-size: var(--text-sm);
  color: var(--color-secondary);
  margin: 0 0 var(--space-md);
}

.pricing-card__features {
  list-style: none;
  margin: var(--space-md) 0;
  padding: 0;
  flex: 1;
}

.pricing-card__feature {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  padding: 6px 0;
  border-top: 1px solid var(--color-border);
}

.pricing-card__feature:first-child {
  border-top: none;
}

.pricing-card__check {
  color: var(--color-leaf-green);
  flex-shrink: 0;
}

.pricing-card__cross {
  color: var(--color-secondary);
  opacity: 0.5;
  flex-shrink: 0;
}

.pricing-card__cta {
  width: 100%;
  margin-top: var(--space-md);
}

.pricing-grid__note {
  text-align: center;
  color: var(--color-secondary);
  font-size: var(--text-sm);
  margin-top: var(--space-lg);
}

/* ===========================
   Skeleton Loading
   =========================== */
.skeleton {
  background: #2A2636;
  border-radius: var(--radius-md);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.3; }
}

.skeleton--light {
  background: var(--color-border);
}

/* ===========================
   Circular Visualization
   =========================== */
.circular-viz {
  width: 160px;
  height: 160px;
  position: relative;
}

.circular-viz__ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.circular-viz__track {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 10;
}

.circular-viz__progress {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s var(--ease-out-expo);
}

.circular-viz__label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ===========================
   FAQ Accordion
   =========================== */
.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-item__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-md) 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  text-align: left;
  min-height: var(--touch-target-min);
}

.faq-item__trigger:focus-visible {
  outline: 2px solid var(--color-violet-start);
  outline-offset: 2px;
}

.faq-item__content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--duration-normal) var(--ease-out-expo);
}

.faq-item__content[aria-hidden="false"] {
  grid-template-rows: 1fr;
}

.faq-item__content-inner {
  overflow: hidden;
  padding-bottom: 0;
}

.faq-item__content[aria-hidden="false"] .faq-item__content-inner {
  padding-bottom: var(--space-md);
}

/* ===========================
   Segmented Control
   =========================== */
.segmented {
  display: inline-flex;
  background: var(--color-page);
  border-radius: var(--radius-full);
  padding: 3px;
  border: 1px solid var(--color-border);
}

.segmented__option {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  min-height: 36px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--color-secondary);
  transition: background var(--duration-fast) var(--ease-out-expo),
              color var(--duration-fast) var(--ease-out-expo);
}

.segmented__option[aria-checked="true"] {
  background: var(--color-card);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.segmented__option:focus-visible {
  outline: 2px solid var(--color-violet-start);
  outline-offset: 2px;
}

/* ===========================
   Responsive Viewport Matrix
   =========================== */

/* 320-479: Compact mobile */
@media (max-width: 479px) {
  .shell__sidebar {
    display: none;
  }

  .shell__content {
    padding: var(--space-sm);
  }

  .grid-projects {
    grid-template-columns: 1fr;
  }
}

/* 480-767: Large mobile */
@media (min-width: 480px) and (max-width: 767px) {
  .shell__sidebar {
    display: none;
  }

  .grid-projects {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 768-899: Tablet portrait */
@media (min-width: 768px) and (max-width: 899px) {
  .shell__sidebar {
    display: none;
  }

  .app-bar {
    display: flex;
  }

  .grid-projects {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 900-1199: Tablet landscape / small desktop — icon rail */
@media (min-width: 900px) and (max-width: 1199px) {
  .app-bar {
    display: none;
  }

  .shell__sidebar {
    display: block;
  }

  .shell__sidebar .sidebar {
    width: var(--sidebar-rail-width);
    padding: var(--space-sm) 4px;
    align-items: center;
  }

  .shell__sidebar .sidebar .sidebar__item {
    flex-direction: column;
    font-size: var(--text-xs);
    gap: 2px;
    padding: var(--space-xs) 4px;
    text-align: center;
    justify-content: center;
  }

  .shell__sidebar .sidebar .sidebar__group-label {
    display: none;
  }

  .grid-projects {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 1200-1599: Desktop — full sidebar */
@media (min-width: 1200px) and (max-width: 1599px) {
  .app-bar {
    display: none;
  }

  .shell__sidebar {
    display: block;
  }

  .grid-projects {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 1600+: Wide/Ultrawide */
@media (min-width: 1600px) {
  .app-bar {
    display: none;
  }

  .shell__sidebar {
    display: block;
  }

  .shell__content {
    max-width: 1440px;
  }

  .grid-projects {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Hide app bar on desktop */
@media (min-width: 900px) {
  .app-bar {
    display: none;
  }
}

/* Show app bar on mobile/tablet */
@media (max-width: 899px) {
  .app-bar {
    display: flex;
  }

  .shell__sidebar {
    display: none;
  }
}

/* ===========================
   Grid helpers
   =========================== */
.grid-projects {
  display: grid;
  gap: var(--space-md);
}

/* ===========================
   Proof / Logo Strip
   =========================== */
.proof-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
  padding: var(--space-lg) 0;
  opacity: 0.6;
}

/* ===========================
   Feature Cards Grid
   =========================== */
.feature-grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* ===========================
   Focus visible
   =========================== */
:focus-visible {
  outline: 2px solid var(--color-violet-start);
  outline-offset: 2px;
}

/* ===========================
   Container Queries
   =========================== */
.container-query {
  container-type: inline-size;
}

@container (min-width: 600px) {
  .cq-two-col {
    grid-template-columns: repeat(2, 1fr);
  }
}

@container (min-width: 900px) {
  .cq-three-col {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===========================
   Utilities
   =========================== */
.text-gradient-coral {
  background: var(--gradient-coral-flame);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-violet {
  background: var(--gradient-electric-violet);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===========================
   Three-dot Loading
   =========================== */
.loading-dots {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.loading-dots__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-secondary);
  animation: dot-pulse 1.2s ease-in-out infinite;
}

.loading-dots__dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dots__dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-pulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .loading-dots__dot {
    animation: none;
    opacity: 0.7;
  }

  .skeleton {
    animation: none;
    opacity: 0.5;
  }
}

/* ===========================
   Decorative Dots
   =========================== */
.decorative-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: var(--space-md) 0;
}

.decorative-dots__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border);
  pointer-events: none;
}

.decorative-dots__dot--active {
  width: 10px;
  height: 10px;
  background: var(--color-secondary);
}


/* ===========================
   Auth Panel
   =========================== */
.auth-panel {
  max-width: 400px;
  margin: 0 auto;
}

.auth-panel__providers {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.btn--provider {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  justify-content: center;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--duration-fast), box-shadow var(--duration-fast);
}

.btn--google {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.btn--google:hover {
  box-shadow: var(--shadow-md);
}

.btn--github {
  background: #24292e;
  border: 1px solid #24292e;
  color: #fff;
}

.btn--github:hover {
  background: #2f363d;
}

.auth-panel__divider {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
  color: var(--color-secondary);
  font-size: var(--text-sm);
}

.auth-panel__divider::before,
.auth-panel__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.auth-panel__email-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.auth-panel__input {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-card);
  color: var(--color-text);
  font-size: var(--text-base);
}

.auth-panel__input:focus {
  outline: 2px solid var(--color-coral);
  outline-offset: -1px;
}

.auth-panel__submit {
  margin-top: var(--space-xs);
}

.auth-panel__toggle {
  display: block;
  margin-top: var(--space-md);
  background: none;
  border: none;
  color: var(--color-coral);
  cursor: pointer;
  font-size: var(--text-sm);
  text-align: center;
  width: 100%;
}

.auth-panel__toggle:hover {
  text-decoration: underline;
}

.auth-panel__error {
  color: var(--severity-high);
  font-size: var(--text-sm);
  margin-bottom: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--severity-high) 10%, transparent);
}

.auth-panel__user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.auth-panel__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.auth-panel__name {
  flex: 1;
  font-weight: 500;
}

/* ===========================
   Account Page
   Blazor CSS isolation would otherwise scope these to nothing — Account.razor has no
   Account.razor.css, so every ".account__*" class it uses belongs here (same reasoning as the
   .section/.content-card primitives above).
   =========================== */
.account__header {
  margin-bottom: var(--space-xl);
}

.account__auth-prompt {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
}

.account__profile {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.account__avatar {
  border-radius: 50%;
  flex-shrink: 0;
}

.account__info {
  min-width: 0;
}

.account__name {
  font-size: var(--text-lg);
  margin: 0;
}

.account__email {
  color: var(--color-secondary);
  margin: 0;
}

.account__section {
  margin-bottom: var(--space-2xl);
}

.account__section h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-sm);
}

.account__scan-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.account__scan-item {
  display: block;
  text-decoration: none;
  color: inherit;
}

.account__scan-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-sm);
}

.account__scan-host {
  font-weight: 600;
}

.account__scan-score {
  font-weight: 700;
}

.account__scan-score--good {
  color: var(--color-success, #1a9c5b);
}

.account__scan-score--ok {
  color: var(--color-warning, #b8860b);
}

.account__scan-score--poor {
  color: var(--color-danger, #c0392b);
}

.account__scan-meta {
  display: flex;
  gap: var(--space-sm);
  color: var(--color-secondary);
  font-size: var(--text-sm);
  margin-top: var(--space-xs);
}

.account__toggle {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-secondary);
  cursor: pointer;
}

.account__new-project {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.account__new-project input {
  flex: 1 1 200px;
  padding: var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-card);
  color: inherit;
}

.account__error {
  color: var(--color-danger, #c0392b);
  font-size: var(--text-sm);
  margin: var(--space-sm) 0;
}

.account__upgrade {
  text-align: center;
}

.account__score-chart {
  margin: var(--space-sm) 0 var(--space-md);
}

.account__scan-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
  margin-top: calc(-1 * var(--space-xs));
  margin-bottom: var(--space-sm);
}

.account__link-button {
  background: none;
  border: none;
  color: var(--color-accent, #ff5a5f);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.account__link-button:hover {
  text-decoration: underline;
}
