/* ==========================================================================
   VolgaPay — Auth (login/cadastro) · mobile-first
   Paleta baseada em volgapay.com: navy #042457, azul #0650a4, ciano #1dc8d4
   ========================================================================== */
:root {
  --vp-navy-900: #030b18;
  --vp-navy-800: #06152b;
  --vp-navy-700: #042457;
  --vp-blue: #0650a4;
  --vp-blue-600: #0a63c9;
  --vp-cyan: #1dc8d4;
  --vp-mint: #31d3c0;
  --vp-ink: #0b1220;
  --vp-slate: #475569;
  --vp-muted: #64748b;
  --vp-line: #dbe4ef;
  --vp-bg-soft: #f4f8fc;
  --vp-white: #ffffff;
  --vp-danger: #be123c;
  --vp-success: #047857;
  --vp-radius: 18px;
  --vp-shadow: 0 30px 80px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }

html, body.vp-auth-body {
  min-height: 100%;
}

body.vp-auth-body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--vp-ink);
  background:
    radial-gradient(1100px 700px at 8% -10%, rgba(29, 200, 212, .20), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(6, 80, 164, .35), transparent 62%),
    linear-gradient(160deg, #020814 0%, #041226 48%, #020814 100%);
  -webkit-font-smoothing: antialiased;
}

.vp-auth-shell {
  width: min(1400px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 18px;
  align-items: stretch;
}

/* --------------------------------------------------------------------------
   Painel de marca (esquerda)
   -------------------------------------------------------------------------- */
.vp-auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: clamp(26px, 4vw, 56px);
  border-radius: 32px;
  color: #fff;
  background:
    radial-gradient(700px 500px at 90% 8%, rgba(29, 200, 212, .26), transparent 60%),
    radial-gradient(600px 500px at 0% 100%, rgba(6, 80, 164, .55), transparent 60%),
    linear-gradient(160deg, #06152b 0%, #042457 58%, #03101f 100%);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: var(--vp-shadow);
}

.vp-auth-brand::before,
.vp-auth-brand::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}
.vp-auth-brand::before {
  width: 380px; height: 380px;
  right: -160px; top: -140px;
  background: radial-gradient(circle, rgba(49, 211, 192, .28), transparent 70%);
}
.vp-auth-brand::after {
  width: 320px; height: 320px;
  left: -140px; bottom: -120px;
  background: radial-gradient(circle, rgba(29, 200, 212, .18), transparent 70%);
}

.vp-brand-logo {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.vp-brand-logo img {
  width: clamp(150px, 18vw, 210px);
  height: auto;
  display: block;
}

.vp-brand-copy {
  position: relative;
  z-index: 1;
  max-width: 640px;
}
.vp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #d8fbff;
  background: rgba(29, 200, 212, .12);
  border: 1px solid rgba(29, 200, 212, .28);
}
.vp-eyebrow::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--vp-mint);
  box-shadow: 0 0 12px var(--vp-mint);
}

.vp-auth-brand h1 {
  margin: 0 0 18px;
  font-size: clamp(2.15rem, 4.4vw, 4.1rem);
  line-height: 1.02;
  letter-spacing: -.045em;
  font-weight: 800;
}
.vp-auth-brand h1 span {
  background: linear-gradient(100deg, #7bf6ff 0%, #31d3c0 48%, #1dc8d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.vp-auth-brand p.vp-lead {
  margin: 0;
  max-width: 560px;
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.65;
  color: #b7cde8;
}

.vp-benefits {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}
.vp-benefits li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: #d4e6fb;
}
.vp-benefits li svg {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--vp-mint);
}

.vp-trust {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .10);
}
.vp-trust strong {
  display: block;
  font-size: 20px;
  letter-spacing: -.02em;
}
.vp-trust small {
  color: #8fb2d8;
  font-size: 12px;
}
.vp-brand-foot {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: #7f9fc4;
}

/* --------------------------------------------------------------------------
   Painel do formulário (direita)
   -------------------------------------------------------------------------- */
.vp-auth-main {
  display: grid;
  place-items: center;
  padding: 10px;
}
.vp-auth-card {
  width: min(470px, 100%);
  background: var(--vp-white);
  color: var(--vp-ink);
  border-radius: 28px;
  padding: clamp(24px, 3.4vw, 42px);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .42);
  border: 1px solid rgba(255, 255, 255, .6);
}
.vp-mobile-logo { display: none; }

.vp-auth-head { margin-bottom: 22px; }
.vp-auth-head h2 {
  margin: 0 0 8px;
  font-size: clamp(26px, 3.2vw, 34px);
  line-height: 1.1;
  letter-spacing: -.035em;
  font-weight: 800;
  color: var(--vp-navy-700);
}
.vp-auth-head p {
  margin: 0;
  color: var(--vp-muted);
  font-size: 14px;
  line-height: 1.55;
}

/* Alertas */
.vp-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 13px;
  font-size: 13.5px;
  line-height: 1.45;
  border: 1px solid transparent;
  background: #eef6ff;
  color: #084b8a;
  border-color: #cfe6ff;
}
.vp-alert[hidden] { display: none !important; }
.vp-alert.is-error { background: #fff1f2; color: #9f1239; border-color: #fecdd3; }
.vp-alert.is-success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.vp-alert.is-info { background: #eff8ff; color: #075985; border-color: #bae6fd; }
.vp-alert svg { flex: 0 0 auto; margin-top: 1px; }

/* Formulário */
.vp-form { display: grid; gap: 16px; }
.vp-field { display: grid; gap: 7px; }
.vp-field > label {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: .01em;
}
.vp-field .vp-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.vp-field .vp-label-row a {
  font-size: 12.5px;
  font-weight: 600;
}

.vp-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.vp-input-wrap > svg.vp-leading {
  position: absolute;
  left: 15px;
  width: 19px; height: 19px;
  color: #8aa0b8;
  pointer-events: none;
}
.vp-input-wrap input,
.vp-input-wrap select,
.vp-field input,
.vp-field select {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--vp-line);
  background: #f8fafc;
  color: var(--vp-ink);
  font-size: 15px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.vp-input-wrap.has-icon input { padding-left: 46px; }
.vp-input-wrap.has-action input { padding-right: 54px; }
.vp-input-wrap input::placeholder,
.vp-field input::placeholder { color: #94a3b8; }
.vp-input-wrap input:focus,
.vp-input-wrap select:focus,
.vp-field input:focus,
.vp-field select:focus {
  border-color: var(--vp-cyan);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(29, 200, 212, .14);
}
.vp-input-wrap input.is-invalid,
.vp-field input.is-invalid { border-color: var(--vp-danger); box-shadow: 0 0 0 4px rgba(190, 18, 60, .10); }

.vp-eye {
  position: absolute;
  right: 8px;
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #7b8ea5;
  cursor: pointer;
}
.vp-eye:hover { background: #eef4fb; color: var(--vp-blue); }
.vp-eye svg { width: 20px; height: 20px; }

/* Captcha */
.vp-captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 10px;
  align-items: stretch;
}
.vp-captcha-image {
  width: 100%;
  min-height: 64px;
  border-radius: 14px;
  border: 1px solid var(--vp-line);
  background-color: #f1f5f9;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease;
}
.vp-captcha-image:hover { border-color: var(--vp-cyan); transform: translateY(-1px); }
.vp-hint { margin: 2px 0 0; font-size: 12px; color: #8aa0b8; }

/* Botões */
.vp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 54px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.vp-btn-primary {
  color: #fff;
  background: linear-gradient(120deg, #1dc8d4 0%, #0a7dc4 45%, #0650a4 100%);
  box-shadow: 0 14px 30px rgba(6, 80, 164, .30);
}
.vp-btn-primary:hover { transform: translateY(-1px); filter: brightness(1.04); }
.vp-btn-primary:active { transform: translateY(0); }
.vp-btn-primary[disabled] { opacity: .7; cursor: wait; transform: none; }
.vp-btn-ghost {
  height: 46px;
  color: var(--vp-blue);
  background: #eef6ff;
  border: 1px solid #d4e7fb;
}
.vp-btn-ghost:hover { background: #e3f0ff; }

.vp-spinner {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  animation: vp-spin .7s linear infinite;
}
.vp-spinner[hidden] { display: none; }
@keyframes vp-spin { to { transform: rotate(360deg); } }

/* Links e separadores */
.vp-form-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
  font-size: 13px;
}
.vp-form-links a,
.vp-link { color: var(--vp-blue); font-weight: 700; text-decoration: none; }
.vp-form-links a:hover,
.vp-link:hover { color: var(--vp-cyan); text-decoration: underline; }
.vp-auth-foot {
  margin: 20px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--vp-muted);
}
.vp-auth-foot a { color: var(--vp-blue); font-weight: 700; text-decoration: none; }
.vp-terms-note {
  margin: 4px 0 0;
  font-size: 12px;
  color: #8aa0b8;
  line-height: 1.45;
}
.vp-terms-note a { color: var(--vp-blue); font-weight: 600; }

/* Cadastro — seções */
.vp-signup .vp-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8aa0b8;
}
.vp-signup .vp-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e6edf5;
}
.vp-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vp-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.vp-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--vp-muted);
}
.vp-check input {
  width: 18px; height: 18px;
  margin-top: 1px;
  accent-color: var(--vp-cyan);
  flex: 0 0 auto;
}
.vp-check a { color: var(--vp-blue); font-weight: 600; }

/* Dialog de termos */
dialog.vp-dialog {
  width: min(680px, calc(100% - 28px));
  max-height: 82vh;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: #fff;
  color: var(--vp-ink);
  box-shadow: var(--vp-shadow);
}
dialog.vp-dialog::backdrop { background: rgba(2, 8, 20, .72); backdrop-filter: blur(4px); }
.vp-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid #e6edf5;
}
.vp-dialog-head h3 { margin: 0; font-size: 16px; font-weight: 800; color: var(--vp-navy-700); }
.vp-dialog-body { padding: 18px 22px; max-height: 55vh; overflow: auto; font-size: 13.5px; line-height: 1.7; color: #334155; }
.vp-dialog-body h4 { margin: 16px 0 6px; color: var(--vp-navy-700); font-size: 14px; }
.vp-dialog-foot { padding: 14px 22px 20px; }
.vp-dialog-close {
  width: 36px; height: 36px;
  border: 0; border-radius: 10px;
  background: #f1f5f9; color: #475569;
  cursor: pointer; font-size: 18px; line-height: 1;
}

/* --------------------------------------------------------------------------
   Responsivo
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .vp-auth-shell {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
  }
  .vp-auth-brand {
    border-radius: 0 0 28px 28px;
    padding: 22px 22px 26px;
    gap: 14px;
    min-height: auto;
  }
  .vp-brand-logo img { width: 145px; }
  .vp-auth-brand h1 { font-size: clamp(1.75rem, 7vw, 2.5rem); margin-bottom: 10px; }
  .vp-auth-brand p.vp-lead { font-size: 14px; line-height: 1.55; }
  .vp-benefits, .vp-trust, .vp-brand-foot { display: none; }
  .vp-eyebrow { margin-bottom: 12px; }
  .vp-auth-main { padding: 16px 14px 34px; margin-top: -18px; }
  .vp-auth-card {
    border-radius: 22px;
    padding: 24px 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .30);
  }
  .vp-mobile-logo { display: block; margin-bottom: 16px; }
  .vp-mobile-logo img { width: 130px; }
}

@media (max-width: 640px) {
  .vp-captcha-row { grid-template-columns: 1fr; }
  .vp-captcha-image { min-height: 76px; }
  .vp-grid-2, .vp-grid-3 { grid-template-columns: 1fr; }
  .vp-auth-head h2 { font-size: 26px; }
  .vp-form-links { flex-direction: column; align-items: flex-start; }
  .vp-auth-card { padding: 22px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* --------------------------------------------------------------------------
   Refinamento visual auth (2026)
   -------------------------------------------------------------------------- */
.vp-auth-shell { position: relative; overflow: hidden; }
.vp-auth-shell::before,
.vp-auth-shell::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .22;
  pointer-events: none;
  z-index: 0;
}
.vp-auth-shell::before { background: #1dc8d4; top: -180px; right: -120px; }
.vp-auth-shell::after { background: #0650a4; bottom: -220px; left: -140px; }
.vp-auth-main { position: relative; z-index: 1; }
.vp-auth-card {
  position: relative;
  overflow: hidden;
  animation: vpAuthIn .5s cubic-bezier(.2,.7,.2,1) both;
}
.vp-auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #1dc8d4, #0650a4 55%, #1dc8d4);
}
@keyframes vpAuthIn {
  from { opacity: 0; transform: translateY(14px) scale(.99); }
  to { opacity: 1; transform: none; }
}
.vp-auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #ecfeff;
  border: 1px solid #bae6fd;
  color: #0369a1;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.vp-auth-badge svg { width: 14px; height: 14px; }
.vp-auth-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.vp-auth-chips span {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.vp-btn-primary {
  box-shadow: 0 12px 26px rgba(6, 80, 164, .28);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.vp-btn-primary:hover { filter: brightness(1.04); box-shadow: 0 16px 34px rgba(6, 80, 164, .34); }
.vp-btn-primary:active { transform: translateY(1px); }
.vp-strength {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 8px;
  opacity: 0;
  transition: opacity .2s ease;
}
.vp-strength.is-visible { opacity: 1; }
.vp-strength span { height: 4px; border-radius: 999px; background: #e2e8f0; }
.vp-strength.strength-1 span:nth-child(-n+1) { background: #ef4444; }
.vp-strength.strength-2 span:nth-child(-n+2) { background: #f59e0b; }
.vp-strength.strength-3 span:nth-child(-n+3) { background: #0ea5e9; }
.vp-strength.strength-4 span:nth-child(-n+4) { background: #10b981; }
.vp-strength-text { font-size: 11px; color: #64748b; margin: 6px 0 0; }
.vp-strength-text.is-strong { color: #047857; font-weight: 700; }

@media (max-width: 640px) {
  .vp-auth-shell::before,
  .vp-auth-shell::after { width: 300px; height: 300px; filter: blur(60px); opacity: .18; }
  .vp-auth-badge { margin-bottom: 8px; font-size: 10px; }
  .vp-auth-chips { margin-top: 9px; }
  .vp-auth-chips span { font-size: 9.5px; padding: 3px 8px; }
}

@media (max-width: 640px) {
  .vp-auth-head h2,
  .vp-auth-head p,
  .vp-auth-badge,
  .vp-auth-chips span,
  .vp-field > label,
  .vp-hint { overflow-wrap: anywhere; }
}

/* 2FA opcional e compacto */
.vp-2fa-box {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 0 13px;
}
.vp-2fa-box summary {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  padding: 12px 0;
  color: #334155;
  font-size: 12.5px;
  font-weight: 800;
}
.vp-2fa-box summary::-webkit-details-marker { display: none; }
.vp-2fa-box summary svg { width: 16px; height: 16px; color: #0891b2; }
.vp-2fa-box summary::after {
  content: "+";
  margin-left: auto;
  font-size: 18px;
  color: #64748b;
  line-height: 1;
}
.vp-2fa-box[open] summary::after { content: "−"; }
.vp-2fa-box[open] { background: #fff; }
.vp-2fa-box .vp-field { padding: 0 0 13px; }

.vp-form .vp-grid-2 { align-items: start; }
.vp-password-grid { align-items: start !important; }
.vp-password-meta { margin-top: -2px; }
.vp-password-meta .vp-strength { margin-top: 0; }

html[dir="rtl"] .vp-auth-card,
html[dir="rtl"] .vp-auth-head { text-align: right; }
html[dir="rtl"] .vp-auth-chips { justify-content: flex-start; }
html[dir="rtl"] .vp-auth-lang { justify-content: flex-start; }
