/* VerityGuard — Homepage styles.
   Layers on top of the design system (css/styles.css): page-shared rules,
   the Button component (ported from the design-system React primitive), and
   responsive behavior for the multi-column layouts. */

/* ---------- Page-shared base ---------- */
body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-body);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-strong);
  font-weight: 700;
  margin: 0;
}
a { text-decoration: none; color: inherit; }

/* Smooth in-page navigation, offset for the sticky header */
html { scroll-behavior: smooth; scroll-padding-top: 90px; }

.vg-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Nav + link hovers */
.vg-nav-link { transition: color var(--duration-fast) var(--ease-standard); }
.vg-nav-link:hover { color: var(--text-strong); }
.vg-flink { transition: color var(--duration-fast) var(--ease-standard); }
.vg-flink:hover { color: var(--text-brand); }

/* Interactive product card lift */
.vg-prod {
  transition: box-shadow var(--duration-base) var(--ease-standard),
              transform var(--duration-base) var(--ease-standard);
}
.vg-prod:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }

/* Motion motifs */
@keyframes vgFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes vgFlow { to { stroke-dashoffset: -32; } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
  .vg-prod { transition: box-shadow var(--duration-base) var(--ease-standard); }
  .vg-prod:hover { transform: none; }
}

/* ---------- Button (design-system primitive, ported to CSS) ---------- */
.vg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard);
}
.vg-btn svg { display: block; }
.vg-btn--lg { height: 52px; padding: 0 26px; font-size: var(--text-base); }

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

.vg-btn--outline {
  background: transparent;
  color: var(--text-strong);
  border-color: var(--border-strong);
}
.vg-btn--outline:hover { background: var(--surface-subtle); color: var(--text-strong); }
.vg-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Inline spinner for the submitting state */
.vg-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: vgSpin 0.7s linear infinite;
}
@keyframes vgSpin { to { transform: rotate(360deg); } }

/* ---------- Contact form ---------- */
.vg-form-card {
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 40px;
}

.vg-form { display: flex; flex-direction: column; gap: 20px; }
/* Author display rules outrank the UA [hidden] rule on source order, so make
   hiding explicit for the elements toggled by contact.js. */
.vg-form[hidden] { display: none; }
.vg-field { display: flex; flex-direction: column; gap: 8px; }
/* Two-up row: subgrid keeps the label / input / error rows aligned across both
   fields even when one label wraps (e.g. "Company / organization"). */
.vg-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 20px;
  row-gap: 8px;
}
.vg-form-row .vg-field {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 3;
}

.vg-label {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-strong);
}

.vg-input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text-body);
  background: var(--surface-page);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-fast) var(--ease-standard);
}
.vg-input::placeholder { color: var(--text-subtle); }
.vg-input:hover { border-color: var(--gray-400); }
.vg-input:focus {
  outline: none;
  border-color: var(--border-brand);
  box-shadow: var(--shadow-focus);
}
.vg-input[aria-invalid="true"] { border-color: var(--danger-fg); }
.vg-input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--danger-bg); }

.vg-textarea { resize: vertical; min-height: 132px; line-height: 1.55; }

/* Select: strip native chrome, add a custom chevron */
.vg-select {
  cursor: pointer;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%235b6883' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px 18px;
}

.vg-error {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--danger-fg);
}
.vg-error:empty { display: none; }

.vg-form-status {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.5;
}
.vg-form-status:empty { display: none; }
.vg-form-status[data-state="error"] { color: var(--danger-fg); }

.vg-form .vg-btn--lg { width: 100%; margin-top: 4px; }

/* Honeypot — kept in the DOM for bots, removed from view and the a11y tree */
.vg-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Success state (replaces the form after a successful submission) */
.vg-form-success { text-align: center; padding: 20px 8px; }
.vg-form-success:focus { outline: none; }
.vg-form-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success-fg);
}
.vg-form-success h3 { font-size: var(--text-lg); color: var(--text-strong); letter-spacing: -0.015em; }
.vg-form-success p { margin-top: 10px; font-size: var(--text-sm); line-height: 1.6; color: var(--text-muted); }

/* ---------- Responsive ---------- */

/* Tablet / small-desktop: collapse the wide two-up + four-up layouts. */
@media (max-width: 960px) {
  .vg-hero-grid {
    grid-template-columns: 1fr !important;
    gap: 48px !important;
    padding-top: 88px !important;
    padding-bottom: 88px !important;
  }
  .vg-hero-visual { min-height: 0 !important; }
  .vg-company-intro { grid-template-columns: 1fr !important; gap: 32px !important; }
  .vg-products-grid { grid-template-columns: 1fr !important; }
  .vg-connectors { display: none !important; }
  .vg-grid-4 { grid-template-columns: repeat(2, 1fr) !important; gap: 44px !important; }
  .vg-rail-grid { grid-template-columns: repeat(2, 1fr) !important; row-gap: 40px !important; }
  .vg-rail-line, .vg-rail-chevrons { display: none !important; }
  .vg-contact-grid { grid-template-columns: 1fr !important; gap: 44px !important; }
}

/* Phone: single column everything; drop internal dividers/decorations. */
@media (max-width: 640px) {
  .vg-feature-3 { grid-template-columns: 1fr !important; }
  .vg-feature-3 > div {
    padding: 32px 0 8px !important;
    border-left: 0 !important;
    border-top: 1px solid var(--border-default);
  }
  .vg-feature-3 > div:first-child { border-top: 0; }
  .vg-grid-4 { grid-template-columns: 1fr !important; gap: 36px !important; }
  .vg-rail-grid { grid-template-columns: 1fr !important; }
  .vg-rail { padding: 40px 28px !important; }

  /* Nav wraps under the logo on narrow screens */
  .vg-header-inner { height: auto !important; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
  .vg-nav { width: 100%; justify-content: flex-start; gap: 18px !important; flex-wrap: wrap; }

  /* Tame the generous vertical rhythm on phones */
  .vg-pad { padding-top: 80px !important; padding-bottom: 80px !important; }
  .vg-contact-panel { padding: 48px 20px !important; }
  .vg-btn--lg { width: 100%; }
  .vg-cta-row { width: 100%; }

  /* Contact form stacks to a single column (reset the desktop subgrid) */
  .vg-form-row {
    grid-template-columns: 1fr !important;
    grid-template-rows: none !important;
    row-gap: 20px !important;
  }
  .vg-form-row .vg-field { display: flex !important; grid-row: auto !important; }
  .vg-form-card { padding: 28px 22px !important; }
}
