/* Entrada do go-serro. Copia fiel da entrada do docs.serro-andrade.com
   (auth-layout.tsx), em HTML servido e CSS simples: sem framework, sem
   construcao, sem pedidos a terceiros. */

/* ── a serifa, servida pelo proprio sitio ──────────────────────────── */
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/estaticos/letra/instrument-serif-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/estaticos/letra/instrument-serif-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/estaticos/letra/instrument-serif-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/estaticos/letra/instrument-serif-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── as cores do tema ──────────────────────────────────────────────── */
:root {
  --petroleo: #023A51;          /* o azul do logotipo: painel e botao */
  --petroleo-fundo: #06202B;    /* o fundo da pagina */
  --petroleo-cartao: #0A2B39;   /* superficie escura */
  --verde: #219A32;
  --verde-vivo: #2CB440;        /* o verde sobre fundos escuros */
  --tinta: #0B2430;             /* texto sobre claro */
  --superficie-clara: #F1F6F8;
  --limite-claro: #D7E2E7;

  --raio-campo: 0.5rem;
  --raio-painel: 0.75rem;
  --raio-cartao: 28px;          /* a entrada arredonda mais do que o resto do tema */
  --raio-campo-entrada: 14px;   /* o que a entrada usa nos campos e no botao */

  --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --serifa: 'Instrument Serif', 'Times New Roman', serif;
}

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

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

body {
  margin: 0;
  min-height: 100svh;
  background: var(--petroleo-fundo);
  color: #fff;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

.sa-mono, .sa-svg-mono { font-family: var(--mono); }
.sa-svg-valor { font-family: var(--sans); }

.sa-entrada {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  padding: 12px;
}

/* ── o fundo ───────────────────────────────────────────────────────── */
.sa-fundo {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.sa-fundo-cor {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 700px at 12% 8%, #0A5574 0%, transparent 60%),
    radial-gradient(900px 600px at 95% 100%, #0E4A2A 0%, transparent 55%),
    linear-gradient(160deg, #03283A 0%, #011822 100%);
}
.sa-grelha {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 80%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 80%);
}
.sa-ecomercial {
  position: absolute;
  right: -4vw;
  bottom: -18vw;
  font-family: var(--serifa);
  font-style: italic;
  font-weight: 400;
  font-size: 58vw;
  line-height: 1;
  color: rgba(255,255,255,0.035);
  user-select: none;
}
.sa-grao, .sa-painel::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.06;
  mix-blend-mode: overlay;
}
.sa-grao { position: absolute; inset: 0; }

/* ── o cartao ──────────────────────────────────────────────────────── */
.sa-cartao {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  max-width: 1120px;
  overflow: hidden;
  border-radius: var(--raio-cartao);
  background: #fff;
  box-shadow: 0 40px 120px -30px rgba(1,22,32,0.65);
  animation: sa-entra .9s cubic-bezier(.2,.8,.2,1) both;
}

/* ── a metade da marca ─────────────────────────────────────────────── */
.sa-painel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 20px 24px;
  color: #fff;
  background:
    radial-gradient(700px 420px at 85% 0%, rgba(22,120,160,0.55) 0%, transparent 60%),
    radial-gradient(520px 380px at 0% 100%, rgba(33,154,50,0.22) 0%, transparent 60%),
    linear-gradient(165deg, #034862 0%, var(--petroleo) 45%, #022B3D 100%);
}
/* as riscas verticais do painel, esbatidas em cima e em baixo */
.sa-painel::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 72px 100%;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
}
.sa-painel::after { content: ''; position: absolute; inset: 0; pointer-events: none; }

.sa-painel-topo {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
.sa-logo { height: 40px; width: auto; }

.sa-etiqueta {
  display: none;
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
}

.sa-comp { display: none; }
.sa-composicao { height: 100%; width: auto; max-width: 100%; overflow: visible; }

.sa-painel-base { position: relative; z-index: 1; }

.sa-ramo {
  display: none;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}
.sa-risco { display: block; height: 1px; width: 32px; background: rgba(255,255,255,0.35); }

.sa-texto {
  display: none;
  max-width: 400px;
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.625;
  color: rgba(255,255,255,0.7);
}

.sa-passos {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}
.sa-passos li { display: flex; align-items: center; gap: 8px; }
.sa-passos li.sa-traco { display: block; height: 1px; width: 24px; background: rgba(255,255,255,0.25); }
.sa-ponto { width: 6px; height: 6px; border-radius: 999px; background: rgba(255,255,255,0.45); }
.sa-ponto-2 { background: #3FC152; box-shadow: 0 0 0 4px rgba(63,193,82,0.18); }
.sa-ponto-3 { background: #9FD3E4; }

/* ── a metade do formulario ────────────────────────────────────────── */
.sa-form {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  background: #fff;
  color: var(--tinta);
}
.sa-form-interior { width: 100%; max-width: 380px; margin: 0 auto; }

.sa-reservada {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(11,36,48,0.5);
}
.sa-risco-verde { display: block; height: 1px; width: 32px; background: var(--verde); }

.sa-form h1 {
  margin: 0 0 20px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--tinta);
}

/* o aviso de erro: uma faixa vermelha por cima dos campos */
.sa-erro {
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 1px solid rgba(176,32,48,0.3);
  border-left: 3px solid #B02030;
  border-radius: var(--raio-campo);
  background: rgba(176,32,48,0.08);
  color: #8C1524;
  font-size: 14px;
  line-height: 1.45;
}

.sa-campo + .sa-campo { margin-top: 24px; }
.sa-campos label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--tinta);
}
.sa-campos input:not([type='checkbox']) {
  width: 100%;
  height: 3rem;
  padding: 0 1rem;
  border: 1px solid #DCE4E6;
  border-radius: var(--raio-campo-entrada);
  background: #F6F8F8;
  color: var(--tinta);
  font-family: inherit;
  font-size: 15px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.sa-campos input:not([type='checkbox']):focus {
  background: #fff;
  border-color: var(--verde);
  box-shadow: 0 0 0 4px rgba(33,154,50,0.14);
  outline: none;
}

.sa-lembrar { display: flex; align-items: center; gap: 10px; margin-top: 22px; }
.sa-lembrar label { margin: 0; font-size: 14px; font-weight: 400; cursor: pointer; }
.sa-lembrar input[type='checkbox'] {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1px solid #DCE4E6;
  border-radius: 5px;
  background: #F6F8F8;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .2s;
}
.sa-lembrar input[type='checkbox']:checked {
  border-color: var(--verde);
  background: var(--verde) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3.5 8.5l3 3 6-6.5' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / 13px 13px no-repeat;
}
.sa-lembrar input[type='checkbox']:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(33,154,50,0.3);
}

.sa-campos button[type='submit'] {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 3.1rem;
  margin-top: 24px;
  border: 0;
  border-radius: var(--raio-campo-entrada);
  background: var(--petroleo);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 14px 30px -14px rgba(2,58,81,0.8);
  transition: transform .2s, box-shadow .25s, background .25s;
}
/* o brilho que atravessa o botao ao passar o rato */
.sa-campos button[type='submit']::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.18) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .8s ease;
}
.sa-campos button[type='submit']:hover {
  background: #034A68;
  transform: translateY(-1px);
  box-shadow: 0 18px 36px -14px rgba(2,58,81,0.9);
}
.sa-campos button[type='submit']:hover::after { transform: translateX(120%); }
.sa-campos button[type='submit']:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(33,154,50,0.35), 0 14px 30px -14px rgba(2,58,81,0.8);
}

.sa-ajuda {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(11,36,48,0.1);
  font-size: 13px;
  line-height: 1.6;
  color: rgba(11,36,48,0.6);
}
.sa-bolinha { flex: none; margin-top: 7px; width: 6px; height: 6px; border-radius: 999px; background: var(--verde); }
.sa-ajuda a { white-space: nowrap; color: var(--tinta); }
.sa-ajuda a[href^='mailto:'] {
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(11,36,48,0.25);
  text-underline-offset: 3px;
}
.sa-ajuda a[href^='mailto:']:hover { text-decoration-color: var(--verde); }
.sa-ajuda a[href^='tel:'] { text-decoration: none; }
.sa-ajuda a:focus-visible {
  outline: 2px solid var(--verde);
  outline-offset: 3px;
  border-radius: 3px;
}

.sa-rodape {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1120px;
  padding: 0.7rem 0 0.25rem;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
}

/* ── ecra largo: duas metades, e o cartao cabe na janela ───────────── */
@media (min-width: 640px) {
  .sa-etiqueta { display: block; }
  .sa-painel-topo { justify-content: space-between; }
}

@media (min-width: 768px) {
  .sa-entrada {
    height: 100svh;
    padding: 5vh 32px 2vh;
  }
  .sa-cartao {
    grid-template-columns: 1.12fr 1fr;
    height: min(780px, calc(100svh - 7vh - 64px));
    min-height: 520px;
  }
  .sa-painel {
    padding: clamp(22px, 4.2vh, 44px) 48px clamp(22px, 4.2vh, 48px);
  }
  .sa-painel-topo { justify-content: space-between; }
  .sa-comp {
    display: flex;
    align-items: center;
    justify-content: center;
    height: clamp(150px, 31vh, 330px);
    margin: 1.2vh 0;
  }
  .sa-ramo { display: flex; margin-bottom: 20px; }
  .sa-texto { display: block; }
  .sa-passos { display: flex; }
  .sa-ecomercial { bottom: -12vw; font-size: 44vw; }

  .sa-form { padding: 3vh 56px; overflow-y: auto; }
  .sa-reservada { margin-bottom: 16px; }
  .sa-form h1 { margin-bottom: 32px; font-size: 28px; }
  .sa-ajuda { margin-top: 40px; padding-top: 24px; }
  .sa-rodape { padding: 2.2vh 0 0; }
}

/* a janela baixa vai largando o que e dispensavel, por esta ordem */
@media (min-width: 768px) and (max-height: 700px) { .sa-texto { display: none !important; } }
@media (min-width: 768px) and (max-height: 760px) { .sa-passos { display: none !important; } }
@media (min-width: 768px) and (max-height: 640px) { .sa-comp { display: none !important; } }

/* ── telemovel: os campos encolhem ─────────────────────────────────── */
@media (max-width: 767px) {
  .sa-campos input:not([type='checkbox']) { height: 2.75rem; }
  .sa-campos button[type='submit'] { height: 2.85rem; }
}

/* ── movimento: entrada do cartao, folhas a flutuar, o carimbo a cair ─ */
@keyframes sa-entra {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: none; }
}
@keyframes sa-flutua {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes sa-carimbo {
  0%, 18% { opacity: 0; transform: scale(1.9) rotate(8deg); }
  26% { opacity: 1; transform: scale(.94) rotate(0deg); }
  30% { transform: scale(1) rotate(0deg); }
  88% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}
.sa-flutua-1 { animation: sa-flutua 9s ease-in-out infinite; }
.sa-flutua-2 { animation: sa-flutua 7.5s ease-in-out -2s infinite; }
.sa-flutua-3 { animation: sa-flutua 8.5s ease-in-out -4s infinite; }
.sa-flutua-4 { animation: sa-flutua 7s ease-in-out -1s infinite; }
.sa-carimbo {
  animation: sa-carimbo 7s cubic-bezier(.3,1.4,.4,1) .6s infinite both;
  transform-box: fill-box;
  transform-origin: center;
}

@media (prefers-reduced-motion: reduce) {
  .sa-cartao, .sa-flutua-1, .sa-flutua-2, .sa-flutua-3, .sa-flutua-4, .sa-carimbo {
    animation: none !important;
  }
  .sa-carimbo { opacity: 1; }
  .sa-campos button[type='submit'], .sa-campos button[type='submit']::after,
  .sa-campos input:not([type='checkbox']), .sa-lembrar input[type='checkbox'] {
    transition: none !important;
  }
  .sa-campos button[type='submit']:hover { transform: none; }
}
