/*
 * OAB de Bolso — Design System
 * Tokens extraídos do projeto oabdebolso-site (Astro + Tailwind v4),
 * portados para CSS puro (custom properties) já que estas páginas
 * continuam sendo HTML/CSS/JS estático sem build tool.
 *
 * Usado por: comprar.html, exibir-pix.html, compra-finalizada.html
 */

/* ---------------------------------------------------------------- */
/* Fonts */
/* ---------------------------------------------------------------- */
@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800&family=Open+Sans:wght@400;500;600;700&display=swap");

/* ---------------------------------------------------------------- */
/* Tokens */
/* ---------------------------------------------------------------- */
:root {
  --color-navy-950: #0b1d38;
  --color-navy-900: #112546;
  --color-navy-800: #16305a;
  --color-navy-700: #1e3e68;
  --color-navy-600: #274d80;
  --color-navy-500: #335f9c;

  --color-sky-700: #004d7a;
  --color-sky-600: #00649f;
  --color-sky-500: #1c7fbd;
  --color-sky-400: #449bbe;
  --color-sky-300: #7fc3e0;

  --color-mint-500: #7fd9c4;
  --color-mint-200: #d5efee;
  --color-mint-100: #eaf7f6;

  --color-lime-600: #7c9a2e;
  --color-lime-500: #94b739;
  --color-lime-400: #a8cc4f;

  --color-action-red-700: #b91c1c;
  --color-action-red-600: #dc2626;
  --color-action-red-500: #ef4444;

  --color-cloud-50: #f6f8fb;
  --color-cloud-100: #f3f7fb;
  --color-cloud-200: #e7edf5;

  --color-white: #ffffff;

  --font-heading: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Open Sans", ui-sans-serif, system-ui, sans-serif;

  --shadow-soft: 0 2px 8px 0 rgb(17 37 70 / 0.06), 0 1px 2px 0 rgb(17 37 70 / 0.04);
  --shadow-card: 0 12px 32px -8px rgb(17 37 70 / 0.14), 0 4px 12px -4px rgb(17 37 70 / 0.08);
  --shadow-lift: 0 20px 48px -12px rgb(17 37 70 / 0.28), 0 8px 20px -8px rgb(17 37 70 / 0.16);
  --shadow-glow: 0 0 0 1px rgb(255 255 255 / 0.08), 0 24px 60px -16px rgb(0 100 159 / 0.45);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 999px;

  --container-max: 1120px;
}

/* ---------------------------------------------------------------- */
/* Reset mínimo */
/* ---------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-navy-900);
  background-color: var(--color-white);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--color-navy-900);
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
}

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

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--color-sky-500);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background-color: var(--color-mint-200);
  color: var(--color-navy-900);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

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

.section {
  padding-block: 56px;
}

.section--dark {
  background-color: var(--color-navy-900);
  color: var(--color-white);
}

.section--muted {
  background-color: var(--color-cloud-50);
}

@media (min-width: 768px) {
  .section {
    padding-block: 80px;
  }
}

/* ---------------------------------------------------------------- */
/* Scroll reveal (padrão idêntico ao Layout.astro de referência) */
/* ---------------------------------------------------------------- */
.reveal {
  opacity: 0;
}

.reveal.is-visible {
  animation: reveal-fade-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Se JS nunca rodar (ou <html> ainda não foi marcada), conteúdo não pode ficar invisível. */
html:not(.js) .reveal {
  opacity: 1;
}

@keyframes reveal-fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* No mobile todo o conteúdo já nasce visível: revelar aos poucos no scroll faz
   parecer que a página termina antes do fim. */
@media (max-width: 767px) {
  .reveal {
    opacity: 1;
    animation: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    animation: none !important;
  }
}

/* ---------------------------------------------------------------- */
/* Accessibility utilities */
/* ---------------------------------------------------------------- */
.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;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  background-color: var(--color-navy-800);
  color: var(--color-white);
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  transform: translateY(-150%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------------------------------------------------------------- */
/* Buttons */
/* ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 15px;
  padding: 14px 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  box-shadow: var(--shadow-soft);
}

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

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--shadow-soft);
}

.btn--lg {
  padding: 16px 32px;
  font-size: 16px;
}

.btn--block {
  width: 100%;
}

.btn--primary {
  background-color: var(--color-navy-700);
  color: var(--color-white);
}

.btn--primary:hover {
  background-color: var(--color-navy-800);
}

.btn--purchase {
  background-color: var(--color-sky-600);
  color: var(--color-white);
  box-shadow: var(--shadow-soft), 0 0 0 1px rgb(28 127 189 / 0.3);
}

.btn--purchase:hover {
  background-color: var(--color-sky-700);
}

.btn--purchase.btn--selected,
.btn--purchase.btn--selected:hover {
  background-color: var(--color-cloud-200);
  color: var(--color-navy-700);
  box-shadow: none;
}

.btn--accent {
  background-color: var(--color-lime-500);
  color: var(--color-navy-950);
}

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

.btn--outline {
  background-color: transparent;
  color: var(--color-navy-800);
  border: 2px solid rgb(17 37 70 / 0.15);
  box-shadow: none;
}

.btn--outline:hover {
  border-color: rgb(17 37 70 / 0.3);
  background-color: var(--color-cloud-50);
  box-shadow: none;
}

.btn--outline-inverse {
  background-color: transparent;
  color: var(--color-white);
  border: 2px solid rgb(255 255 255 / 0.35);
  box-shadow: none;
}

.btn--outline-inverse:hover {
  background-color: rgb(255 255 255 / 0.1);
  border-color: rgb(255 255 255 / 0.6);
  box-shadow: none;
}

/* ---------------------------------------------------------------- */
/* Section heading */
/* ---------------------------------------------------------------- */
.section-heading {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 640px;
  margin-inline: auto;
  text-align: center;
}

.section-heading--left {
  margin-inline: 0;
  text-align: left;
}

.section-heading__eyebrow {
  display: inline-flex;
  align-self: center;
  align-items: center;
  border-radius: var(--radius-full);
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: rgb(0 100 159 / 0.1);
  color: var(--color-sky-600);
}

.section-heading--left .section-heading__eyebrow {
  align-self: flex-start;
}

.section-heading--inverse .section-heading__eyebrow {
  background-color: rgb(255 255 255 / 0.1);
  color: var(--color-mint-200);
}

.section-heading__title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
}

.section-heading--inverse .section-heading__title {
  color: var(--color-white);
}

.section-heading__subtitle {
  font-size: 17px;
  line-height: 1.6;
  color: rgb(17 37 70 / 0.7);
}

.section-heading--inverse .section-heading__subtitle {
  color: rgb(243 247 251 / 0.8);
}

@media (min-width: 768px) {
  .section-heading__title {
    font-size: 36px;
  }
}

/* ---------------------------------------------------------------- */
/* Form fields */
/* ---------------------------------------------------------------- */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-navy-700);
}

.form-field__control,
.input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-cloud-200);
  background-color: var(--color-white);
  color: var(--color-navy-900);
  font-size: 16px; /* abaixo de 16px o iOS dá zoom ao focar o campo */
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field__control::placeholder,
.input::placeholder {
  color: rgb(17 37 70 / 0.4);
}

.form-field__control:focus,
.input:focus {
  outline: none;
  border-color: var(--color-sky-500);
  box-shadow: 0 0 0 3px rgb(28 127 189 / 0.15);
}

.form-field--error .form-field__control,
.input.form-field--error {
  border-color: var(--color-action-red-600);
  background-color: rgb(239 68 68 / 0.04);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 560px) {
  .form-row--2 {
    grid-template-columns: 1fr 1fr;
    margin-bottom: 14px;
  }

  .form-row--2 .form-field {
    margin-bottom: 0;
  }
}

/* ---------------------------------------------------------------- */
/* Alerts */
/* ---------------------------------------------------------------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.alert__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.alert__title {
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
}

.alert--warning {
  background-color: #fff7e6;
  color: #92620b;
  border: 1px solid #f3d896;
}

.alert--error {
  background-color: rgb(239 68 68 / 0.08);
  color: var(--color-action-red-700);
  border: 1px solid rgb(239 68 68 / 0.3);
}

/* ---------------------------------------------------------------- */
/* Badge */
/* ---------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 700;
  background-color: var(--color-lime-500);
  color: var(--color-navy-900);
}

/* ---------------------------------------------------------------- */
/* Cards de plano (usadas pelo JS de comprar.js) */
/* ---------------------------------------------------------------- */
.plan-grid {
  display: grid;
  grid-template-columns: 1fr;
  /* O selo do plano avança 12px para cima do card: o espaço vertical precisa comportá-lo. */
  gap: 32px 16px;
  margin-top: 24px;
}

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

.plan-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  box-shadow: var(--shadow-card);
  text-align: center;
  position: relative;
}

.plan-card--featured {
  box-shadow: var(--shadow-lift);
  outline: 2px solid var(--color-lime-400);
  outline-offset: -2px;
}

.plan-card__badge {
  position: absolute;
  top: -12px;
}

.plan-card__name {
  font-weight: 700;
  font-size: 16px;
  color: var(--color-navy-900);
}

.plan-card__price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--color-navy-800);
  font-size: 34px;
}

.plan-card__price-currency {
  font-size: 16px;
  font-weight: 700;
}

.plan-card__price-cents {
  font-size: 16px;
  font-weight: 700;
  align-self: flex-start;
}

.plan-card__old-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge--promo {
  background-color: var(--color-action-red-600);
  color: var(--color-white);
}

.plan-card__price-old {
  font-size: 13px;
  color: var(--color-action-red-600);
  text-decoration: line-through;
}

.plan-card__note {
  font-size: 13px;
  color: rgb(17 37 70 / 0.6);
  min-height: 34px;
}

.plan-card__note--discount {
  color: var(--color-action-red-600);
  font-weight: 600;
}

/* Skeleton de carregamento dos cards de plano (mesma grade do .plan-grid) */
.plan-card-skeleton {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  box-shadow: var(--shadow-card);
}

.plan-card-skeleton__bar {
  width: 100%;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgb(17 37 70 / 0.08) 25%, rgb(17 37 70 / 0.16) 37%, rgb(17 37 70 / 0.08) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.plan-card-skeleton__bar--name {
  width: 65%;
  height: 15px;
}

.plan-card-skeleton__bar--price {
  width: 50%;
  height: 32px;
  margin-block: 4px;
}

.plan-card-skeleton__bar--note {
  width: 80%;
  height: 12px;
}

.plan-card-skeleton__bar--button {
  height: 46px;
  border-radius: var(--radius-full);
  margin-top: 8px;
}

@keyframes skeleton-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .plan-card-skeleton__bar {
    animation: none;
  }
}

/* ---------------------------------------------------------------- */
/* Spinner (substitui os GIFs de loading) */
/* ---------------------------------------------------------------- */
.spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid rgb(17 37 70 / 0.12);
  border-top-color: var(--color-sky-500);
  animation: spinner-spin 0.7s linear infinite;
  flex-shrink: 0;
}

.spinner--sm {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

.spinner-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 0;
  color: var(--color-navy-700);
  font-size: 14px;
}

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

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 1.5s;
  }
}

/* ---------------------------------------------------------------- */
/* Icons (inline SVG, estilo lucide: stroke, 24x24) */
/* ---------------------------------------------------------------- */
.icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}
