/* ==========================================================
   ConnectPay — auth page (login + cadastro)
   ========================================================== */

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  background: var(--bg);
}
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
}

/* ====================== Left side (brand) ====================== */

.auth-side {
  position: relative;
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  border-right: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg);
}
.auth-side::before {
  content: "";
  position: absolute;
  top: -240px; right: -200px;
  width: 720px; height: 720px;
  background: radial-gradient(closest-side, rgba(250,204,21,.20), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}
.auth-side::after {
  content: "";
  position: absolute;
  bottom: -180px; left: -150px;
  width: 520px; height: 520px;
  background: radial-gradient(closest-side, rgba(234,179,8,.14), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}
.auth-side .dotted-surface {
  opacity: 0.45;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 0%, transparent 70%);
}
.auth-side > * { position: relative; z-index: 1; }

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -.01em;
  color: var(--text);
}
.auth-brand .brand-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--brand-grad);
  display: grid; place-items: center;
  color: var(--brand-ink);
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 16px;
  box-shadow:
    0 0 0 1px rgba(0,0,0,.35) inset,
    0 0 0 3px rgba(250,204,21,.10),
    0 6px 18px -4px rgba(234,179,8,.55);
}

.auth-side-content {
  max-width: 440px;
}
.auth-side-content h2 {
  font-size: clamp(28px, 3.4vw, 38px);
  font-family: var(--f-display);
  font-weight: 600;
  letter-spacing: -.025em;
  margin-bottom: 16px;
  line-height: 1.1;
}
.auth-side-content > p {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 32px;
  max-width: 380px;
}

.auth-perks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-perks li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14.5px;
  color: var(--text);
}
.auth-perks .ic {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--brand-1);
  color: var(--brand-ink);
  display: grid; place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.auth-perks small {
  display: block;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}

.auth-quote {
  margin-top: 36px;
  padding: 20px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 14.5px;
  color: var(--text);
  line-height: 1.55;
}
.auth-quote .who {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.auth-quote .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand-grad);
  color: var(--brand-ink);
  display: grid; place-items: center;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.auth-quote .who-name {
  font-weight: 500;
  font-size: 13.5px;
}
.auth-quote .who-role {
  font-size: 12px;
  color: var(--text-dim);
}

.auth-side-foot {
  font-size: 12.5px;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.auth-side-foot a:hover { color: var(--text); }

/* ====================== Right side (form) ====================== */

.auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  min-height: 100vh;
  position: relative;
}
.auth-main .back-link {
  position: absolute;
  top: 28px; right: 32px;
  font-size: 13.5px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.auth-main .back-link:hover { color: var(--text); }

.auth-card {
  width: 100%;
  max-width: 620px;
}
.auth-card.signup-active { max-width: 720px; }

.auth-tabs {
  display: inline-flex;
  padding: 4px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 100px;
  margin-bottom: 32px;
  position: relative;
}
.auth-tabs button {
  position: relative;
  z-index: 1;
  padding: 8px 22px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 100px;
  transition: color .2s ease;
  cursor: pointer;
}
.auth-tabs button.active {
  color: var(--brand-ink);
}
.auth-tabs .tab-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background: var(--brand-grad);
  border-radius: 100px;
  box-shadow:
    0 0 0 1px rgba(0,0,0,.25) inset,
    0 6px 16px -6px rgba(234,179,8,.55),
    0 1px 0 rgba(255,255,255,.35) inset;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.auth-tabs[data-active="signup"] .tab-pill {
  transform: translateX(100%);
}

.auth-pane {
  display: none;
}
.auth-pane.active {
  display: block;
  animation: paneFadeIn .35s ease;
}
@keyframes paneFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-pane h1 {
  font-size: clamp(26px, 3vw, 32px);
  font-family: var(--f-display);
  font-weight: 600;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}
.auth-pane .lead {
  color: var(--text-muted);
  font-size: 15.5px;
  margin-bottom: 28px;
}

/* ====================== Form ====================== */

.auth-form {
  display: grid;
  gap: 16px;
}
.auth-form.grid-2 {
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}
@media (max-width: 640px) {
  .auth-form.grid-2 { grid-template-columns: 1fr; }
}
.auth-form .span-2 { grid-column: 1 / -1; }

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  position: relative;
}
.field label,
.field > .field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .005em;
}
.field input,
.field select {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text);
  background: rgba(255,255,255,.025);
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.field input::placeholder { color: var(--text-dim); }
.field input:hover {
  border-color: var(--border-strong);
}
.field input:focus {
  border-color: var(--brand-1);
  background: rgba(250,204,21,.03);
  box-shadow: 0 0 0 3px rgba(250,204,21,.14);
}
.field.has-icon input { padding-right: 44px; }
.field .eye {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.field .eye:hover { color: var(--text); background: rgba(255,255,255,.04); }
.field.has-error input {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(239,68,68,.14);
}
.field .hint {
  font-size: 12px;
  color: var(--text-dim);
}
.field .err {
  font-size: 12px;
  color: var(--red);
  display: none;
}
.field.has-error .err { display: block; }

/* Checkbox */
.check {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text);
  user-select: none;
  line-height: 1.5;
}
.check input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,.025);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  margin-top: 1px;
  transition: background .15s ease, border-color .15s ease;
}
.check input:hover { border-color: var(--brand-1); }
.check input:checked {
  background: var(--brand-grad);
  border-color: transparent;
  box-shadow:
    0 0 0 1px rgba(0,0,0,.25) inset,
    0 4px 12px -4px rgba(234,179,8,.55);
}
.check input:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid var(--brand-ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.check a {
  color: var(--brand-1);
  text-decoration: none;
  font-weight: 600;
}
.check a:hover { text-decoration: underline; }

/* Forgot password row */
.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: -2px;
}
.row-between .forgot {
  font-size: 13px;
  color: var(--brand-1);
  font-weight: 500;
}
.row-between .forgot:hover { text-decoration: underline; }

/* Primary CTA */
.auth-form .btn-submit {
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  background: var(--brand-grad);
  color: var(--brand-ink);
  border-radius: 12px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow:
    0 0 0 1px rgba(0,0,0,.25) inset,
    0 12px 28px -10px rgba(234,179,8,.65),
    0 1px 0 rgba(255,255,255,.45) inset;
  transition: transform .15s ease, box-shadow .2s ease, filter .15s ease;
}
.auth-form .btn-submit:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(0,0,0,.25) inset,
    0 16px 32px -10px rgba(234,179,8,.75),
    0 1px 0 rgba(255,255,255,.5) inset;
}
.auth-form .btn-submit:active { transform: translateY(0); }
.auth-form .btn-submit:disabled,
.auth-form .btn-submit.loading {
  opacity: .7;
  cursor: not-allowed;
}
.auth-form .btn-submit .spinner {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(10,10,10,.25);
  border-top-color: var(--brand-ink);
  animation: authSpin .8s linear infinite;
  display: none;
}
.auth-form .btn-submit.loading .spinner { display: inline-block; }
.auth-form .btn-submit.loading .label::after {
  content: " ...";
}
@keyframes authSpin {
  to { transform: rotate(360deg); }
}

/* ====================== Divider + social ====================== */

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0 18px;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-social {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 480px) {
  .auth-social { grid-template-columns: 1fr; }
}
.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 500;
  background: rgba(255,255,255,.02);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 11px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.social-btn:hover {
  background: rgba(255,255,255,.05);
  border-color: var(--border-strong);
}
.social-btn:active { transform: translateY(1px); }
.social-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.auth-switch {
  margin-top: 24px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-muted);
}
.auth-switch button {
  color: var(--brand-1);
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
  font-size: inherit;
}
.auth-switch button:hover { text-decoration: underline; }

/* ====================== Password strength meter ====================== */

.pwd-meter {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}
.pwd-meter span {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--bg-muted);
  transition: background .2s ease;
}
.pwd-meter[data-strength="1"] span:nth-child(-n+1) { background: var(--red); }
.pwd-meter[data-strength="2"] span:nth-child(-n+2) { background: var(--amber); }
.pwd-meter[data-strength="3"] span:nth-child(-n+3) { background: var(--amber); }
.pwd-meter[data-strength="4"] span:nth-child(-n+4) { background: var(--green); }
.pwd-meter-label {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 5px;
  font-family: var(--f-mono);
  letter-spacing: .02em;
}

/* ====================== Success state ====================== */

.auth-success {
  display: none;
  text-align: center;
  padding: 40px 0;
}
.auth-success.active { display: block; animation: paneFadeIn .35s ease; }
.auth-success .check-circle {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--brand-grad);
  color: var(--brand-ink);
  display: grid; place-items: center;
  margin: 0 auto 20px;
  box-shadow:
    0 0 0 8px rgba(250,204,21,.08),
    0 0 0 16px rgba(250,204,21,.04),
    0 12px 32px -8px rgba(234,179,8,.55);
  animation: bounceIn .6s cubic-bezier(.4,1.5,.5,1);
}
@keyframes bounceIn {
  0%   { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.auth-success h2 {
  font-size: 26px;
  font-family: var(--f-display);
  font-weight: 600;
  margin-bottom: 8px;
}
.auth-success p {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 24px;
}

/* ====================== Mobile ====================== */

.auth-mobile-bar {
  display: none;
}

.back-link--desktop {
  display: inline-flex;
  position: absolute;
  top: 28px;
  right: 32px;
}
.back-link--mobile { display: none; }

@media (max-width: 960px) {
  .auth {
    grid-template-columns: 1fr;
    min-height: 100dvh;
  }

  /* Esconde coluna lateral grande no mobile */
  .auth-side {
    display: none;
  }

  .auth-mobile-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 620px;
    margin: 0 auto 12px;
    padding: 4px 0 8px;
    flex-shrink: 0;
    position: relative;
  }

  .auth-mobile-bar-side {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
  }

  .auth-mobile-bar-side--left {
    justify-content: flex-start;
    position: relative;
    z-index: 1;
  }

  .auth-mobile-bar-side--right {
    justify-content: flex-end;
    pointer-events: none;
  }

  .auth-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    font-family: var(--f-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .auth-back-btn:hover,
  .auth-back-btn:focus-visible {
    background: rgba(250, 204, 21, 0.12);
    border-color: rgba(250, 204, 21, 0.35);
    color: var(--text);
  }

  .auth-back-btn:active {
    transform: scale(0.97);
  }

  .auth-back-btn svg {
    flex-shrink: 0;
    opacity: 0.9;
  }

  .auth-mobile-logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    z-index: 0;
    max-width: 46%;
  }

  .auth-mobile-logo .brand-logo-img {
    height: 28px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    margin: 0 auto;
  }

  .auth-main .back-link--desktop,
  .auth-main a.back-link.back-link--desktop {
    display: none !important;
  }

  .back-link--mobile {
    display: none !important;
  }

  .auth-main {
    min-height: 0;
    flex: 1;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 16px 16px 28px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }

  .auth-card {
    max-width: none;
    margin: 0 auto;
    width: 100%;
  }

  .auth-card.signup-active {
    max-width: none;
  }

  .auth-pane h1 {
    font-size: 1.5rem;
  }

  .auth-pane .lead {
    font-size: 14px;
    margin-bottom: 20px;
  }

  .auth-form.grid-2 {
    grid-template-columns: 1fr;
  }

  .auth-form.grid-2 .span-2 {
    grid-column: 1;
  }
}

@media (max-width: 480px) {
  .auth-main {
    padding-left: 14px;
    padding-right: 14px;
  }

  .auth-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .auth-tabs .tab-pill {
    width: calc(50% - 4px);
  }

  .auth-mobile-bar {
    min-height: 44px;
  }

  .auth-back-btn__text {
    display: none;
  }

  .auth-back-btn {
    padding: 10px 12px;
  }

  .auth-page-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 620px;
    margin: 24px auto 0;
    padding-top: 16px;
    font-size: 12px;
    color: var(--text-dim);
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
  }

  .auth-page-foot a:hover {
    color: var(--text);
  }
}

.auth-page-foot {
  display: none;
}

/* Laravel alerts + 2FA */
.auth-alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 14px;
  line-height: 1.45;
}
.auth-alert--success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}
.auth-alert--danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}
.auth-alert--warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}
.auth-2fa-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}
.auth-2fa-modal.active { display: flex; }
.auth-2fa-card {
  width: 100%;
  max-width: 400px;
  padding: 28px 24px;
  border-radius: var(--r-lg);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  text-align: center;
}
.auth-2fa-card h3 { margin: 0 0 8px; font-size: 1.25rem; }
.auth-2fa-card p { margin: 0 0 20px; color: var(--text-muted); font-size: 14px; }
.auth-2fa-input {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 16px;
  padding: 12px;
  text-align: center;
  font-family: var(--f-mono);
  font-size: 1.25rem;
  letter-spacing: 0.2em;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--text);
}
.auth-2fa-cancel {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
}
.auth-2fa-cancel:hover { color: var(--text); }