/* ============================================================
   ERPChat Sales Page — styles.css
   ============================================================ */

/* ---------- Reset & base ---------------------------------- */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --navy:        #0f172a;
  --navy-80:     #1e293b;
  --navy-60:     #334155;
  --accent:      #3b82f6;
  --accent-dark: #2563eb;
  --accent-pale: #dbeafe;
  --amber:       #f59e0b;
  --amber-dark:  #d97706;
  --white:       #ffffff;
  --off-white:   #f0f4ff;
  --text-body:   #374151;
  --text-muted:  #6b7280;
  --border:      #e2e8f0;

  --font: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-pill: 999px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.14);

  --transition: 220ms cubic-bezier(.4,0,.2,1);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  color: var(--text-body);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---------- Utility ---------------------------------------- */

.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

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

/* ---------- Buttons ---------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), box-shadow var(--transition),
              transform var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: 0 4px 14px rgba(59,130,246,.35);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,.45);
}

.btn-ghost:hover {
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.75);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: var(--white);
}

/* ---------- Badge chips ------------------------------------ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: .25rem .625rem;
  border-radius: var(--radius-pill);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1;
}

.badge-amber {
  background: var(--amber);
  color: var(--white);
}

.badge-blue {
  background: var(--accent-pale);
  color: var(--accent-dark);
}

/* ---------- Nav -------------------------------------------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15,23,42,.96);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: .625rem;
  text-decoration: none;
}

.nav-logo-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-wordmark {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -.01em;
}

/* ---------- Hero ------------------------------------------- */

.hero {
  background: var(--navy);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(59,130,246,.25) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(59,130,246,.10) 0%, transparent 60%);
  color: var(--white);
  padding-block: 6rem 7rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.04) 1px, transparent 0);
  background-size: 40px 40px;
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1.5rem;
}

.hero-beta-label {
  font-size: .8125rem;
  color: rgba(255,255,255,.65);
  font-weight: 500;
}

.hero h1 {
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.03em;
  max-width: 820px;
  margin-inline: auto;
  margin-bottom: 1.25rem;
}

.hero h1 .accent {
  color: var(--accent);
}

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.1875rem);
  color: rgba(255,255,255,.72);
  max-width: 560px;
  margin-inline: auto;
  margin-bottom: 2.5rem;
  line-height: 1.65;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.hero-scroll-hint {
  margin-top: 4.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  color: rgba(255,255,255,.35);
  font-size: .8125rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  animation: bounce 2.4s ease-in-out infinite;
}

.hero-scroll-hint svg {
  margin-inline: auto;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(5px); }
}

/* ---------- Section scaffolding ---------------------------- */

section {
  padding-block: 5rem;
}

.section-white  { background: var(--white); }
.section-off    { background: var(--off-white); }

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-label {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .75rem;
}

.section-header h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -.025em;
  line-height: 1.2;
  margin-bottom: .75rem;
}

.section-header p {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-inline: auto;
}

/* ---------- Features --------------------------------------- */

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition),
              border-color var(--transition);

  /* animation initial state */
  opacity: 0;
  transform: translateY(24px);
}

.feature-card.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .55s ease, transform .55s ease,
              box-shadow var(--transition), border-color var(--transition);
}

.feature-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-pale);
  transform: translateY(-3px);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: var(--accent-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--accent-dark);
}

.feature-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: .625rem;
  letter-spacing: -.01em;
}

.feature-card p {
  font-size: .9375rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ---------- How it works ----------------------------------- */

.how-it-works { background: var(--navy); color: var(--white); }

.how-it-works .section-header h2 { color: var(--white); }
.how-it-works .section-header p  { color: rgba(255,255,255,.65); }
.how-it-works .section-label      { color: #60a5fa; }

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  position: relative;
}

@media (min-width: 768px) {
  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
  }
}

/* Connector line between steps on desktop */
.steps-grid::before {
  display: none;
}

@media (min-width: 768px) {
  .steps-grid::before {
    content: '';
    display: block;
    position: absolute;
    top: 40px;
    left: calc(100% / 6);
    width: calc(100% * 2 / 3);
    height: 1px;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(59,130,246,.5) 20%,
      rgba(59,130,246,.5) 80%,
      transparent
    );
  }
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 2.5rem;
  position: relative;

  opacity: 0;
  transform: translateY(20px);
}

.step-item.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .6s ease, transform .6s ease;
}

.step-number {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 6px rgba(59,130,246,.18);
  flex-shrink: 0;
}

.step-item h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: .625rem;
  color: var(--white);
}

.step-item p {
  font-size: .9375rem;
  color: rgba(255,255,255,.65);
  line-height: 1.65;
}

/* Vertical connector on mobile */
.step-item + .step-item {
  border-top: 1px solid rgba(255,255,255,.08);
}

@media (min-width: 768px) {
  .step-item + .step-item {
    border-top: none;
    border-left: 1px solid rgba(255,255,255,.08);
  }
}

/* ---------- Privacy callout -------------------------------- */

.privacy-callout {
  background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
  color: var(--white);
  padding-block: 5rem;
  position: relative;
  overflow: hidden;
}

.privacy-callout::after {
  content: '';
  position: absolute;
  right: -80px;
  top: -80px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: rgba(59,130,246,.08);
  pointer-events: none;
}

.privacy-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  .privacy-inner {
    grid-template-columns: 1fr auto;
    gap: 3rem;
  }
}

.privacy-shield {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  background: rgba(59,130,246,.18);
  border: 1px solid rgba(59,130,246,.35);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  color: #60a5fa;
}

.privacy-callout h2 {
  font-size: clamp(1.5rem, 3vw, 2.125rem);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.2;
  margin-bottom: .875rem;
  color: var(--white);
}

.privacy-callout p {
  font-size: 1.0625rem;
  color: rgba(255,255,255,.72);
  line-height: 1.7;
  max-width: 600px;
}

.privacy-callout p + p {
  margin-top: .875rem;
}

.privacy-trust-items {
  display: flex;
  flex-direction: column;
  gap: .875rem;
  flex-shrink: 0;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--radius-sm);
  padding: .875rem 1.25rem;
  min-width: 240px;
}

.trust-icon {
  color: #4ade80;
  flex-shrink: 0;
}

.trust-item span {
  font-size: .9375rem;
  font-weight: 500;
  color: rgba(255,255,255,.88);
}

/* ---------- Register / Form section ----------------------- */

.register-section {
  background: var(--off-white);
}

.register-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 640px;
  margin-inline: auto;
  padding: 2.75rem 2rem;
}

@media (min-width: 640px) {
  .register-card {
    padding: 3rem 3.5rem;
  }
}

.register-card h2 {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -.025em;
  margin-bottom: .625rem;
}

.register-card .register-sub {
  font-size: .9375rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.65;
}

/* Form layout */
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 480px) {
  .form-row.two-col {
    grid-template-columns: 1fr 1fr;
  }
}

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

.form-group label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--navy-60);
}

.form-group label .req {
  color: #ef4444;
  margin-left: .2rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: .6875rem .875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .9375rem;
  color: var(--navy);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.form-group input::placeholder {
  color: #9ca3af;
}

.form-group input:hover,
.form-group select:hover {
  border-color: #94a3b8;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}

.form-group input.is-invalid,
.form-group select.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,.12);
}

.field-error {
  font-size: .8125rem;
  color: #dc2626;
  min-height: 1.1em;
}

/* Select wrapper for custom arrow */
.select-wrapper {
  position: relative;
}

.select-wrapper select {
  padding-right: 2.5rem;
  cursor: pointer;
}

.select-wrapper::after {
  content: '';
  position: absolute;
  right: .875rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--navy-60);
  pointer-events: none;
}

/* Honeypot */
.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
  tab-index: -1;
}

.form-submit-row {
  margin-top: 1.75rem;
}

.form-submit-row .btn {
  width: 100%;
  padding-block: .9375rem;
  font-size: 1rem;
}

.form-error-banner {
  display: none;
  align-items: center;
  gap: .625rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: .875rem 1rem;
  color: #b91c1c;
  font-size: .9rem;
  margin-top: 1.25rem;
}

.form-error-banner.is-shown { display: flex; }

/* Success state */
.form-success {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 0 1rem;
  gap: 1rem;
}

.form-success.is-shown { display: flex; }

.success-icon {
  width: 64px;
  height: 64px;
  background: #dcfce7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #16a34a;
}

.form-success h3 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -.02em;
}

.form-success p {
  font-size: .9375rem;
  color: var(--text-muted);
  max-width: 360px;
  line-height: 1.65;
}

/* ---------- Footer ----------------------------------------- */

.site-footer {
  background: var(--navy);
  padding-block: 2.25rem;
  text-align: center;
}

.site-footer p {
  font-size: .875rem;
  color: rgba(255,255,255,.4);
}

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

@media (max-width: 767px) {
  .hero { padding-block: 4.5rem 5.5rem; }
  section { padding-block: 3.75rem; }
  .register-card { padding: 2rem 1.25rem; }
  .privacy-callout { padding-block: 3.75rem; }
}

/* ---------- Loading state for submit button --------------- */

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

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

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