/* ==========================================================================
   BayToDeal — Landing page
   Design system: Lago.dev-inspired, mobile-first
   ========================================================================== */

:root {
  /* Colors */
  --color-bg: #fffdfb;
  --color-bg-alt: #f7f5f2;
  --color-surface: #ffffff;
  --color-primary: #0a0a0f;
  --color-primary-soft: #2a2a35;
  --color-text: #14141a;
  --color-text-muted: #63636f;
  --color-border: #ecebe8;
  --color-accent: #3b5bfe;
  --color-accent-dark: #2c46d1;
  --color-accent-soft: #eef1ff;
  --color-danger: #e0384c;
  --color-danger-soft: #fdecee;

  /* Activity-toast type colors — one per ActivityToast.type, so each toast
     card and its admin list badge are recognizable at a glance without
     reading the text. Buyer reuses --color-accent (blue); the rest are new. */
  --color-toast-seller: #b45309;
  --color-toast-seller-soft: #fdf1e0;
  --color-toast-offer: #1a8a4a;
  --color-toast-offer-soft: #e6f7ec;
  --color-toast-request: #7c3aed;
  --color-toast-request-soft: #f3ecfe;

  /* Hero gradient — cream -> peach -> pink, subtle */
  --gradient-hero: linear-gradient(135deg, #fff8ef 0%, #ffe9d9 45%, #ffdce8 100%);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(20, 20, 26, 0.05);
  --shadow-md: 0 8px 24px rgba(20, 20, 26, 0.08);
  --shadow-lg: 0 16px 48px rgba(20, 20, 26, 0.12);

  /* Radius */
  --radius-pill: 999px;
  --radius-card: 20px;
  --radius-input: 16px;

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* Layout */
  --container-max: 1200px;
  --header-height: 64px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea, select {
  font-family: inherit;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 48px 0;
}

.section-heading {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-subheading {
  margin: 0 0 28px;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.section-alt {
  background: var(--color-bg-alt);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ==========================================================================
   Preloader
   ========================================================================== */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.preloader.is-hiding {
  opacity: 0;
}

.preloader.is-done {
  display: none;
}

.preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.preloader-mark {
  width: 56px;
  height: 56px;
}

.preloader-mark-path {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  /* stroke-dasharray/dashoffset are set from JS using the path's exact
     measured length (getTotalLength), not a hand-estimated number — an
     estimate that's even slightly off leaves a visible gap or seam where
     the diamond should close cleanly at its last corner. */
  transition: stroke-dashoffset 0.6s cubic-bezier(.65, 0, .35, 1);
}

.preloader-mark-dot {
  fill: var(--color-accent);
  opacity: 0;
  transform-origin: 50px 50px;
  animation: popDot 0.3s ease forwards 0.6s;
}

.preloader-word {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-text-muted);
  opacity: 0;
  animation: fadeUp 0.4s ease forwards 0.7s;
}

@keyframes popDot {
  from { opacity: 0; transform: scale(0); }
  to { opacity: 1; transform: scale(1); }
}

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

[data-animate] {
  opacity: 0;
  animation: fadeUp 0.7s cubic-bezier(.22, .61, .36, 1) forwards;
}

[data-animate="1"] { animation-delay: 0.95s; }
[data-animate="2"] { animation-delay: 1.05s; }
[data-animate="3"] { animation-delay: 1.15s; }
[data-animate="4"] { animation-delay: 1.25s; }
[data-animate="5"] { animation-delay: 1.35s; }

@media (prefers-reduced-motion: reduce) {
  .preloader {
    display: none;
  }

  [data-animate] {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

/* .btn's own display:inline-flex otherwise beats the browser's native
   [hidden] styling (an author rule always outranks the UA stylesheet,
   regardless of matching specificity) — needed for JS-toggled buttons
   like "Delete selected" that start hidden until something is selected. */
.btn[hidden] {
  display: none;
}

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

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background: #fff;
  color: var(--color-primary);
}

.btn-secondary {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-secondary:hover {
  background: var(--color-primary);
  color: #fff;
}

.btn-accent {
  background: var(--color-accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-accent:hover {
  background: var(--color-accent-dark);
  box-shadow: 0 10px 24px rgba(59, 91, 254, 0.32);
  transform: translateY(-1px);
}

.btn-accent:active {
  transform: translateY(0) scale(0.98);
}

.btn-lg {
  padding: 16px 24px;
  font-size: 1rem;
}

.btn:disabled {
  cursor: default;
  opacity: 0.7;
  transform: none !important;
  box-shadow: none !important;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 9px 16px;
  font-size: 0.85rem;
}

/* ==========================================================================
   Announcement bar
   ========================================================================== */

.announce-bar {
  background: var(--color-primary);
  color: #fff;
  padding: 10px 16px;
}

.announce-track {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: var(--container-max);
  min-height: 18px;
  margin: 0 auto;
  padding: 0 12px;
}

.announce-text {
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
}

.tw-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.16s ease-out, transform 0.16s ease-out;
  white-space: pre;
}

.tw-char.is-in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .tw-char {
    transition: none;
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 253, 251, 0.9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-primary);
  transition: opacity 0.15s ease;
}

.logo:hover {
  opacity: 0.75;
}

.logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  display: inline-block;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 2px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-links a:hover {
  color: var(--color-text);
  background: var(--color-bg-alt);
}

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

/* Narrow phones (~360px and under): tighten the logo and pill buttons a
   little so "Log in" + "Sign up" both fit next to the logo without
   overflowing the viewport and forcing a horizontal scrollbar. */
@media (max-width: 360px) {
  .container {
    padding: 0 12px;
  }

  .header-inner {
    gap: 6px;
  }

  .logo {
    font-size: 1rem;
    gap: 4px;
  }

  .header-actions {
    gap: 5px;
  }

  .header-actions .btn-sm {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
}

.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 6px 14px 6px 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.user-menu-trigger:hover,
.user-menu-trigger.is-open {
  background: var(--color-border);
}

.user-menu-chevron {
  color: var(--color-text-muted);
  transition: transform 0.15s ease;
  margin-left: -2px;
}

.user-menu-trigger.is-open .user-menu-chevron {
  transform: rotate(180deg);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

img.user-avatar {
  object-fit: cover;
}

.user-avatar--md {
  width: 38px;
  height: 38px;
  font-size: 0.95rem;
}

.user-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 50;
  min-width: 240px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  padding: 8px;
  display: none;
  flex-direction: column;
}

.user-menu-dropdown.is-open {
  display: flex;
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 10px;
}

.user-menu-header-text {
  min-width: 0;
}

.user-menu-name {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--color-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-email {
  margin: 2px 0 0;
  font-size: 0.76rem;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-divider {
  height: 1px;
  margin: 4px 0;
  background: var(--color-border);
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: none;
  padding: 9px 8px;
  border-radius: var(--radius-input);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.user-menu-item:hover {
  background: var(--color-bg-alt);
}

.user-menu-item svg {
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.user-menu-item--danger {
  color: var(--color-danger);
}

.user-menu-item--danger svg {
  color: var(--color-danger);
}

.user-menu-item--danger:hover {
  background: var(--color-danger-soft);
}

/* ==========================================================================
   Hero — Uber-style layout, Lago-style skin
   ========================================================================== */

.hero {
  background: var(--gradient-hero);
  padding: 36px 0 48px;
  overflow: hidden;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 16px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(10, 10, 15, 0.08);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--color-primary-soft);
  backdrop-filter: blur(6px);
}

.hero-eyebrow-icon {
  color: var(--color-accent);
  flex-shrink: 0;
}

.hero-title {
  margin: 0 0 14px;
  font-size: 2rem;
  line-height: 1.14;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-primary);
  max-width: 15ch;
}

.hero-subtitle {
  margin: 0 0 26px;
  color: var(--color-primary-soft);
  font-size: 1rem;
  max-width: 42ch;
  opacity: 0.85;
}

/* The request box — the single dominant action, like Uber's "Where to?" */
.request-box {
  width: 100%;
  max-width: 480px;
  background: var(--color-surface);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  padding: 20px;
  text-align: left;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.request-box:focus-within {
  box-shadow: 0 20px 56px rgba(20, 20, 26, 0.16);
  transform: translateY(-2px);
}

.request-box-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary);
}

.request-box-eyebrow .pill-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
}

.request-field {
  margin-top: 16px;
}

.request-field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  margin-bottom: 7px;
}

.textarea-wrap {
  position: relative;
}

.textarea-icon {
  position: absolute;
  top: 15px;
  left: 15px;
  color: var(--color-accent);
  pointer-events: none;
}

.request-field textarea {
  width: 100%;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-input);
  padding: 13px 16px 13px 40px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-bg-alt);
  outline: none;
  resize: none;
  min-height: 64px;
  max-height: 160px;
  line-height: 1.5;
  overflow-y: hidden;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.request-field textarea.is-scrollable {
  overflow-y: auto;
}

.request-field textarea::placeholder {
  color: var(--color-text-muted);
}

.request-field textarea:focus {
  border-color: var(--color-accent);
  background: var(--color-surface);
  box-shadow: 0 0 0 4px var(--color-accent-soft);
}

.request-field-hint {
  display: block;
  margin: 7px 0 18px;
  padding: 0 2px;
  font-size: 0.74rem;
  color: var(--color-text-muted);
}

/* Dropzone */

.dropzone {
  position: relative;
  display: block;
  border: 1.5px dashed var(--color-border);
  border-radius: 20px;
  background: var(--color-bg-alt);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
}

.dropzone:hover,
.dropzone:focus-within {
  border-color: var(--color-accent);
}

.dropzone.dragover {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
  transform: scale(1.01);
}

.dropzone-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.dropzone-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  padding: 26px 16px;
  min-height: 132px;
}

.dropzone.has-file .dropzone-empty {
  display: none;
}

.dropzone-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone-empty strong {
  font-size: 0.88rem;
  color: var(--color-text);
}

.dropzone-empty span {
  font-size: 0.76rem;
  color: var(--color-text-muted);
}

.dropzone-preview {
  display: none;
  position: relative;
}

.dropzone.has-file .dropzone-preview {
  display: block;
  animation: fadeScaleIn 0.35s ease;
}

.dropzone-preview-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.dropzone-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(10, 10, 15, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.dropzone-remove:hover {
  background: rgba(10, 10, 15, 0.8);
  transform: scale(1.06);
}

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

.request-submit-row {
  margin-top: 14px;
}

.request-hint {
  margin: 10px 2px 0;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-align: center;
}

.hero-note {
  margin-top: 18px;
  font-size: 0.82rem;
  color: var(--color-primary-soft);
  opacity: 0.8;
}

/* ==========================================================================
   Hero illustration
   ========================================================================== */

.hero-visual {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 5 / 4;
  margin: 0 auto;
}

/* Gives the illustration the same "contained panel" weight as the request
   box, so neither side of the hero reads as heavier/lighter than the
   other, the way an unbounded floating illustration would next to a
   solid card. */
.hero-visual-frame {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-lg);
  z-index: 0;
}

.visual-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 78%;
  height: 78%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 178, 148, 0.55) 0%, rgba(255, 200, 224, 0.35) 55%, rgba(255, 200, 224, 0) 72%);
  filter: blur(6px);
  z-index: 0;
}

.visual-card {
  position: absolute;
  width: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Left side: a mini dashboard widget, balancing the offer stack on the
   right so the illustration fills the frame evenly on both sides
   instead of clustering everything into one corner. */
.visual-card--dashboard {
  top: 30%;
  left: 3%;
  width: 47%;
  transform: rotate(-4deg);
  z-index: 1;
}

.dash-header {
  display: flex;
  gap: 4px;
}

.dash-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-border);
}

.dash-chart {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 40px;
  margin: 4px 0 2px;
}

.dash-bar {
  flex: 1;
  height: var(--h);
  min-height: 6px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--color-accent), var(--color-accent-soft));
}

/* Right side: the offer notification stack */
.visual-card--back {
  top: 10%;
  left: 47%;
  width: 50%;
  transform: rotate(-6deg);
  opacity: 0.85;
  z-index: 1;
}

.visual-card--front {
  top: 28%;
  left: 43%;
  width: 52%;
  transform: rotate(3deg);
  z-index: 2;
  animation: floatSlow 5s ease-in-out infinite;
}

.visual-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 2px;
}

.visual-card-tag {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--color-accent-dark);
  background: var(--color-accent-soft);
  padding: 3px 7px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.visual-card-price {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--color-primary);
  white-space: nowrap;
}

.visual-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.skeleton-line {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: var(--color-border);
}

.w-30 { width: 30%; }
.w-40 { width: 40%; }
.w-50 { width: 50%; }
.w-60 { width: 60%; }
.w-80 { width: 80%; }
.w-90 { width: 90%; }

.skeleton-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-accent-soft);
  flex-shrink: 0;
}

.skeleton-avatar.sm {
  width: 18px;
  height: 18px;
}

.visual-badge {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-pill);
  z-index: 3;
  animation: floatBadge 4.5s ease-in-out infinite;
}

.visual-badge--check {
  width: 42px;
  height: 42px;
  top: 8%;
  right: 4%;
  background: var(--color-accent);
  color: #fff;
  animation-delay: 0.3s;
}

.visual-badge--count {
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 8px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-text);
  animation: floatBadgeCenter 4.5s ease-in-out infinite;
  animation-delay: 0.9s;
}

@keyframes floatBadgeCenter {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-7px); }
}

@keyframes floatSlow {
  0%, 100% { transform: rotate(3deg) translateY(0); }
  50% { transform: rotate(3deg) translateY(-8px); }
}

@keyframes floatBadge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@media (prefers-reduced-motion: reduce) {
  .visual-card--front,
  .visual-badge {
    animation: none;
  }
}

/* ==========================================================================
   Scroll reveal (used by How It Works / Why Us sections)
   ========================================================================== */

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(.22, .61, .36, 1), transform 0.6s cubic-bezier(.22, .61, .36, 1);
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.steps-grid [data-reveal]:nth-child(1) { transition-delay: 0s; }
.steps-grid [data-reveal]:nth-child(2) { transition-delay: 0.08s; }
.steps-grid [data-reveal]:nth-child(3) { transition-delay: 0.16s; }
.steps-grid [data-reveal]:nth-child(4) { transition-delay: 0.24s; }

.benefits-grid [data-reveal]:nth-child(1) { transition-delay: 0s; }
.benefits-grid [data-reveal]:nth-child(2) { transition-delay: 0.08s; }
.benefits-grid [data-reveal]:nth-child(3) { transition-delay: 0.16s; }
.benefits-grid [data-reveal]:nth-child(4) { transition-delay: 0.24s; }

.stats-row [data-reveal]:nth-child(1) { transition-delay: 0s; }
.stats-row [data-reveal]:nth-child(2) { transition-delay: 0.06s; }
.stats-row [data-reveal]:nth-child(3) { transition-delay: 0.12s; }
.stats-row [data-reveal]:nth-child(4) { transition-delay: 0.18s; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ==========================================================================
   How It Works
   ========================================================================== */

.section-head {
  margin-bottom: 28px;
}

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.step-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: 22px 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.step-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.step-number {
  position: absolute;
  top: 18px;
  right: 20px;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: rgba(59, 91, 254, 0.12);
  transition: color 0.2s ease;
}

.step-card:hover .step-number {
  color: rgba(59, 91, 254, 0.22);
}

.step-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  margin-bottom: 14px;
}

.step-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.step-card p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Live Requests
   ========================================================================== */

.live-requests-wrap {
  position: relative;
}

.rfq-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.rfq-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rfq-card-category {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-accent-dark);
  background: var(--color-accent-soft);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.rfq-card-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.35;
}

.rfq-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.rfq-card-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-text-muted);
  flex-shrink: 0;
}

.rfq-card--clickable {
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rfq-card--clickable:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.rfq-card--clickable:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.rfq-card-thumb {
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary-soft);
}

.rfq-card:nth-child(3n+1) .rfq-card-thumb {
  background: linear-gradient(135deg, #fff8ef, #ffe9d9);
}

.rfq-card:nth-child(3n+2) .rfq-card-thumb {
  background: linear-gradient(135deg, var(--color-accent-soft), #dfe6ff);
}

.rfq-card:nth-child(3n+3) .rfq-card-thumb {
  background: linear-gradient(135deg, #fff0f3, #ffdce8);
}

.rfq-card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rfq-card--home {
  padding: 0;
  overflow: hidden;
}

.rfq-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rfq-card-budget {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 2px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-primary);
}

.rfq-card-budget-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
}

.rfq-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.rfq-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.rfq-stat-chip svg {
  flex-shrink: 0;
  color: var(--color-accent);
}

/* Request detail modal */

.request-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.request-modal[hidden] {
  display: none;
}

.request-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 15, 0.55);
}

.request-modal-panel {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
  z-index: 1;
}

.request-modal-image {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}

.request-modal-image svg {
  width: 60px;
  height: 60px;
}

.request-modal-image-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}

.request-modal-body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.request-modal-title {
  margin: 4px 0 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.35;
}

.request-modal-description {
  margin: 0 0 16px;
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

.request-modal-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
  padding: 14px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-input);
}

.request-modal-meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.82rem;
  color: var(--color-text);
}

.request-modal-meta-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
}

/* Popup like/dislike buttons — same .rfq-stat-chip pill look the product
   card already displays its (read-only) like count in, just made
   interactive: a real <button>, hover/active states, and a click-pulse. */
.rfq-stat-chip--vote {
  position: relative;
  overflow: hidden;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.1s ease;
}

.rfq-stat-chip--vote:hover {
  border-color: var(--color-accent);
}

.rfq-stat-chip--vote:active {
  transform: scale(0.96);
}

.rfq-stat-chip--vote.is-active {
  background: var(--color-toast-offer-soft);
  color: var(--color-toast-offer);
}

.rfq-stat-chip--vote.is-active svg {
  color: var(--color-toast-offer);
}

.rfq-stat-chip--dislike.is-active {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.rfq-stat-chip--dislike.is-active svg {
  color: var(--color-danger);
}

/* Click feedback: a quick radial flash from the center on every click,
   like/dislike or retract alike, so the tap always reads as registered
   even before the count text updates a moment later. */
.rfq-stat-chip--vote.is-pulsing::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, currentColor 0%, transparent 70%);
  opacity: 0.35;
  animation: voteFlash 0.4s ease-out;
  pointer-events: none;
}

@keyframes voteFlash {
  from {
    opacity: 0.35;
    transform: scale(0.4);
  }
  to {
    opacity: 0;
    transform: scale(1.6);
  }
}

.request-modal-note {
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.request-modal-extra {
  margin-bottom: 16px;
}

.request-modal-extra p {
  margin: 4px 0 0;
  font-size: 0.86rem;
  color: var(--color-text);
  line-height: 1.5;
  white-space: pre-line;
}

.blurred {
  filter: blur(7px);
  user-select: none;
  pointer-events: none;
}

.gate-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.gate-box {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
  padding: 28px 24px;
  text-align: center;
  max-width: 320px;
  width: 100%;
}

.gate-box-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.gate-box h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary);
}

.gate-box p {
  margin: 0 0 18px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.gate-box-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==========================================================================
   Products
   ========================================================================== */

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.product-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary-soft);
}

.product-card:nth-child(3n+1) .product-thumb,
.product-thumb.grad-a {
  background: linear-gradient(135deg, #fff8ef, #ffe9d9);
}

.product-card:nth-child(3n+2) .product-thumb,
.product-thumb.grad-b {
  background: linear-gradient(135deg, var(--color-accent-soft), #dfe6ff);
}

.product-card:nth-child(3n+3) .product-thumb,
.product-thumb.grad-c {
  background: linear-gradient(135deg, #fff0f3, #ffdce8);
}

.product-photo-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  background: rgba(10, 10, 15, 0.55);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
}

.product-body {
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}

.product-price {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-accent-dark);
}

.product-qty {
  font-size: 0.76rem;
  color: var(--color-text);
}

.product-meta {
  font-size: 0.76rem;
  color: var(--color-text-muted);
}

.section-cta-footer {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

/* ==========================================================================
   Products catalog page
   ========================================================================== */

.product-category-pill {
  align-self: flex-start;
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-accent-dark);
  background: var(--color-accent-soft);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  margin-bottom: 2px;
}

.product-card--clickable {
  cursor: pointer;
}

.product-card--clickable:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.catalog-page-container {
  max-width: 1100px;
}

.catalog-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.catalog-search {
  position: relative;
  flex: 1;
}

.catalog-search-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
}

.catalog-search .form-input {
  padding-left: 40px;
}

.catalog-sort-select {
  cursor: pointer;
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.category-pill {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.category-pill:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-dark);
}

.category-pill.is-active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.filter-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  height: 100%;
  min-height: 42px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.filter-menu-trigger:hover,
.filter-menu-trigger[aria-expanded="true"] {
  border-color: var(--color-accent);
  color: var(--color-accent-dark);
}

.filter-menu-trigger.is-active {
  border-color: var(--color-primary);
  background: var(--color-accent-soft);
  color: var(--color-primary);
}

.filter-menu-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.filter-menu-clear:hover {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.filter-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  min-width: 240px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
  padding: 14px;
  display: none;
  flex-direction: column;
  gap: 2px;
}

.filter-menu-panel.is-open {
  display: flex;
}

.filter-menu-panel-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.filter-menu-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 6px;
  border-radius: var(--radius-input);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
}

.filter-menu-option:hover {
  background: var(--color-bg-alt);
}

.filter-menu-option input {
  accent-color: var(--color-accent);
  cursor: pointer;
}

.filter-menu-apply {
  margin-top: 10px;
  width: 100%;
}

.popular-tags {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--color-border);
}

.popular-tags-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--color-primary);
}

.popular-tags-heading h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
}

.catalog-result-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.catalog-result-count {
  margin: 0;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-accent-soft);
  color: var(--color-primary);
  font-size: 0.78rem;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.active-filter-chip:hover {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.catalog-empty {
  text-align: center;
  padding: 48px 20px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-card);
  color: var(--color-text-muted);
}

.catalog-empty p {
  margin: 0 0 16px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 20px;
}

.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.82rem;
  font-weight: 600;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.pagination-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-dark);
}

.pagination-btn--active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.pagination-btn--disabled {
  opacity: 0.35;
  pointer-events: none;
}

.pagination-ellipsis {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.pagination-status {
  margin-top: 10px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Product detail modal */

body.modal-open {
  overflow: hidden;
}

.product-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.product-modal[hidden] {
  display: none;
}

.product-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 15, 0.55);
}

.product-modal-panel {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
  z-index: 1;
}

.product-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.product-modal-slider {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}

.product-modal-slides {
  display: flex;
  height: 100%;
  transition: transform 0.3s ease;
}

.product-modal-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-modal-slide svg {
  width: 64px;
  height: 64px;
}

.product-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.product-modal-nav--prev {
  left: 12px;
}

.product-modal-nav--next {
  right: 12px;
}

.product-modal-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.product-modal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
}

.product-modal-dot.is-active {
  background: #fff;
}

.product-modal-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-modal-name {
  margin: 4px 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}

/* ==========================================================================
   Why Us — stats + benefits
   ========================================================================== */

.stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 40px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: 20px 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.stat-num {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--color-accent-dark);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.benefits-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.benefit-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: 22px 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.benefit-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.benefit-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  margin-bottom: 14px;
}

.benefit-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.benefit-card p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Download App
   ========================================================================== */

.download-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.download-content {
  text-align: left;
  max-width: 460px;
}

.download-content .hero-eyebrow {
  background: var(--color-surface);
}

.download-content .section-heading {
  margin-top: 4px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.download-content .section-subheading {
  font-size: 1rem;
  max-width: 42ch;
}

.download-actions {
  margin-top: 24px;
}

.download-actions .btn {
  padding: 15px 26px;
}

.download-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 14px 2px 0;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.download-hint-icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--color-text-muted);
}

.ios-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-input);
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  font-size: 0.82rem;
  line-height: 1.4;
  max-width: 380px;
}

.ios-tip[hidden] {
  display: none;
}

.ios-tip--warn {
  background: #fff4e5;
  color: #8a5a00;
}

.ios-tip-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

/* Phone mockup */

.phone-mockup {
  position: relative;
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
}

.phone-frame {
  position: relative;
  aspect-ratio: 9 / 18.5;
  background: var(--color-primary);
  border-radius: 34px;
  padding: 12px;
  box-shadow: var(--shadow-lg);
}

.phone-notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 34%;
  height: 18px;
  background: var(--color-primary);
  border-radius: 0 0 12px 12px;
  z-index: 2;
}

.phone-screen {
  height: 100%;
  width: 100%;
  border-radius: 24px;
  background: var(--gradient-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px 14px 14px;
}

.phone-app-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

.phone-app-icon {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 30%;
  background: rgba(255, 255, 255, 0.55);
}

.phone-app-icon--a { background: #ffd9c4; }
.phone-app-icon--b { background: #ffc9dd; }
.phone-app-icon--c { background: #cfe0ff; }
.phone-app-icon--d { background: #d7f0e3; }
.phone-app-icon--e { background: #ffe3a3; }
.phone-app-icon--f { background: #e3d7ff; }
.phone-app-icon--g { background: #ffd0c7; }
.phone-app-icon--h { background: #c9ecff; }

.phone-app-icon--main {
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18%;
  box-shadow: 0 4px 14px rgba(10, 10, 15, 0.35);
}

.phone-app-icon-ring {
  position: absolute;
  inset: -6px;
  border-radius: 30%;
  border: 2px solid var(--color-accent);
  animation: ringPulse 2.2s ease-out infinite;
}

@keyframes ringPulse {
  0% { transform: scale(0.92); opacity: 0.9; }
  70% { transform: scale(1.18); opacity: 0; }
  100% { transform: scale(1.18); opacity: 0; }
}

.phone-added-badge {
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 8px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-text);
}

@media (max-width: 340px) {
  .phone-added-badge {
    padding: 6px 10px;
    font-size: 0.62rem;
    gap: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .phone-app-icon-ring {
    animation: none;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  padding: 40px 0 0;
  margin-top: 24px;
}

.footer-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  margin-bottom: 28px;
}

.footer-brand .logo {
  justify-content: center;
  margin-bottom: 8px;
}

.footer-tagline {
  margin: 0 auto;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  max-width: 32ch;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 4px;
  font-size: 0.88rem;
}

.footer-links a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 10px;
  color: var(--color-text-muted);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.footer-links a:hover {
  color: var(--color-text);
  background: rgba(10, 10, 15, 0.05);
}

.footer-bottom {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--color-primary);
  font-size: 0.78rem;
  color: #fff;
  text-align: center;
}

/* ==========================================================================
   Messages (Django flash messages)
   ========================================================================== */

.flash-messages {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flash {
  background: var(--color-primary);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-input);
  font-size: 0.85rem;
  box-shadow: var(--shadow-md);
  animation: flashIn 0.25s cubic-bezier(.22, .61, .36, 1);
}

@keyframes flashIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .flash {
    animation: none;
  }
}

.flash-success {
  background: var(--color-accent);
}

.flash-error {
  background: var(--color-danger, #e0384c);
}

.flash-info {
  background: var(--color-primary-soft);
}

/* ==========================================================================
   Scroll to top
   ========================================================================== */

.scroll-top-btn {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.15s ease;
}

.scroll-top-btn.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top-btn:hover {
  background: var(--color-primary-soft);
}

@media (prefers-reduced-motion: reduce) {
  .scroll-top-btn {
    transition: opacity 0.15s ease;
    transform: none;
  }
}

/* ==========================================================================
   Live-activity toast feed
   ========================================================================== */

.toast-stack {
  position: fixed;
  left: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: calc(100vw - 36px);
  max-width: 320px;
  pointer-events: none;
}

.toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
  padding: 12px 30px 14px 12px;
  overflow: hidden;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.toast.is-leaving {
  opacity: 0;
  transform: translateX(-16px);
}

.toast-stack--top-right {
  left: auto;
  right: 18px;
  bottom: auto;
  top: calc(76px + env(safe-area-inset-top, 0px));
}

.toast-stack--top-right .toast {
  transform: translateX(16px);
}

.toast-stack--top-right .toast.is-visible {
  transform: translateX(0);
}

.toast-stack--top-right .toast.is-leaving {
  transform: translateX(16px);
}

.toast-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-body {
  min-width: 0;
  flex: 1;
}

.toast-text {
  margin: 0;
  font-size: 0.83rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text);
}

.toast-time {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

.toast-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.toast-close:hover {
  background: var(--color-bg-alt);
  color: var(--color-text);
}

.toast-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--color-border);
}

.toast-progress-bar {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--color-accent);
  transform-origin: left;
  transform: scaleX(1);
}

.toast-progress-bar.is-draining {
  transition: transform linear;
  transform: scaleX(0);
}

.toast--error .toast-icon {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.toast--error .toast-progress-bar {
  background: var(--color-danger);
}

/* Activity-toast type accents — a distinct left stripe + icon/progress
   color per type, so buyer/seller/offer/request toasts read as different
   at a glance without anyone having to read the text. */
.toast--buyer,
.toast--seller,
.toast--offer,
.toast--request {
  border-left: 3px solid transparent;
  padding-left: 10px;
}

.toast--buyer {
  border-left-color: var(--color-accent);
}

.toast--buyer .toast-icon {
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
}

.toast--buyer .toast-progress-bar {
  background: var(--color-accent);
}

.toast--seller {
  border-left-color: var(--color-toast-seller);
}

.toast--seller .toast-icon {
  background: var(--color-toast-seller-soft);
  color: var(--color-toast-seller);
}

.toast--seller .toast-progress-bar {
  background: var(--color-toast-seller);
}

.toast--offer {
  border-left-color: var(--color-toast-offer);
}

.toast--offer .toast-icon {
  background: var(--color-toast-offer-soft);
  color: var(--color-toast-offer);
}

.toast--offer .toast-progress-bar {
  background: var(--color-toast-offer);
}

.toast--request {
  border-left-color: var(--color-toast-request);
}

.toast--request .toast-icon {
  background: var(--color-toast-request-soft);
  color: var(--color-toast-request);
}

.toast--request .toast-progress-bar {
  background: var(--color-toast-request);
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: opacity 0.2s ease;
    transform: none !important;
  }

  .toast-progress-bar.is-draining {
    transition: none;
    transform: scaleX(0);
  }
}

@media (min-width: 640px) {
  .toast-stack {
    left: 24px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }

  .toast-stack--top-right {
    left: auto;
    right: 24px;
    bottom: auto;
    top: calc(76px + env(safe-area-inset-top, 0px));
  }
}

/* ==========================================================================
   Content pages (Terms, Privacy, FAQ, About, Contact)
   ========================================================================== */

.page-header {
  background: var(--color-bg-alt);
  padding: 36px 0 28px;
  border-bottom: 1px solid var(--color-border);
}

.page-title {
  margin: 0 0 8px;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-primary);
}

.page-subtitle {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  max-width: 56ch;
}

.page-updated {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.content-page {
  padding: 40px 0 64px;
}

.content-page .container {
  max-width: 760px;
}

.prose h2 {
  margin: 32px 0 12px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  margin: 18px 0 8px;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--color-text);
}

.prose p {
  margin: 0 0 14px;
  color: var(--color-text);
  font-size: 0.92rem;
  line-height: 1.65;
}

.prose ul,
.prose ol {
  margin: 0 0 14px;
  padding-left: 20px;
  color: var(--color-text);
  font-size: 0.92rem;
  line-height: 1.65;
}

.prose li {
  margin-bottom: 6px;
}

.prose strong {
  color: var(--color-primary);
}

.prose a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.placeholder-note {
  display: flex;
  gap: 10px;
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: var(--radius-input);
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  font-size: 0.84rem;
  line-height: 1.5;
}

.placeholder-note-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

/* FAQ accordion */

.faq-group-title {
  margin: 32px 0 14px;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--color-primary);
}

.faq-group-title:first-child {
  margin-top: 0;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-text);
  cursor: pointer;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-chevron {
  flex-shrink: 0;
  color: var(--color-accent);
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-chevron {
  transform: rotate(180deg);
}

/* Smooth expand/collapse for <details>. Natively, browsers just snap
   between display:none and display:block, no transition possible. The
   grid-template-rows 0fr -> 1fr trick sidesteps that: it's an animatable
   property (unlike height:auto), so the reveal can actually ease in. The
   "display: grid !important" overrides the browser's own UA stylesheet
   rule that hides everything but <summary> while closed, which otherwise
   wins on specificity and would skip our animation entirely. */
.faq-answer-wrap {
  display: grid !important;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}

.faq-item[open] .faq-answer-wrap {
  grid-template-rows: 1fr;
}

.faq-answer {
  margin: 0;
  padding: 0 18px 16px;
  color: var(--color-text-muted);
  font-size: 0.87rem;
  line-height: 1.6;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.faq-item[open] .faq-answer {
  opacity: 1;
  transition-delay: 0.06s;
}

@media (prefers-reduced-motion: reduce) {
  .faq-answer-wrap,
  .faq-answer {
    transition: none;
  }
}

/* Generic form input (single-line), matching the request box's textarea */

.form-field {
  margin-top: 16px;
}

.form-field:first-child {
  margin-top: 0;
}

.form-input {
  width: 100%;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-input);
  padding: 13px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-bg-alt);
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

.form-input:focus {
  border-color: var(--color-accent);
  background: var(--color-surface);
  box-shadow: 0 0 0 4px var(--color-accent-soft);
}

textarea.form-input {
  resize: none;
  min-height: 120px;
  line-height: 1.5;
}

.content-page .container.contact-container {
  max-width: 960px;
}

.content-page .container.catalog-page-container {
  max-width: var(--container-max);
}

.contact-layout {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.contact-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: 24px 20px;
  max-width: 520px;
}

.contact-info {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 24px 20px;
}

.contact-info-heading {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary);
}

.contact-info-lead {
  margin: 0 0 22px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.contact-info-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--color-text);
}

.contact-info-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  flex-shrink: 0;
}

.contact-info-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 3px;
}

.contact-info-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
}

.contact-info-text a {
  color: var(--color-accent-dark);
  font-weight: 600;
}

.contact-info-text a:hover {
  text-decoration: underline;
}

.contact-social {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.contact-social-links {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.contact-social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.contact-social-links a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-dark);
  transform: translateY(-2px);
}

/* ==========================================================================
   Tablet (>=640px)
   ========================================================================== */

@media (min-width: 640px) {
  .hero-title {
    font-size: 2.6rem;
    max-width: 17ch;
  }

  .hero-subtitle {
    font-size: 1.05rem;
  }

  .hero-visual {
    max-width: 380px;
  }

  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-row {
    grid-template-columns: repeat(4, 1fr);
  }

  .rfq-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    text-align: left;
  }

  .footer-brand .logo {
    justify-content: flex-start;
  }

  .footer-tagline {
    margin: 0;
  }

  .footer-links {
    justify-content: flex-end;
    gap: 4px;
  }

  .flash-messages {
    left: auto;
    right: 20px;
    max-width: 360px;
  }
}

/* ==========================================================================
   Desktop (>=1024px)
   ========================================================================== */

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

  .catalog-toolbar {
    flex-direction: row;
    align-items: center;
  }

  .catalog-sort-select {
    flex: 0 0 220px;
  }

  .product-grid--catalog {
    grid-template-columns: repeat(4, 1fr);
  }

  .contact-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 48px;
  }

  .contact-card {
    flex: 1.4;
    max-width: none;
  }

  .contact-info {
    flex: 1;
    max-width: 340px;
  }

  .hero {
    padding: 56px 0 72px;
  }

  .hero-inner {
    display: grid;
    grid-template-columns: 1fr 0.85fr;
    gap: 56px;
    align-items: center;
  }

  .hero-title {
    font-size: 3.1rem;
    max-width: 16ch;
  }

  .request-box {
    padding: 28px;
  }

  .request-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 56px rgba(20, 20, 26, 0.14);
  }

  .hero-visual {
    max-width: none;
    width: 100%;
    aspect-ratio: 4 / 3.3;
    max-height: 480px;
  }

  .steps-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .benefits-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .rfq-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .download-inner {
    flex-direction: row;
    justify-content: space-between;
    gap: 64px;
    text-align: left;
  }

  .download-content .section-heading {
    font-size: 1.9rem;
  }

  .phone-mockup {
    max-width: 240px;
    flex-shrink: 0;
  }

  .section {
    padding: 72px 0;
  }
}

/* ==========================================================================
   Wide desktop (>=1280px)
   ========================================================================== */

@media (min-width: 1280px) {
  .rfq-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ==========================================================================
   Auth (Login / Signup)
   ========================================================================== */

@view-transition {
  navigation: auto;
}

.auth-container {
  display: flex;
  justify-content: center;
}

.auth-shell {
  width: 100%;
  max-width: 440px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
  padding: 28px 20px;
}

.auth-shell--single {
  max-width: 400px;
}

.auth-heading {
  margin: 0 0 6px;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--color-primary);
}

.auth-subheading {
  margin: 0 0 24px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* Step indicator */

.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.stepper-dots {
  display: flex;
  gap: 6px;
}

.stepper-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border);
}

.stepper-dot.is-active {
  background: var(--color-accent);
}

.stepper-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

/* Role selection cards */

.role-form {
  margin-top: 4px;
}

.role-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.role-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  text-align: left;
  background: var(--color-bg-alt);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 20px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.role-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.role-card:active {
  transform: translateY(0);
}

.role-card.is-selected {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}

.role-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
}

.role-card.is-selected .role-card-icon {
  background: var(--color-surface);
}

.role-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.role-card-desc {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* Form fields */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* The single main CTA (Log in, Send code, Verify and continue, Reset
   password) reads as oddly long stretched edge-to-edge on a narrow phone,
   even though the same 100%-width button looks fine on the wider desktop
   card — size it to its content and center it instead. */
.auth-form > button[type='submit'] {
  width: auto;
  min-width: 220px;
  align-self: center;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group[hidden] {
  display: none;
}

.form-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  margin-bottom: 7px;
}

.form-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 7px;
}

.form-label-row .form-label {
  margin-bottom: 0;
}

.form-label-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-accent-dark);
}

.form-label-link:hover {
  text-decoration: underline;
}

.form-input {
  width: 100%;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-input);
  padding: 13px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-bg-alt);
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

.form-input:focus {
  border-color: var(--color-accent);
  background: var(--color-surface);
  box-shadow: 0 0 0 4px var(--color-accent-soft);
}

.form-group:has(.form-error) .form-input {
  border-color: var(--color-danger);
}

.password-field {
  position: relative;
}

.password-field .form-input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  padding: 0;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-input);
}

.password-toggle:hover {
  color: var(--color-text);
}

.password-toggle svg {
  width: 19px;
  height: 19px;
}

.password-toggle[aria-pressed="true"] .icon-eye {
  display: none;
}

.password-toggle:not([aria-pressed="true"]) .icon-eye-off {
  display: none;
}

.password-toggle[aria-pressed="true"] .icon-eye-off {
  display: flex;
}

.form-error {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--color-danger);
}

.form-alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-input);
  background: var(--color-danger-soft);
  color: var(--color-danger);
  font-size: 0.85rem;
  font-weight: 600;
}

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  cursor: pointer;
  line-height: 1.4;
}

.form-checkbox input[type="checkbox"] {
  margin-top: 2px;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.form-checkbox a {
  color: var(--color-accent-dark);
  font-weight: 600;
}

.form-checkbox a:hover {
  text-decoration: underline;
}

.auth-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.auth-actions .btn {
  flex: 1;
}

.auth-switch {
  margin: 20px 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.auth-switch a {
  color: var(--color-accent-dark);
  font-weight: 700;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
}

.auth-shell--single .auth-heading,
.auth-shell--single .auth-subheading {
  text-align: center;
}

.form-input-code {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.5em;
  padding-left: 14px;
}

.resend-form {
  margin-top: 4px;
  text-align: center;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 20px 0 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-accent-dark);
  cursor: pointer;
}

.link-btn:hover {
  text-decoration: underline;
}

/* htmx form submission: swap button label for a loading state, and dim the
   whole card group on the role-selection step (its "buttons" are the cards
   themselves, not a single labeled button).

   hx-indicator="find .btn-loading" on each button makes htmx add the
   .htmx-request class directly to that span while the request is in
   flight — that's a documented, guaranteed htmx behavior, unlike guessing
   which ancestor might also get the class. .btn-loading comes first in the
   markup so a plain sibling selector can hide .btn-label off of it, with
   no dependency on ancestor state at all. */

.btn-label,
.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-loading {
  display: none;
}

.btn-loading.htmx-request {
  display: inline-flex;
}

.btn-loading.htmx-request ~ .btn-label {
  display: none;
}

.btn-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  opacity: 0.85;
  animation: btnSpin 0.6s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .btn-spinner {
    animation-duration: 1.2s;
  }
}

/* hx-disabled-elt="find .role-card" sets the native disabled attribute
   during the request — style off that directly rather than an htmx class,
   since browser-native :disabled needs no cooperation from htmx's JS. */
.role-card:disabled {
  opacity: 0.55;
  pointer-events: none;
}

@media (min-width: 640px) {
  .auth-shell {
    padding: 36px 32px;
  }

  .role-cards {
    flex-direction: row;
  }

  .form-row {
    flex-direction: row;
    gap: 14px;
  }

  .form-row .form-group {
    flex: 1;
  }
}
