/* ============================================================
   COMPONENTS.CSS — Vonulo Shared UI Components
   Nav, buttons, cards, forms, pills/tags/badges, modals,
   empty states, footer, loading, toast, and utilities.
   ============================================================ */


/* ================================================================
   NAV
   Sticky, translucent cream with backdrop-filter blur.
   ================================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-2xl);
  height: 64px;
  background: rgba(247, 242, 234, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--sand);
  transition: box-shadow 0.3s ease;
}

.nav.scrolled {
  box-shadow: 0 4px 24px rgba(26, 22, 18, 0.08);
}

.nav-logo {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--clay);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--warm-grey);
  text-decoration: none;
  padding: var(--space-sm) 14px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  transition: all var(--duration-fast) ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--ink);
  border-color: var(--sand);
  background: var(--white);
}

.nav-link.active {
  color: var(--ink);
  font-weight: 600;
}

/* CTA link in nav */
.nav-link.cta {
  background: var(--clay);
  color: var(--white);
  border-color: var(--clay);
  font-weight: 600;
}

.nav-link.cta:hover {
  background: var(--clay-dark);
  border-color: var(--clay-dark);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Nav back link */
.nav-back {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--warm-grey);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-sm) 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--sand);
  transition: all var(--duration-fast) ease;
}

.nav-back:hover {
  color: var(--ink);
  border-color: var(--warm-grey-light);
  background: var(--white);
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
  background: none;
  border: none;
  min-width: 44px;
  min-height: 44px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: all var(--duration-fast) ease;
}

/* Auth-aware: show/hide based on login state */
.nav .logged-in { display: none; }
.nav.is-authenticated .logged-in { display: flex; }
.nav.is-authenticated .logged-out { display: none; }


/* ================================================================
   BUTTONS
   .btn base + variants: primary, secondary, outline, ghost.
   Sizes: sm, lg. Modifiers: pill, full. Loading: spinner.
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 14px 24px;
  font-family: var(--sans);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1;
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Primary */
.btn-primary {
  background: var(--clay);
  color: var(--white);
  border-color: var(--clay);
  box-shadow: 0 4px 20px rgba(196, 98, 45, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: var(--clay-light);
  border-color: var(--clay-light);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(196, 98, 45, 0.4);
}

/* Secondary */
.btn-secondary {
  background: var(--white);
  color: var(--ink);
  border-color: var(--sand);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--clay);
  color: var(--clay);
}

/* Outline */
.btn-outline {
  background: transparent;
  color: var(--clay);
  border-color: var(--clay);
}

.btn-outline:hover:not(:disabled) {
  background: var(--clay);
  color: var(--white);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--warm-grey);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--ink);
  background: rgba(26, 22, 18, 0.04);
}

/* Size: small */
.btn-sm {
  padding: 8px 16px;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}

/* Size: large */
.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
  border-radius: 14px;
}

/* Modifier: pill shape */
.btn--pill {
  border-radius: var(--radius-full);
}

/* Modifier: full width */
.btn--full {
  width: 100%;
}

/* Loading spinner inside button */
.btn .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}


/* ================================================================
   CARDS
   .card base: white bg, sand border, radius-xl, shadow-sm.
   ================================================================ */
.card {
  background: var(--white);
  border: 1px solid var(--sand);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  transition: box-shadow var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}

.card:hover {
  box-shadow: var(--shadow-md);
}


/* ================================================================
   FORMS
   .form-group, .form-label, .form-input, .form-select,
   .form-textarea, focus states, error states.
   ================================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--warm-grey);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 13px 16px;
  font-size: var(--text-base);
  font-family: var(--sans);
  border: 1.5px solid var(--sand);
  border-radius: var(--radius-md);
  background: var(--cream);
  color: var(--ink);
  outline: none;
  transition: border-color var(--duration-fast) ease,
              background var(--duration-fast) ease,
              box-shadow var(--duration-fast) ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--clay);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(196, 98, 45, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--warm-grey-light);
}

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

.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238C8278'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* Error state */
.form-error {
  font-size: var(--text-sm);
  color: #991B1B;
  text-align: center;
  margin-top: 10px;
  display: none;
}

.field-error {
  border-color: #E53E3E !important;
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1) !important;
}

/* Form grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}


/* ================================================================
   PILLS / TAGS / BADGES / STATUS PILLS
   ================================================================ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1.5px solid var(--sand);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  background: var(--white);
  color: var(--ink);
  user-select: none;
}

.pill:hover {
  border-color: var(--clay-light);
}

.pill.selected {
  border-color: var(--clay);
  background: var(--clay-pale);
  color: var(--clay);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--cream);
  border: 1px solid var(--sand);
  color: var(--warm-grey);
  letter-spacing: 0.04em;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}

.badge-green,
.verified-badge {
  background: var(--green-bg);
  color: #166534;
}

.badge-yellow {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.badge-red {
  background: var(--red-bg);
  color: var(--red);
}

.badge-blue {
  background: #DBEAFE;
  color: #1E40AF;
}

/* Status pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-pending  { background: #FEF3C7; color: #92400E; }
.status-approved { background: #DCFCE7; color: #166534; }
.status-rejected { background: #FEE2E2; color: #991B1B; }
.status-viewed   { background: #DBEAFE; color: #1E40AF; }
.status-active   { background: #DCFCE7; color: #166534; }
.status-paused   { background: #FEF3C7; color: #92400E; }
.status-signed   { background: #D1FAE5; color: #065F46; }
.status-declined { background: #FEE2E2; color: #991B1B; }


/* ================================================================
   MODALS
   .modal-overlay: fixed, backdrop blur.
   .modal-content: white card, animated.
   ================================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(26, 22, 18, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-2xl);
  padding: 40px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.3s var(--ease-spring) both;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cream);
  border: none;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warm-grey);
  transition: all var(--duration-fast) ease;
}

.modal-close:hover {
  background: var(--sand);
  color: var(--ink);
}

.modal-title {
  font-family: var(--serif);
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-title em {
  font-style: italic;
  color: var(--clay);
}

.modal-sub {
  font-size: 14px;
  color: var(--warm-grey);
  line-height: 1.6;
  margin-bottom: var(--space-lg);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: flex-end;
}

.modal-cancel {
  padding: 10px 18px;
  background: none;
  border: 1px solid var(--sand);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  cursor: pointer;
  font-family: var(--sans);
  transition: all var(--duration-fast) ease;
}

.modal-cancel:hover {
  border-color: var(--warm-grey-light);
}


/* ================================================================
   EMPTY STATES
   ================================================================ */
.empty-state {
  background: var(--white);
  border: 1px solid var(--sand);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
}

.empty-state .empty-icon {
  font-size: 36px;
  margin-bottom: 14px;
}

.empty-state .empty-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.empty-state .empty-sub {
  font-size: var(--text-sm);
  color: var(--warm-grey);
  line-height: 1.6;
  margin-bottom: 20px;
}

.empty-state .empty-action {
  display: inline-block;
  padding: 10px 22px;
  background: var(--clay);
  color: var(--white);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: background var(--duration-fast) ease;
}

.empty-state .empty-action:hover {
  background: var(--clay-light);
}


/* ================================================================
   DARK SECTIONS
   Reusable dark-bg sections with proper text/card overrides.
   Apply .section-dark to any <section> for the dark treatment.
   ================================================================ */
.section-dark {
  background: var(--gradient-dark);
  color: var(--white);
}

.section-dark .section-label,
.section-dark .eyebrow {
  color: var(--clay-light);
}

.section-dark .section-title {
  color: var(--white);
}

.section-dark .section-title em {
  color: var(--clay-light);
}

.section-dark .section-sub,
.section-dark p {
  color: rgba(255, 255, 255, 0.5);
}

.section-dark a:not(.btn):not(.btn-primary):not(.btn-outline) {
  color: var(--clay-light);
}

.section-dark .card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
  color: var(--white);
}

.section-dark .card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(196, 98, 45, 0.3);
}

.section-dark .card h3 {
  color: var(--white);
}

.section-dark .card p {
  color: rgba(255, 255, 255, 0.5);
}


/* ================================================================
   MARQUEE TRUST STRIP
   Horizontal scrolling value props strip.
   ================================================================ */
.marquee-strip {
  background: var(--ink);
  padding: 14px 0;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.marquee-strip::before,
.marquee-strip::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  z-index: 1;
  pointer-events: none;
}

.marquee-strip::before {
  left: 0;
  background: linear-gradient(90deg, var(--ink) 0%, transparent 100%);
}

.marquee-strip::after {
  right: 0;
  background: linear-gradient(90deg, transparent 0%, var(--ink) 100%);
}

.marquee-track {
  display: inline-flex;
  animation: marqueeScroll 40s linear infinite;
}

.marquee-strip:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
}

.marquee-dot {
  width: 4px;
  height: 4px;
  background: var(--clay);
  border-radius: 50%;
  flex-shrink: 0;
}


/* ================================================================
   FOOTER
   Dark bg, grid layout, newsletter, links, copyright.
   ================================================================ */
footer {
  background: var(--ink);
  color: var(--white);
  padding: 0;
  position: relative;
}

/* Clay accent bar at top of footer */
footer::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--clay), var(--clay-light), var(--clay));
}

footer .footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 56px var(--space-2xl) 40px;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.footer-brand {
  font-family: var(--serif);
  font-size: 26px;
  color: var(--clay-light);
  margin-bottom: 12px;
}

.footer-tagline {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.65;
  max-width: 240px;
}

.footer-col h5 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 16px;
  font-family: var(--sans);
}

.footer-col a {
  display: block;
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  margin-bottom: var(--space-sm);
  transition: color var(--duration-fast) ease;
}

.footer-col a:hover {
  color: var(--white);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copy {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.footer-legal {
  display: flex;
  gap: 20px;
}

.footer-legal a {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

.footer-legal a:hover {
  color: rgba(255, 255, 255, 0.5);
}

/* Footer newsletter */
.footer-newsletter {
  margin-bottom: 10px;
}

.footer-newsletter h5 {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 12px;
}

.footer-newsletter p {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.5;
  margin-bottom: 14px;
}

.footer-newsletter-form {
  display: flex;
  gap: 8px;
}

.footer-newsletter-input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: var(--white);
  font-size: 14px;
  font-family: var(--sans);
  outline: none;
  transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease;
  min-width: 0;
}

.footer-newsletter-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.footer-newsletter-input:focus {
  border-color: var(--clay);
  background: rgba(255, 255, 255, 0.1);
}

.footer-newsletter-btn {
  padding: 12px 20px;
  background: var(--clay);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.footer-newsletter-btn:hover {
  background: var(--clay-light);
  transform: translateY(-1px);
}


/* ================================================================
   LOADING
   Full-page loading screen and inline spinner.
   ================================================================ */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  transition: opacity var(--duration-slow) ease;
}

.loading-screen .loading-logo {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 700;
  color: var(--clay);
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--sand);
  border-top-color: var(--clay);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner--sm {
  width: 18px;
  height: 18px;
}

.spinner--white {
  border-color: rgba(255, 255, 255, 0.4);
  border-top-color: var(--white);
}


/* ================================================================
   TOAST
   Fixed bottom-right notification container (for js/toast.js).
   ================================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink);
  color: var(--white);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s var(--ease-spring);
  z-index: 1000;
  max-width: 360px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.toast-success {
  background: #166534;
}

.toast.toast-error {
  background: #991B1B;
}


/* ================================================================
   UTILITIES
   ================================================================ */

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-2xl);
}

/* Eyebrow text */
.eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--clay);
  margin-bottom: 12px;
}

/* Section label */
.section-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clay);
  margin-bottom: 12px;
}

/* Section title (reusable) */
.section-title {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  margin-bottom: 16px;
  line-height: 1.12;
  letter-spacing: -0.03em;
  padding-bottom: 0.08em;
}

.section-title em {
  font-style: italic;
  color: var(--clay);
}

/* Section subtitle */
.section-sub {
  font-size: var(--text-lg);
  color: var(--warm-grey);
  line-height: 1.65;
  max-width: 580px;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: var(--space-lg) 0;
  color: var(--warm-grey);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--sand);
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--sand) 25%, #ede8e0 50%, var(--sand) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
