/* ==========================================================================
   Telas de conta (entrar, criar conta, senha) no visual do canvas Registro
   Rural: satélite + chamada à esquerda e formulário à direita no computador;
   faixa de satélite e folha com o formulário no celular. Carrega depois do
   auth.css e só troca tokens, layout e a cara dos componentes.
   ========================================================================== */

:root,
:root:root {
  --rr-navy: #07143f;
  --rr-navy-700: #1c2b63;
  --rr-green: #00c040;
  --rr-green-600: #00a538;
  --rr-green-700: #007a2e;
  --rr-green-300: #7fdf9f;
  --rr-mint-50: #e9f7ee;
  --rr-mint-100: #d3f0dd;
  --rr-blue: #0047ff;
  --rr-blue-700: #0036c2;

  --background: #ffffff;
  --foreground: #07143f;
  --card: #ffffff;
  --card-foreground: #07143f;
  --primary: #00c040;
  --primary-foreground: #07143f;
  --secondary: #f3f5f8;
  --secondary-foreground: #07143f;
  --muted: #f3f5f8;
  --muted-foreground: #4a5470;
  --accent: #e9f7ee;
  --accent-foreground: #007a2e;
  --destructive: #c8331e;
  --success: #007a2e;
  --border: #e4e8ef;
  --input: #e4e8ef;
  --ring: #0047ff;
  --radius: 10px;
  --font-sans: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: 'Outfit', ui-sans-serif, system-ui, sans-serif;
  --page: #ffffff;
  color-scheme: light;
}

body.auth--rr {
  display: block;
  padding: 0;
  font-size: 15px;
  background: #fff;
}

/* ---- layout ---- */
.rr-auth {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.rr-auth__hero {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  padding: 14px 16px 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  color: #fff;
  background: #1c2b63 var(--rr-auth-hero) 45% 50% / cover no-repeat;
}
.rr-auth__hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 20, 63, .25) 0%, rgba(7, 20, 63, .55) 45%, rgba(7, 20, 63, .9) 100%);
}
.rr-auth__hero > * { position: relative; z-index: 1; }

.rr-auth__logo {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--rr-navy) !important;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(7, 20, 63, .06);
}
.rr-auth__logo svg { width: 24px; height: 22px; }

.rr-auth__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 28px;
  letter-spacing: -.4px;
  max-width: 300px;
  text-wrap: balance;
}
.rr-auth__lead,
.rr-auth__card { display: none; }

/* folha branca com o formulário, por cima da faixa de satélite */
.auth--rr .auth-wrap {
  position: relative;
  z-index: 2;
  max-width: none;
  margin-top: -24px;
  padding: 24px 16px 28px;
  background: #fff;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 32px rgba(7, 20, 63, .16);
  gap: 20px;
  flex: 1;
}
.auth--rr .auth-wrap > * { width: 100%; max-width: 440px; margin-left: auto; margin-right: auto; }
.auth--rr .auth-brand { display: none; }

/* ---- card vira o próprio formulário (sem moldura) ---- */
.auth--rr .card {
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
  gap: 16px;
}
.auth--rr .card-header,
.auth--rr .card-content,
.auth--rr .card-footer { padding: 0; }
.auth--rr .card-header { gap: 4px; text-align: left; align-items: flex-start; }
.auth--rr .card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  line-height: 32px;
  letter-spacing: -.6px;
}
.auth--rr .card-description { font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
.auth--rr .card-footer { text-align: center; font-size: 14px; color: var(--muted-foreground); }
.auth--rr .card-icon { margin-left: 0; margin-right: auto; align-self: flex-start; background: var(--rr-mint-50); color: var(--rr-green-700); }

.auth--rr .link,
.auth--rr .card-description a { color: var(--rr-blue); font-weight: 600; text-decoration: none; }
.auth--rr .link:hover,
.auth--rr .card-description a:hover { color: var(--rr-blue-700); text-decoration: underline; }

/* ---- campos ---- */
.auth--rr label { font-size: 14px; font-weight: 600; color: var(--foreground); }
.auth--rr .input,
.auth--rr input[type="text"],
.auth--rr input[type="email"],
.auth--rr input[type="password"],
.auth--rr input[type="tel"],
.auth--rr input[type="date"],
.auth--rr input[type="number"],
.auth--rr select,
.auth--rr textarea {
  height: 48px;
  border: 1.5px solid var(--input);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 16px;
  background: #fff;
  color: var(--foreground);
  box-shadow: none;
}
/* Espaço do botão de mostrar senha (auth_fields.js), senão o texto passa por baixo dele. */
.auth--rr .password-field input { padding-right: 2.75rem; }
.auth--rr textarea { height: auto; padding: 12px 14px; }
.auth--rr input:focus,
.auth--rr input:focus-visible,
.auth--rr select:focus-visible,
.auth--rr textarea:focus-visible {
  outline: none;
  border-color: var(--rr-green);
  box-shadow: 0 0 0 4px var(--rr-mint-50);
}
.auth--rr input[aria-invalid='true'],
.auth--rr input.is-error { border-color: var(--destructive); box-shadow: 0 0 0 4px #ffe1cf; }
.auth--rr .field-error { color: var(--destructive); font-size: 13px; font-weight: 500; }
.auth--rr .field-help { font-size: 12.5px; color: var(--muted-foreground); }
.auth--rr .password-toggle { color: var(--muted-foreground); }

/* checkbox verde */
.auth--rr input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin: 0;
  flex: none;
  border-radius: 6px;
  background: #fff;
  box-shadow: inset 0 0 0 1.5px #c9d0dd;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}
.auth--rr input[type="checkbox"]:checked {
  background: var(--rr-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 14px no-repeat;
  box-shadow: none;
}
.auth--rr input[type="checkbox"]:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.auth--rr .field-check { gap: 10px; align-items: center; min-height: 44px; }
.auth--rr .field-check label { font-weight: 500; font-size: 14px; }
.auth--rr .field-check--top { align-items: flex-start; min-height: 0; }
.auth--rr .field-check--top input { margin-top: 2px; }

.rr-auth__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -6px;
}
.rr-auth__row .link { font-size: 14px; min-height: 44px; display: inline-flex; align-items: center; }

/* ---- botões ---- */
.auth--rr .btn {
  height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  gap: 10px;
}
.auth--rr .btn-primary { background: var(--rr-green); color: var(--rr-navy); border-color: transparent; }
.auth--rr .btn-primary:hover { background: var(--rr-green-600); color: var(--rr-navy); }
.auth--rr form .btn-primary.btn-block { height: 52px; font-size: 16px; }
.auth--rr .btn-outline { background: #fff; color: var(--rr-navy); border: 1.5px solid var(--border); }
.auth--rr .btn-outline:hover { background: #f3f5f8; color: var(--rr-navy); border-color: #c9d0dd; }
.auth--rr .btn-secondary { background: #f3f5f8; color: var(--rr-navy); }
.auth--rr .btn-ghost { color: var(--rr-navy); }
.auth--rr .btn img { width: 20px; height: 20px; }

/* "ou com e-mail" */
.auth--rr .separator { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: #66708c; }
.auth--rr .separator::before,
.auth--rr .separator::after { content: ""; position: static; flex: 1; height: 1px; border: 0; background: var(--border); }
.auth--rr .separator span { padding: 0; background: none; }

.auth--rr .alert { border-radius: 14px; }
.auth--rr .alert-destructive { background: #fff2ec; border-color: #ffd2bd; color: #9a3a0b; }
.auth--rr .alert-success { background: var(--rr-mint-50); border-color: var(--rr-mint-100); color: var(--rr-green-700); }

.auth--rr .auth-legal { font-size: 12.5px; color: var(--muted-foreground); text-align: center; margin-top: auto; }
.auth--rr .auth-legal a { color: var(--rr-blue); font-weight: 600; text-decoration: none; }
.auth--rr .auth-legal a:hover { text-decoration: underline; }

/* ==========================================================================
   Computador e tablet: satélite à esquerda, formulário à direita
   ========================================================================== */
@media (min-width: 900px) {
  .rr-auth { flex-direction: row; height: 100vh; height: 100svh; }
  .rr-auth__hero {
    width: 50%;
    flex: none;
    min-height: 0;
    padding: 24px 32px 32px;
    justify-content: space-between;
  }
  .rr-auth__hero::after {
    background: linear-gradient(180deg, rgba(7, 20, 63, .15) 0%, rgba(7, 20, 63, .45) 40%, rgba(7, 20, 63, .92) 100%);
  }
  .rr-auth__pitch { max-width: 460px; }
  .rr-auth__title { font-size: 44px; line-height: 48px; letter-spacing: -1.5px; max-width: 440px; }
  .auth--rr .rr-auth__lead {
    display: block;
    margin-top: 14px;
    max-width: 420px;
    font-size: 15px;
    line-height: 23px;
    color: #d5dcf0;
  }
  .auth--rr .rr-auth__card {
    display: block;
    margin-top: 28px;
    width: 340px;
    padding: 16px;
    border-radius: 16px;
    background: #fff;
    color: var(--rr-navy);
    box-shadow: 0 18px 48px rgba(7, 20, 63, .18);
  }
  .rr-auth__card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .rr-auth__card-name { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
  .rr-auth__badge {
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    background: var(--rr-mint-50);
    color: var(--rr-green-700);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    display: inline-flex;
    align-items: center;
  }
  .auth--rr .rr-auth__card-meta { margin-top: 2px; font-size: 12.5px; color: var(--muted-foreground); }
  .rr-auth__stats { display: flex; gap: 8px; margin-top: 12px; }
  .rr-auth__stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #f3f5f8;
  }
  .rr-auth__stat.is-ok { background: var(--rr-mint-50); }
  .rr-auth__stat span { font-size: 12px; color: var(--muted-foreground); }
  .rr-auth__stat b { font-family: var(--font-display); font-weight: 600; font-size: 16px; }

  .auth--rr .auth-wrap {
    flex: 1;
    margin: 0;
    padding: 56px 32px 24px;
    border-radius: 0;
    box-shadow: none;
    overflow-y: auto;
    justify-content: flex-start;
  }
  .auth--rr .card-title { font-size: 34px; line-height: 40px; }
  .auth--rr input[type="text"],
  .auth--rr input[type="email"],
  .auth--rr input[type="password"],
  .auth--rr input[type="tel"],
  .auth--rr input[type="date"] { height: 52px; }
  .auth--rr .btn { height: 52px; }
  .auth--rr form .btn-primary.btn-block { height: 56px; }
  .auth--rr .auth-wrap--wide > * { max-width: 480px; }
}
