/* ─────────────────────────────────────────────────────────
   Automation Ace — Components
   Reusable UI blocks: nav, buttons, cards, badges, forms, footer
   ───────────────────────────────────────────────────────── */

/* ── Navigation ─────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 200;
  display: flex;
  align-items: center;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(8, 8, 8, 0.88);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom-color: var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-24);
  width: 100%;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.nav-logo .bolt {
  color: var(--gold);
  line-height: 1;
  font-style: normal;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-40);
}
.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--t);
  position: relative;
  padding-bottom: 2px;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 1px;
  background: var(--red-bright);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t) var(--ease);
}
.nav-links a:hover        { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a.active       { color: var(--text); }
.nav-links a.active::after{ transform: scaleX(1); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  flex-shrink: 0;
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: var(--sp-8);
  border-radius: var(--r-sm);
  transition: background var(--t);
  z-index: 201;
}
.nav-hamburger:hover { background: var(--bg-card); }
.nav-hamburger span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--text);
  border-radius: 1px;
  transition: transform var(--t-lg) var(--ease), opacity var(--t) var(--ease);
  transform-origin: center;
}
.nav-hamburger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile Overlay */
.nav-mobile {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 199;
  background: var(--bg);
  padding: calc(var(--nav-h) + var(--sp-32)) var(--sp-24) var(--sp-32);
  flex-direction: column;
}
.nav-mobile.is-open { display: flex; }
.nav-mobile-links {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}
.nav-mobile-links a {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-muted);
  padding: var(--sp-16) 0;
  border-bottom: 1px solid var(--border);
  transition: color var(--t);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-mobile-links a:hover { color: var(--text); }
.nav-mobile-links a::after { content: '→'; font-size: 1.25rem; opacity: 0.4; }
.nav-mobile-cta {
  margin-top: var(--sp-32);
  display: flex;
  flex-direction: column;
  gap: var(--sp-12);
}
.nav-mobile-cta .btn { text-align: center; justify-content: center; }

@media (max-width: 900px) {
  .nav-links  { display: none; }
  .nav-hamburger { display: flex; }
}
@media (max-width: 640px) {
  .nav-actions .btn:not(.btn-primary) { display: none; }
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  padding: 11px 22px;
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  transition: background var(--t) var(--ease),
              border-color var(--t) var(--ease),
              transform var(--t) var(--ease),
              box-shadow var(--t) var(--ease),
              color var(--t) var(--ease);
  cursor: pointer;
}

.btn-primary {
  background: var(--red);
  color: #fff;
  border: 1px solid var(--red);
}
.btn-primary:hover {
  background: var(--red-bright);
  border-color: var(--red-bright);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--red-glow);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-mid);
}
.btn-outline:hover {
  background: var(--bg-card);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}
.btn-ghost:hover { color: var(--text); background: var(--bg-card); }

.btn-gold {
  background: var(--gold);
  color: #060606;
  border: 1px solid var(--gold);
  font-weight: 700;
}
.btn-gold:hover {
  background: #f5ca50;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--gold-glow);
}

.btn-sm  { padding: 8px 16px; font-size: 0.8125rem; }
.btn-lg  { padding: 14px 28px; font-size: 0.9375rem; }
.btn-xl  { padding: 18px 36px; font-size: 1rem; }
.btn-full { width: 100%; }

.btn .arrow { transition: transform var(--t) var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-24);
  transition: border-color var(--t), transform var(--t-lg) var(--ease), box-shadow var(--t-lg) var(--ease);
}
.card:hover {
  border-color: var(--border-light);
  transform: translateY(-3px);
  box-shadow: 0 20px 48px rgba(0,0,0,0.5);
}
.card-red:hover {
  border-color: var(--red);
  box-shadow: 0 16px 40px var(--red-glow), 0 0 0 1px var(--red);
}
.card-link { cursor: pointer; }

.card-icon {
  width: 44px; height: 44px;
  background: var(--red-glow-sm);
  border: 1px solid rgba(142,18,16,0.2);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: var(--sp-16);
  flex-shrink: 0;
}

.card h3, .card h4 { color: var(--text); margin-bottom: var(--sp-8); }
.card p { font-size: 0.9rem; line-height: 1.7; }

/* ── Credential Tiles ────────────────────────────────────── */
.cred-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-16);
}
.cred-tile {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-16);
  padding: var(--sp-20);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color var(--t), box-shadow var(--t);
  cursor: pointer;
}
.cred-tile:hover {
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red), 0 8px 32px var(--red-glow);
}
.cred-logo {
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.cred-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.cred-info {}
.cred-platform {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.cred-title { font-family: var(--font-display); font-weight: 700; font-size: 0.9375rem; color: var(--text); margin-bottom: 2px; }
.cred-sub   { font-size: 0.75rem; color: var(--text-muted); }

@media (max-width: 1024px) { .cred-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .cred-grid { grid-template-columns: 1fr; } }

/* ── Stat Block ──────────────────────────────────────────── */
.stat { display: flex; flex-direction: column; }
.stat-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.25rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
}
.stat-num .accent { color: var(--gold); }
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-top: var(--sp-4);
}

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-red   { background: var(--red-glow);  color: var(--red-bright); border: 1px solid rgba(142,18,16,0.35); }
.badge-gold  { background: var(--gold-dim);  color: var(--gold);       border: 1px solid rgba(240,192,56,0.3); }
.badge-white { background: rgba(255,255,255,0.05); color: var(--text-muted); border: 1px solid var(--border-mid); }
.badge-green { background: rgba(16,185,129,0.1); color: #10b981; border: 1px solid rgba(16,185,129,0.25); }

/* ── Stars ───────────────────────────────────────────────── */
.stars { color: var(--gold); letter-spacing: 2px; font-size: 0.8125rem; }

/* ── Review Cards ────────────────────────────────────────── */
.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-24);
  position: relative;
  transition: border-color var(--t), box-shadow var(--t);
}
.review-card:hover { border-color: var(--border-light); box-shadow: 0 16px 40px rgba(0,0,0,0.4); }
.review-quote-mark {
  position: absolute;
  top: var(--sp-16);
  right: var(--sp-20);
  font-family: var(--font-display);
  font-size: 3.5rem;
  line-height: 1;
  color: var(--border-light);
  user-select: none;
}
.review-text {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text);
  margin: var(--sp-12) 0 var(--sp-20);
  padding-right: var(--sp-32);
}
.review-meta { display: flex; align-items: center; gap: var(--sp-12); }
.review-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--red-glow);
  border: 1px solid var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--red-bright);
  flex-shrink: 0;
}
.review-author  { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.review-via     { font-size: 0.75rem;  color: var(--text-muted); }

/* ── App Logo Cloud ──────────────────────────────────────── */
.logo-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-12);
  align-items: center;
}
.logo-item {
  height: 28px;
  filter: grayscale(1) brightness(1.5);
  opacity: 0.35;
  transition: filter var(--t), opacity var(--t);
  flex-shrink: 0;
}
.logo-item:hover { filter: none; opacity: 1; }
.logo-item img { height: 100%; width: auto; object-fit: contain; }
.logo-text-item {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  white-space: nowrap;
  transition: border-color var(--t), color var(--t), background var(--t);
}
.logo-text-item:hover { border-color: var(--border-light); color: var(--text); background: var(--bg-hover); }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: var(--sp-8); }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-16); }

.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}
.form-required { color: var(--red-bright); margin-left: 2px; }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  color: var(--text);
  font-size: 0.9375rem;
  transition: border-color var(--t), box-shadow var(--t);
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-dim); }
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}
.form-textarea { resize: vertical; min-height: 130px; line-height: 1.6; }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath stroke='%236a6a6a' stroke-width='1.5' fill='none' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-hint { font-size: 0.75rem; color: var(--text-muted); }

.form-submit-wrap { display: flex; align-items: center; gap: var(--sp-16); flex-wrap: wrap; }

.form-status {
  padding: var(--sp-16) var(--sp-20);
  border-radius: var(--r-md);
  font-weight: 500;
  font-size: 0.9rem;
  display: none;
}
.form-status.show { display: block; }
.form-status.success { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.25); color: #10b981; }
.form-status.error   { background: var(--red-glow); border: 1px solid rgba(142,18,16,0.3); color: var(--red-bright); }

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ── Newsletter Strip ────────────────────────────────────── */
.newsletter-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-48) var(--sp-64);
  position: relative;
  overflow: hidden;
}
.newsletter-wrap::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, var(--red-glow) 0%, transparent 70%);
  pointer-events: none;
}
.newsletter-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--sp-48);
  position: relative;
}
.newsletter-form-row {
  display: flex;
  gap: var(--sp-8);
  margin-top: var(--sp-16);
}
.newsletter-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  padding: 11px 16px;
  color: var(--text);
  font-size: 0.9375rem;
  transition: border-color var(--t);
}
.newsletter-input::placeholder { color: var(--text-dim); }
.newsletter-input:focus { outline: none; border-color: var(--red); }

@media (max-width: 768px) {
  .newsletter-wrap { padding: var(--sp-32) var(--sp-24); }
  .newsletter-inner { grid-template-columns: 1fr; gap: var(--sp-24); }
  .newsletter-form-row { flex-direction: column; }
}

/* ── Page Hero (inner pages) ─────────────────────────────── */
.page-hero {
  padding-top: calc(var(--nav-h) + var(--sp-80));
  padding-bottom: var(--sp-80);
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  bottom: -120px; right: -80px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--red-glow) 0%, transparent 70%);
  pointer-events: none;
}
.page-hero-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  margin-bottom: var(--sp-24);
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.page-hero-breadcrumb a { transition: color var(--t); }
.page-hero-breadcrumb a:hover { color: var(--text); }
.page-hero-breadcrumb span { color: var(--text-dim); }

/* ── CTA Section ─────────────────────────────────────────── */
.cta-section {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-96) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 0%, var(--red-glow) 0%, transparent 60%);
  pointer-events: none;
}
.cta-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-12);
  margin-top: var(--sp-32);
  flex-wrap: wrap;
}

/* ── Footer ──────────────────────────────────────────────── */
footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: var(--sp-80) 0 var(--sp-40);
}
.footer-top {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1.2fr;
  gap: var(--sp-64);
  padding-bottom: var(--sp-64);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-40);
}
.footer-brand {}
.footer-brand .nav-logo { margin-bottom: var(--sp-16); }
.footer-brand .tagline {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: var(--sp-20);
}
.footer-contact-info { display: flex; flex-direction: column; gap: var(--sp-8); }
.footer-contact-info a {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  font-size: 0.8125rem;
  color: var(--text-muted);
  transition: color var(--t);
}
.footer-contact-info a:hover { color: var(--text); }
.footer-contact-icon { font-size: 0.875rem; width: 16px; flex-shrink: 0; }

.footer-col h5 {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: var(--sp-20);
  padding-bottom: var(--sp-8);
  border-bottom: 1px solid var(--border);
}
.footer-col ul { display: flex; flex-direction: column; gap: var(--sp-12); }
.footer-col a { font-size: 0.875rem; color: var(--text-muted); transition: color var(--t); }
.footer-col a:hover { color: var(--text); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-16);
}
.footer-copy { font-size: 0.8125rem; color: var(--text-muted); }
.footer-copy .since { color: var(--gold); }

.footer-social {
  display: flex;
  gap: var(--sp-8);
}
.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  font-size: 0.8125rem;
  color: var(--text-muted);
  transition: border-color var(--t), color var(--t), background var(--t);
}
.footer-social a:hover {
  border-color: var(--red);
  color: var(--text);
  background: var(--red-glow-sm);
}

.footer-legal {
  display: flex;
  gap: var(--sp-20);
  flex-wrap: wrap;
}
.footer-legal a { font-size: 0.75rem; color: var(--text-muted); transition: color var(--t); }
.footer-legal a:hover { color: var(--text); }

@media (max-width: 1024px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: var(--sp-40); }
}
@media (max-width: 600px) {
  .footer-top { grid-template-columns: 1fr; gap: var(--sp-32); }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ── Divider with label ───────────────────────────────────── */
.divider-label {
  display: flex;
  align-items: center;
  gap: var(--sp-16);
  color: var(--text-dim);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: var(--sp-48) 0;
}
.divider-label::before,
.divider-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Tooltips ────────────────────────────────────────────── */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-hover);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  padding: 5px 10px;
  font-size: 0.75rem;
  color: var(--text);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t);
}
[data-tip]:hover::after { opacity: 1; }

/* ── Prose (long-form pages) ─────────────────────────────── */
.prose h2 { margin-top: var(--sp-48); margin-bottom: var(--sp-16); }
.prose h3 { margin-top: var(--sp-32); margin-bottom: var(--sp-12); font-size: 1.25rem; }
.prose p  { margin-bottom: var(--sp-16); }
.prose ul, .prose ol { margin: var(--sp-16) 0; padding-left: var(--sp-24); color: var(--text-muted); }
.prose ul  { list-style: disc; }
.prose ol  { list-style: decimal; }
.prose li  { margin-bottom: var(--sp-8); line-height: 1.7; }
.prose a   { color: var(--red-bright); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--text); }
.prose strong  { color: var(--text); }
.prose hr  { margin: var(--sp-48) 0; border: none; border-top: 1px solid var(--border); }

/* ── Tag pill list ───────────────────────────────────────── */
.tag-cloud { display: flex; flex-wrap: wrap; gap: var(--sp-8); }
.tag {
  display: inline-flex;
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  transition: border-color var(--t), color var(--t);
}
.tag:hover { border-color: var(--border-light); color: var(--text); }
