/* ═══════════════════════════════════════════════════════════════════════════
   BARBERPRIME SAAS — MAIN STYLESHEET
   Base · Reset · Typography · Header · Footer · Utilities
═══════════════════════════════════════════════════════════════════════════ */

/* ─── FONTS (local, perf) ─────────────────────────────────────────────── */
@font-face {
  font-family: 'Playfair Display';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/playfair-display-v40-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/playfair-display-v40-latin-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-weight: 700;
  font-style: italic;
  font-display: swap;
  src: url('../fonts/playfair-display-v40-latin-700italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/playfair-display-v40-latin-800.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/dm-sans-v17-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/dm-sans-v17-latin-500.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/dm-sans-v17-latin-600.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/dm-sans-v17-latin-700.woff2') format('woff2');
}

/* ─── TOKENS ──────────────────────────────────────────────────────────── */
:root {
  /* Gold scale */
  --bp-gold-50:  #FBF7EA;
  --bp-gold-100: #F5EBC5;
  --bp-gold-200: #EEDB95;
  --bp-gold-300: #E4C565;
  --bp-gold-400: #D4AF37;
  --bp-gold-500: #B8960C;
  --bp-gold-600: #94790A;

  /* Ink scale */
  --bp-ink-50:  #F5F0E8;
  --bp-ink-100: #E8DFCB;
  --bp-ink-200: #CFC2A3;
  --bp-ink-300: #A99C7E;
  --bp-ink-400: #7A6F5A;
  --bp-ink-500: #3E382D;
  --bp-ink-600: #2A2620;
  --bp-ink-700: #1A1710;
  --bp-ink-800: #14110B;
  --bp-ink-900: #0D0B07;
  --bp-ink-950: #080602;

  /* Utility */
  --bp-success: #2e7d32;
  --bp-warn:    #d35400;
  --bp-danger:  #c0392b;

  /* Container */
  --bp-wrap: 1200px;

  /* Radius */
  --bp-r-sm: 6px;
  --bp-r-md: 10px;
  --bp-r-lg: 16px;
  --bp-r-xl: 24px;

  /* Shadows */
  --bp-shadow-sm: 0 2px 8px rgba(0,0,0,.06);
  --bp-shadow-md: 0 8px 24px rgba(0,0,0,.08);
  --bp-shadow-lg: 0 24px 60px rgba(0,0,0,.12);
  --bp-shadow-glow: 0 0 0 1px rgba(212,175,55,.3), 0 20px 60px rgba(212,175,55,.18), 0 0 80px rgba(212,175,55,.08);
}

/* Theme — Dark (default) */
[data-theme="dark"] {
  --bp-bg:         var(--bp-ink-950);
  --bp-bg-elev:    var(--bp-ink-900);
  --bp-bg-card:    var(--bp-ink-800);
  --bp-border:     rgba(212,175,55,.12);
  --bp-border-hi:  rgba(212,175,55,.3);
  --bp-text:       var(--bp-ink-50);
  --bp-text-soft:  rgba(245,240,232,.7);
  --bp-text-faint: rgba(245,240,232,.4);
  --bp-accent:     var(--bp-gold-400);
  color-scheme: dark;
}

/* Theme — Light */
[data-theme="light"] {
  --bp-bg:         #FAFAF7;
  --bp-bg-elev:    #FFFFFF;
  --bp-bg-card:    #FFFFFF;
  --bp-border:     #E8E0D0;
  --bp-border-hi:  #D4AF37;
  --bp-text:       var(--bp-ink-800);
  --bp-text-soft:  rgba(26,23,16,.7);
  --bp-text-faint: rgba(26,23,16,.4);
  --bp-accent:     var(--bp-gold-500);
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--bp-text);
  background: var(--bp-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .3s ease, color .3s ease;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color .2s ease;
}
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--bp-accent);
  outline-offset: 2px;
  border-radius: 3px;
}

button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--bp-text);
}

p { color: var(--bp-text-soft); }

code { font-family: 'JetBrains Mono', 'Menlo', 'Monaco', monospace; font-size: 0.88em; }

/* ─── LAYOUT ──────────────────────────────────────────────────────────── */
.bpsaas-wrap {
  width: 100%;
  max-width: var(--bp-wrap);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
}

.bpsaas-skip-link {
  position: absolute;
  left: -9999px;
  top: 10px;
  background: var(--bp-gold-400);
  color: #000;
  padding: 10px 16px;
  border-radius: var(--bp-r-md);
  z-index: 9999;
}
.bpsaas-skip-link:focus { left: 10px; }

/* ─── HEADER ──────────────────────────────────────────────────────────── */
.bpsaas-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bp-bg-elev) 85%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--bp-border);
  transition: all .3s ease;
}

.bpsaas-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}

.bpsaas-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.bpsaas-logo {
  max-height: 44px;
  width: auto;
}
.bpsaas-logo-light { display: none; }
.bpsaas-logo-dark  { display: block; }
[data-theme="light"] .bpsaas-logo-dark  { display: none; }
[data-theme="light"] .bpsaas-logo-light { display: block; }

.bpsaas-brand-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--bp-accent);
}
.bpsaas-brand-text span { color: var(--bp-text); font-weight: 400; }

.bpsaas-nav-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
}

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

.bpsaas-nav a {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--bp-text-soft);
  letter-spacing: 0.02em;
  position: relative;
  padding: 6px 0;
}
.bpsaas-nav a:hover { color: var(--bp-accent); }
.bpsaas-nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--bp-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.bpsaas-nav a:hover::after { transform: scaleX(1); }

.bpsaas-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.bpsaas-theme-toggle {
  width: 40px; height: 40px;
  border-radius: var(--bp-r-md);
  border: 1px solid var(--bp-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--bp-text-soft);
  transition: all .2s ease;
}
.bpsaas-theme-toggle:hover { color: var(--bp-accent); border-color: var(--bp-accent); }
.bpsaas-i-moon { display: inline-flex; }
.bpsaas-i-sun  { display: none; }
[data-theme="light"] .bpsaas-i-moon { display: none; }
[data-theme="light"] .bpsaas-i-sun  { display: inline-flex; }

/* Login/Account link no header */
.bpsaas-header-login {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--bp-r-md);
  border: 1px solid var(--bp-border);
  color: var(--bp-text-soft);
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  transition: all .2s ease;
  white-space: nowrap;
}
.bpsaas-header-login:hover {
  border-color: var(--bp-accent);
  color: var(--bp-accent);
  background: color-mix(in srgb, var(--bp-gold-400) 5%, transparent);
}
.bpsaas-header-login svg { flex-shrink: 0; }

.bpsaas-mobile-login {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--bp-border) !important;
}
.bpsaas-mobile-login a {
  color: var(--bp-accent) !important;
  font-weight: 600;
}

/* Mobile menu toggle */
.bpsaas-menu-toggle {
  display: none;
  width: 40px; height: 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-r-md);
}
.bpsaas-menu-toggle span {
  width: 18px;
  height: 2px;
  background: var(--bp-text);
  border-radius: 1px;
  transition: all .2s ease;
}

.bpsaas-mobile-nav {
  position: fixed;
  inset: 72px 0 0 0;
  background: var(--bp-bg-elev);
  z-index: 90;
  padding: 40px 24px;
  overflow-y: auto;
}
.bpsaas-mobile-menu { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.bpsaas-mobile-menu a { display: block; padding: 16px 20px; font-size: 1.1rem; font-weight: 500; color: var(--bp-text); border-bottom: 1px solid var(--bp-border); }

@media (max-width: 920px) {
  .bpsaas-nav-wrap      { display: none; }
  .bpsaas-header-cta    { display: none; }
  .bpsaas-header-login  { display: none; }
  .bpsaas-menu-toggle   { display: inline-flex; }
}

/* ─── BUTTONS ─────────────────────────────────────────────────────────── */
.bpsaas-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--bp-r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .25s cubic-bezier(.2,.8,.2,1);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.bpsaas-btn-lg { padding: 14px 28px; font-size: 1rem; }
.bpsaas-btn-xl { padding: 18px 36px; font-size: 1.05rem; }
.bpsaas-btn-block { width: 100%; }

.bpsaas-btn-primary {
  background: linear-gradient(135deg, var(--bp-gold-300), var(--bp-gold-400) 50%, var(--bp-gold-500));
  color: #0D0B07;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(212,175,55,.3);
  position: relative;
  overflow: hidden;
}
.bpsaas-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(212,175,55,.45);
}
.bpsaas-btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  transform: translateX(-100%);
  transition: transform .6s;
}
.bpsaas-btn-primary:hover::after { transform: translateX(100%); }

.bpsaas-btn-outline {
  background: transparent;
  color: var(--bp-text);
  border-color: var(--bp-border-hi);
}
.bpsaas-btn-outline:hover {
  background: color-mix(in srgb, var(--bp-gold-400) 8%, transparent);
  border-color: var(--bp-accent);
  color: var(--bp-accent);
}

.bpsaas-btn-ghost {
  background: transparent;
  color: var(--bp-text);
  border-color: var(--bp-border);
}
.bpsaas-btn-ghost:hover {
  border-color: var(--bp-accent);
  color: var(--bp-accent);
}

/* ─── FOOTER ──────────────────────────────────────────────────────────── */
.bpsaas-footer {
  margin-top: 80px;
  background: var(--bp-bg-elev);
  border-top: 1px solid var(--bp-border);
  padding-top: 60px;
}

.bpsaas-footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: 48px;
  padding-bottom: 48px;
}

.bpsaas-footer-logo img { max-height: 40px; margin-bottom: 14px; }
.bpsaas-footer-logo strong {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--bp-accent);
  display: block;
  margin-bottom: 14px;
}
.bpsaas-footer-tagline { font-size: 0.9rem; line-height: 1.6; max-width: 280px; }

.bpsaas-footer-col h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bp-text-faint);
  margin-bottom: 16px;
}
.bpsaas-footer-col ul { list-style: none; }
.bpsaas-footer-col li { margin-bottom: 10px; }
.bpsaas-footer-col a {
  font-size: 0.9rem;
  color: var(--bp-text-soft);
  transition: color .2s ease;
}
.bpsaas-footer-col a:hover { color: var(--bp-accent); }

.bpsaas-footer-bottom {
  border-top: 1px solid var(--bp-border);
  padding: 24px 0;
}
.bpsaas-footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.bpsaas-footer-bottom small { color: var(--bp-text-faint); font-size: 0.82rem; }
.bpsaas-footer-signature { font-style: italic; }

@media (max-width: 820px) {
  .bpsaas-footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .bpsaas-footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 500px) {
  .bpsaas-footer-grid { grid-template-columns: 1fr; }
}

/* ─── WHATSAPP FLOAT ──────────────────────────────────────────────────── */
.bpsaas-wa-btn {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 56px; height: 56px;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(37,211,102,.35), 0 0 0 1px rgba(0,0,0,.05);
  z-index: 80;
  transition: transform .2s ease;
}
.bpsaas-wa-btn:hover { transform: scale(1.08); }
.bpsaas-wa-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: #25D366;
  opacity: .35;
  animation: wa-pulse 2s ease-out infinite;
  z-index: -1;
}
@keyframes wa-pulse {
  0% { transform: scale(1); opacity: .35; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* ─── PAGE WRAPPERS ───────────────────────────────────────────────────── */
.bpsaas-page-wrap { padding: 80px 0; }
.bpsaas-page-narrow { max-width: 800px; }
.bpsaas-page-title {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 32px;
}
.bpsaas-page-content h2 { font-size: 1.6rem; margin: 40px 0 16px; }
.bpsaas-page-content h3 { font-size: 1.25rem; margin: 28px 0 12px; }
.bpsaas-page-content p  { margin-bottom: 16px; line-height: 1.75; }
.bpsaas-page-content ul, .bpsaas-page-content ol { margin: 0 0 16px 24px; color: var(--bp-text-soft); }
.bpsaas-page-content li { margin-bottom: 6px; }
.bpsaas-page-content a  { color: var(--bp-accent); text-decoration: underline; }

/* ─── 404 ─────────────────────────────────────────────────────────────── */
.bpsaas-404 { padding: 100px 0; text-align: center; }
.bpsaas-404-code {
  font-family: 'Playfair Display', serif;
  font-size: clamp(5rem, 15vw, 10rem);
  font-weight: 800;
  color: var(--bp-accent);
  line-height: 1;
  margin-bottom: 20px;
}
.bpsaas-404-title { font-size: clamp(1.5rem, 3vw, 2.25rem); margin-bottom: 12px; }
.bpsaas-404-desc { color: var(--bp-text-soft); margin-bottom: 32px; }

/* ─── REDUCED MOTION ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ACESSIBILIDADE — WCAG 2.1 AA / AAA
═══════════════════════════════════════════════════════════════════════════ */

/* Focus visible com contraste alto */
*:focus-visible {
    outline: 3px solid var(--bp-gold);
    outline-offset: 2px;
    border-radius: 4px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3);
}

/* Touch targets mínimo 44x44 (WCAG 2.5.5) */
button,
a.bpsaas-btn,
input[type="button"],
input[type="submit"],
input[type="reset"] {
    min-height: 44px;
    min-width: 44px;
}

/* Visually hidden — para conteúdo só pra screen reader */
.bpsaas-sr-only,
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Reduced motion — respeito completo */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode (Windows) */
@media (forced-colors: active) {
    .bpsaas-btn {
        border: 2px solid currentColor;
    }
    .bpsaas-btn-primary {
        background: ButtonFace;
        color: ButtonText;
    }
}

/* Prefers contrast: more — força contraste extra */
@media (prefers-contrast: more) {
    :root {
        --bp-gold: #B8960C;          /* Variação mais escura para contraste */
    }
    .bpsaas-btn-outline {
        border-width: 2px;
    }
}

/* Skip-link visível ao focus */
.bpsaas-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--bp-ink-700, #1A1710);
    color: #F5F0E8;
    padding: 12px 20px;
    z-index: 99999;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 8px 0;
}
.bpsaas-skip-link:focus,
.bpsaas-skip-link:focus-visible {
    left: 8px;
    top: 8px;
    outline: 2px solid var(--bp-gold);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ACESSIBILIDADE: variação de dourado para texto (WCAG AA)
═══════════════════════════════════════════════════════════════════════════ */

:root {
    /* gold-text: variação escura para texto sobre fundo claro (5.51:1 AA) */
    --bp-gold-text: #7B6207;
    /* gold-text-dark: para texto sobre fundo escuro (mantém impacto visual) */
    --bp-gold-text-dark: #D4AF37;
}

/* Quando texto dourado aparece em fundo claro, automaticamente força contraste */
[data-theme="light"] .bpsaas-gold-text,
[data-theme="light"] .bp-gold-text,
[data-theme="light"] a.bpsaas-link-gold {
    color: var(--bp-gold-text) !important;
}

/* Em escuro mantém o dourado original */
[data-theme="dark"] .bpsaas-gold-text,
[data-theme="dark"] .bp-gold-text {
    color: var(--bp-gold-text-dark) !important;
}

/* Footer / labels com dourado em fundo claro, força AA */
[data-theme="light"] footer .bpsaas-link,
[data-theme="light"] .bpsaas-pricing-card-price {
    color: var(--bp-gold-text);
}
