/*
 * Visual do Sangam, inspirado nos sites da Arte de Viver Brasil
 * (aula.artedeviver.org.br e artofliving.org/br-pt):
 * laranja como cor principal, fundo creme, cantos arredondados,
 * roxo profundo no rodapé e lilás-azulado nos links.
 */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-wght-normal.8e433c0592f7.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-latin-wght-normal.fc03edc2c673.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f3e9d9;
  --border: #e9ddc7;
  --text: #1f1f1f;
  --muted: #6b6259;
  --primary: #e9560c;
  --primary-hover: #c2410c;
  --primary-fg: #ffffff;
  --primary-soft: #fff4e6;
  --link: #5355d1;
  --brand-deep: #3c285f;
  --brand-deep-fg: #f3eefc;
  --success: #0f8b8d;
  --success-soft: #e3f4f4;
  --danger: #c81e1e;
  --danger-soft: #fdecec;
  --focus: #7677f4;

  --font-text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-title: "Manrope", "Inter", system-ui, sans-serif;
  --radius: 1.5rem;
  --radius-sm: 0.875rem;
  --shadow: 0 1px 2px rgb(60 40 20 / 0.06), 0 8px 24px rgb(60 40 20 / 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161412;
    --surface: #221f1c;
    --surface-2: #2d2823;
    --border: #3d3630;
    --text: #f6f1ea;
    --muted: #b3a89c;
    --primary: #fa923c;
    --primary-hover: #fbab68;
    --primary-fg: #2a1205;
    --primary-soft: #3a2412;
    --link: #a5a6ff;
    --brand-deep: #241838;
    --brand-deep-fg: #d9d0ea;
    --success: #4fd1c5;
    --success-soft: #12302f;
    --danger: #f87171;
    --danger-soft: #3b1717;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4);
  }
}

/* ---------------------------------------------------------------- base */

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

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

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.55;
}

h1, h2, h3 {
  font-family: var(--font-title);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}

h1 { font-size: clamp(1.75rem, 6vw, 2.25rem); }
h2 { font-size: 1.35rem; }

p { margin: 0 0 1rem; }

a { color: var(--link); text-underline-offset: 2px; }

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

.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.center { text-align: center; }

/* ---------------------------------------------------------------- cabeçalho */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1rem;
  max-width: 44rem;
  width: 100%;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--text);
  line-height: 1.1;
}

.brand-icon { width: 2.25rem; height: 2.25rem; border-radius: 0.6rem; flex: none; }

.brand-text { display: flex; flex-direction: column; }

.brand-name {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.brand-name span { color: var(--primary); }

.brand-tagline { font-size: 0.75rem; color: var(--muted); }

.site-nav { display: flex; align-items: center; gap: 0.5rem; }

/* ---------------------------------------------------------------- conteúdo */

main {
  flex: 1;
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

.narrow { max-width: 28rem; margin: 0 auto; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.card + .card { margin-top: 1rem; }

.hero {
  text-align: center;
  padding: 2.5rem 0 1rem;
}

.hero .eyebrow {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary-hover);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

@media (prefers-color-scheme: dark) {
  .hero .eyebrow { color: var(--primary); }
}

.hero h1 { font-size: clamp(2.25rem, 9vw, 3rem); }

.hero .lead { font-size: 1.1rem; color: var(--muted); max-width: 30rem; margin: 0 auto 1.5rem; }

.steps {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: 0.75rem;
}

.steps li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  text-align: left;
}

.steps .num {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-fg);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9rem;
}

/* ---------------------------------------------------------------- botões */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

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

.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }

.btn-link {
  background: none;
  border: none;
  padding: 0;
  min-height: 0;
  font: inherit;
  cursor: pointer;
  color: var(--link);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-small { min-height: 2.25rem; padding: 0.375rem 1rem; font-size: 0.9rem; }

.btn-block { width: 100%; }

/* ---------------------------------------------------------------- formulários */

.field { margin-bottom: 1.125rem; }

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"] {
  width: 100%;
  min-height: 3rem;
  padding: 0.625rem 0.875rem;
  font: inherit;
  font-size: 1.05rem; /* evita o zoom automático do iPhone */
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.field input:focus { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 0; }

.field .help { font-size: 0.875rem; color: var(--muted); margin-top: 0.375rem; }

.field .errorlist,
.form-errors {
  list-style: none;
  padding: 0;
  margin: 0.375rem 0 0;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 500;
}

.field-check { display: flex; gap: 0.625rem; align-items: flex-start; }
.field-check input { width: 1.25rem; height: 1.25rem; margin-top: 0.15rem; accent-color: var(--primary); flex: none; }
.field-check label { font-weight: 400; margin: 0; }

.code-input {
  text-align: center;
  letter-spacing: 0.5em;
  font-size: 1.75rem !important;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- avisos */

.messages { list-style: none; padding: 0; margin: 0 0 1rem; }

.message {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  background: var(--primary-soft);
}

.message.success { background: var(--success-soft); color: var(--text); }
.message.error { background: var(--danger-soft); color: var(--danger); }

/* ---------------------------------------------------------------- dados da conta */

.data-list { margin: 0; display: grid; gap: 0.75rem; }
.data-list div { display: grid; gap: 0.125rem; }
.data-list dt { font-size: 0.85rem; color: var(--muted); }
.data-list dd { margin: 0; font-weight: 500; word-break: break-word; }

.placeholder {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
}

/* ---------------------------------------------------------------- meu QR */

.qr-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.25rem 1rem;
  margin: 1rem 0;
  text-align: center;
}

/* O QR fica sempre em fundo branco (também no modo escuro) para ser lido com facilidade. */
.qr-box {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  max-width: 18rem;
  margin: 0 auto;
}

.qr-box svg { display: block; width: 100%; height: auto; }

.qr-name {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0.75rem 0 0.125rem;
}

.qr-card .small { margin: 0; }

.credits { display: grid; gap: 0.25rem; }
.credits h2 { margin-bottom: 0.25rem; }

.pass {
  background: var(--success-soft);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}

.credit-total { margin-bottom: 0.25rem; }

.credit-number {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 2rem;
  color: var(--primary);
  vertical-align: -0.15em;
  margin-right: 0.25rem;
}

.credit-list { list-style: none; padding: 0; margin: 0 0 0.75rem; display: grid; gap: 0.375rem; }

.credit-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.5rem 0;
  border-top: 1px solid var(--border);
}

.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.code-form { margin-top: 1.25rem; }
.code-form label { display: block; font-weight: 600; margin-bottom: 0.375rem; }

.inline-field { display: flex; gap: 0.5rem; }

.inline-field input {
  flex: 1;
  min-width: 0;
  min-height: 3rem;
  padding: 0.625rem 0.875rem;
  font: inherit;
  font-size: 1.05rem;
  text-transform: uppercase;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.updated { margin: 0.75rem 0 0; }

.tip { margin-top: 1rem; }
.tip summary { cursor: pointer; font-weight: 600; }
.tip p { margin-top: 0.75rem; }
.tip ul { padding-left: 1.25rem; margin: 0; }
.tip li { margin-bottom: 0.375rem; }

/* ---------------------------------------------------------------- texto longo */

.prose h2 { margin-top: 1.75rem; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.375rem; }

/* ---------------------------------------------------------------- rodapé */

.site-footer {
  background: var(--brand-deep);
  color: var(--brand-deep-fg);
  font-size: 0.875rem;
  padding: 1.5rem 1rem;
}

.site-footer .inner {
  max-width: 44rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
}

.site-footer a { color: var(--brand-deep-fg); }
