/* Shared Design Foundation & Interactive Utilities
   Batch #1 Web Redesign Demos — Zero External Dependencies */

:root {
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-alt: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --accent: #0f766e;
  --accent-hover: #115e59;
  --accent-soft: #ccfbf1;
  --accent-contrast: #ffffff;
  --secondary: #0f172a;
  --font-heading: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.12);
  --container-max: 1180px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

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

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.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;
}

/* Container & Layout Helpers */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 20px;
}

.section {
  padding-block: 68px;
}

.section-sm {
  padding-block: 44px;
}

@media (max-width: 768px) {
  .section {
    padding-block: 48px;
  }
  .section-sm {
    padding-block: 32px;
  }
}

.grid {
  display: grid;
  gap: 24px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

@media (max-width: 960px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  margin: 0 0 12px;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 14px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 14px;
}

.section-header {
  max-width: 680px;
  margin-bottom: 40px;
}

.section-header.center {
  margin-inline: auto;
  text-align: center;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}

.section-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
}

/* Dismissible Preview Ribbon */
.preview-banner {
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.82rem;
  line-height: 1.35;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  z-index: 60;
}

.preview-banner[hidden] {
  display: none;
}

.preview-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 8px;
}

.preview-banner-text {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.preview-close-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}

.preview-close-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header.dark-header {
  background: rgba(14, 17, 23, 0.94);
  border-bottom-color: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.15;
  flex-shrink: 0;
  min-width: 0;
}

.brand-link > svg {
  flex-shrink: 0;
}

.brand-link > span {
  min-width: 0;
}

.brand-sub {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.75;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 0.92rem;
  font-weight: 600;
  opacity: 0.86;
  transition: opacity 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.nav-links a:hover {
  opacity: 1;
  color: var(--accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

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

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: inherit;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dark-header .nav-toggle {
  border-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 980px) {
  .brand-link {
    flex: 1 1 auto;
    flex-shrink: 1;
  }
  .nav-links,
  .nav-actions-desktop {
    display: none !important;
  }
  .nav-toggle {
    display: inline-flex;
  }
}

@media (max-width: 520px) {
  .nav-bar {
    gap: 10px;
    min-height: 64px;
  }
  .brand-link {
    font-size: 0.92rem;
    gap: 8px;
  }
  .brand-link > svg {
    width: 32px;
    height: 32px;
  }
  .brand-sub {
    font-size: 0.68rem;
  }
}

.mobile-drawer {
  display: none;
  border-top: 1px solid var(--border);
  padding: 16px 20px 22px;
  background: inherit;
}

.mobile-drawer.is-open {
  display: block;
}

.mobile-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

.mobile-drawer-links a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.1);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.94rem;
  line-height: 1.2;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  text-align: center;
}

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

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

.btn-lg {
  padding: 14px 26px;
  font-size: 1rem;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

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

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

.btn-dark-outline {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.btn-dark-outline:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-whatsapp {
  background: #16a34a;
  color: #ffffff;
}

.btn-whatsapp:hover {
  background: #15803d;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

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

.icon-box {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 14px;
  flex-shrink: 0;
}

/* Trust Strip */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

@media (max-width: 860px) {
  .trust-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .trust-strip {
    grid-template-columns: minmax(0, 1fr);
  }
}

.trust-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.trust-item strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.25;
}

.trust-item span {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Tabs */
.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.tab-btn {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tab-btn.is-active,
.tab-btn[aria-selected="true"] {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

.tab-panel[hidden] {
  display: none;
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}

.faq-btn {
  width: 100%;
  background: transparent;
  border: 0;
  color: inherit;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

.faq-icon {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.faq-btn[aria-expanded="true"] .faq-icon {
  transform: rotate(180deg);
}

.faq-panel {
  padding: 0 20px 18px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.faq-panel[hidden] {
  display: none;
}

/* Forms */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

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

.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.field-input,
.field-select,
.field-textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.field-textarea {
  min-height: 92px;
  resize: vertical;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 84px;
  right: 20px;
  left: 20px;
  pointer-events: none;
  display: flex;
  justify-content: flex-end;
  z-index: 100;
}

.toast {
  pointer-events: auto;
  max-width: 420px;
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
}

.toast a {
  color: #38bdf8;
  font-weight: 700;
  text-decoration: underline;
}

/* Sticky Mobile Action Bar */
.mobile-cta-bar {
  display: none;
}

@media (max-width: 768px) {
  body.has-mobile-cta {
    padding-bottom: 72px;
  }

  .mobile-cta-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .mobile-cta-bar .btn {
    width: 100%;
    padding: 11px 12px;
    font-size: 0.88rem;
  }
}

/* Footer */
.site-footer {
  padding-block: 48px 32px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

@media (max-width: 820px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
}

.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  opacity: 0.8;
}
