/* ==========================================================
   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(255,138,0,.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(232,106,0,.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-logo {
  height: 72px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  object-position: left center;
}
.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(255,138,0,.10),
    0 6px 18px -4px rgba(232,106,0,.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;
  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;
  font-weight: 500;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.auth-main .back-link:hover {
  color: var(--text);
  background: rgba(255,138,0,.10);
  border-color: rgba(255,138,0,.35);
  transform: translateY(-1px);
}
.auth-main .back-link svg {
  flex-shrink: 0;
}

.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(232,106,0,.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(255,138,0,.03);
  box-shadow: 0 0 0 3px rgba(255,138,0,.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(232,106,0,.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(232,106,0,.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(232,106,0,.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(255,138,0,.08),
    0 0 0 16px rgba(255,138,0,.04),
    0 12px 32px -8px rgba(232,106,0,.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 ====================== */

@media (max-width: 960px) {
  .auth {
    min-height: 100vh;
    grid-template-columns: 1fr;
  }
  .auth-side {
    min-height: auto;
    padding: 18px 20px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-shrink: 0;
  }
  .auth-side::before,
  .auth-side::after { display: none; }
  .auth-side .dotted-surface { display: none; }
  .auth-side-content { display: none; }
  .auth-quote { display: none; }
  .auth-perks { display: none; }
  .auth-side-foot { display: none !important; }
  .auth-brand {
    font-size: 16px;
    justify-content: center;
  }
  .auth-brand .brand-logo {
    height: 60px;
    max-width: 240px;
  }
  .auth-brand .brand-mark {
    width: 28px; height: 28px;
    font-size: 14px;
  }

  /* Right side becomes a top-aligned column, NOT centered */
  .auth-main {
    min-height: auto;
    padding: 24px 20px 56px;
    display: block;
  }
  .auth-main .back-link {
    position: static;
    margin: 0 0 20px;
    display: inline-flex;
    font-size: 13px;
    padding: 10px 16px;
  }
  .auth-card,
  .auth-card.signup-active {
    max-width: none;
    width: 100%;
  }
  .auth-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 24px;
  }
  .auth-tabs button {
    padding: 9px 12px;
    font-size: 13.5px;
    text-align: center;
  }
  .auth-tabs .tab-pill {
    width: calc(50% - 4px);
  }

  .auth-pane h1 { font-size: 24px; }
  .auth-pane .lead { font-size: 14.5px; margin-bottom: 22px; }

  .auth-form.grid-2 { gap: 14px 12px; }
}

@media (max-width: 640px) {
  .auth-side {
    padding: 16px 18px;
  }
  .auth-main { padding: 24px 16px 40px; }

  /* Signup → single column on phones */
  .auth-form.grid-2 {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .auth-form .span-2 { grid-column: 1; }

  /* Fields */
  .field input,
  .field select {
    padding: 12px 13px;
    font-size: 15px;     /* >= 16px ideally; but 15 reads fine in our type system */
    border-radius: 10px;
  }
  .field label,
  .field > .field-label { font-size: 12.5px; }
  .field .eye { width: 34px; height: 34px; bottom: 5px; }

  /* Submit */
  .auth-form .btn-submit {
    padding: 13px 18px;
    font-size: 14.5px;
  }

  /* Row between (remember me / forgot) */
  .row-between { flex-wrap: wrap; gap: 8px; }
  .row-between .forgot { font-size: 12.5px; }

  /* Check */
  .check { font-size: 13px; }

  /* Tabs */
  .auth-pane h1 { font-size: 22px; }
  .auth-pane .lead { font-size: 14px; }

  /* Switch link */
  .auth-switch { font-size: 13px; margin-top: 18px; }
}

@media (max-width: 380px) {
  .auth-main { padding: 20px 14px 32px; }
  .auth-pane h1 { font-size: 20px; }
}

/* Prevent iOS zoom on focus */
@media (max-width: 640px) {
  .field input[type="email"],
  .field input[type="password"],
  .field input[type="text"],
  .field input[type="tel"] {
    font-size: 16px;
  }
}
/* ====================== Alerts + 2FA (Laravel integration) ====================== */

.auth-alert {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.45;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
}
.auth-alert.is-error {
  border-color: rgba(239,68,68,.45);
  background: rgba(239,68,68,.12);
  color: #fecaca;
}
.auth-alert.is-success {
  border-color: rgba(34,197,94,.45);
  background: rgba(34,197,94,.12);
  color: #bbf7d0;
}
.auth-alert.is-info {
  border-color: rgba(255,138,0,.4);
  background: rgba(255,138,0,.1);
  color: #fde68a;
}
.auth-alert[hidden] { display: none !important; }

.auth-2fa-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
}
.auth-2fa-overlay[hidden] { display: none !important; }

.auth-2fa-modal {
  width: 100%;
  max-width: 400px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.auth-2fa-icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: var(--brand-grad);
  color: var(--brand-ink);
}
.auth-2fa-modal h3 {
  font-family: var(--f-display);
  font-size: 20px;
  margin: 0 0 8px;
}
.auth-2fa-modal > p {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 18px;
}
.auth-2fa-input {
  width: 100%;
  text-align: center;
  letter-spacing: .35em;
  font-family: var(--f-mono);
  font-size: 22px;
  padding: 14px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  margin-bottom: 16px;
  outline: none;
}
.auth-2fa-input:focus {
  border-color: rgba(255,138,0,.55);
  box-shadow: 0 0 0 3px rgba(255,138,0,.12);
}
.auth-2fa-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-2fa-actions .btn-submit { width: 100%; }
