/* VG Tech API — login e cadastro (alinhado à landing) */
@import url('theme-toggle.css');

:root,
[data-pf-theme="light"] {
  --auth-bg: #f4f4f5;
  --auth-bg-elevated: #ffffff;
  --auth-bg-panel: #ffffff;
  --auth-surface: #ffffff;
  --auth-green: #16a34a;
  --auth-green-hover: #15803d;
  --auth-green-dim: rgba(22, 163, 74, 0.12);
  --auth-text: #18181b;
  --auth-muted: #71717a;
  --auth-border: rgba(0, 0, 0, 0.1);
  --auth-input-bg: #ffffff;
  --auth-input-border: rgba(0, 0, 0, 0.14);
  --auth-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  --auth-radius: 12px;
  --auth-radius-lg: 16px;
}

[data-pf-theme="dark"] {
  --auth-bg: #0a0a0b;
  --auth-bg-elevated: #121214;
  --auth-bg-panel: #16161a;
  --auth-surface: #1c1c21;
  --auth-green: #25d366;
  --auth-green-hover: #1ebe5b;
  --auth-green-dim: rgba(37, 211, 102, 0.12);
  --auth-text: #f4f4f5;
  --auth-muted: #a1a1aa;
  --auth-border: rgba(255, 255, 255, 0.1);
  --auth-input-bg: #25252b;
  --auth-input-border: rgba(255, 255, 255, 0.16);
  --auth-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

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

body.auth {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background: var(--auth-bg);
  color: var(--auth-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.auth-layout {
  display: flex;
  min-height: 100vh;
}

/* —— Coluna marca —— */
.auth-brand {
  flex: 0 0 42%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem 2.75rem;
  background: var(--auth-bg);
  border-right: 1px solid var(--auth-border);
  position: relative;
  overflow: hidden;
}

.auth-brand::before {
  content: "";
  position: absolute;
  top: -20%;
  left: -30%;
  width: 80%;
  height: 60%;
  background: radial-gradient(ellipse, rgba(37, 211, 102, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.auth-brand-inner {
  position: relative;
  z-index: 1;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 2.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--auth-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-back:hover {
  color: var(--auth-green);
}

.auth-back svg {
  width: 1rem;
  height: 1rem;
}

.auth-logo {
  display: block;
  height: 4.5rem;
  width: auto;
  max-width: 12rem;
  margin-bottom: 2rem;
  object-fit: contain;
}

.auth-logo.vg-logo {
  display: inline-flex;
  height: auto;
  max-width: none;
}

.auth-tagline {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--auth-text);
}

.auth-desc {
  margin: 0;
  font-size: 1rem;
  color: var(--auth-muted);
  max-width: 22rem;
  line-height: 1.55;
}

.auth-brand-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.75rem;
}

.auth-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--auth-green-dim);
  color: var(--auth-green);
  border: 1px solid rgba(37, 211, 102, 0.25);
}

.auth-brand-footer {
  position: relative;
  z-index: 1;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--auth-border);
}

.auth-company-toggle {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.75rem;
  color: var(--auth-muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-company-toggle:hover {
  color: var(--auth-text);
}

.auth-company-details {
  margin: 0.5rem 0 0;
  font-size: 0.6875rem;
  color: var(--auth-muted);
  line-height: 1.5;
}

.auth-company-details[hidden] {
  display: none;
}

/* —— Coluna formulário —— */
.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: var(--auth-bg-elevated);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 2rem 2rem 1.75rem;
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius-lg);
  box-shadow: var(--auth-shadow);
}

.auth-panel[hidden] {
  display: none !important;
}

.auth-card-title {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.auth-card-sub {
  margin: 0 0 1.75rem;
  font-size: 0.9375rem;
  color: var(--auth-muted);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.auth-panel--signup .auth-form {
  gap: 1.5rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.auth-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--auth-text);
}

.auth-input,
.auth-select {
  width: 100%;
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--auth-text);
  background: var(--auth-input-bg);
  border: 1px solid var(--auth-input-border);
  border-radius: var(--auth-radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-input:hover,
.auth-select:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.auth-input::placeholder {
  color: #71717a;
}

.auth-input:focus,
.auth-select:focus {
  outline: none;
  border-color: rgba(37, 211, 102, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}

.auth-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.auth-password-wrap {
  position: relative;
}

.auth-password-wrap .auth-input {
  padding-right: 2.75rem;
}

.auth-password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.35rem;
  background: none;
  border: none;
  color: var(--auth-muted);
  cursor: pointer;
  border-radius: 6px;
  line-height: 0;
}

.auth-password-toggle:hover {
  color: var(--auth-text);
}

.auth-password-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

.auth-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.auth-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--auth-muted);
  line-height: 1.45;
}

.auth-note {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--auth-muted);
  line-height: 1.45;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.25rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--auth-radius);
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
}

.auth-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-btn--primary {
  background: var(--auth-green);
  color: #052e16;
}

.auth-btn--primary:hover:not(:disabled) {
  background: var(--auth-green-hover);
}

.auth-btn--outline {
  background: transparent;
  color: var(--auth-text);
  border: 1px solid var(--auth-border);
}

.auth-btn--outline:hover:not(:disabled) {
  border-color: rgba(37, 211, 102, 0.45);
  color: var(--auth-green);
}

.auth-btn--ghost {
  background: transparent;
  color: var(--auth-muted);
  width: auto;
  padding: 0.5rem;
}

.auth-btn--ghost:hover {
  color: var(--auth-text);
}

.auth-btn-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.auth-link {
  color: var(--auth-green);
  font-weight: 600;
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-footer-text {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--auth-muted);
  line-height: 1.5;
}

.auth-footer-text a {
  color: var(--auth-green);
  font-weight: 600;
  text-decoration: none;
}

.auth-footer-text a:hover {
  text-decoration: underline;
}

.auth-switch {
  margin: 1.5rem 0 0;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--auth-muted);
}

.auth-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.auth-panel-header .auth-card-sub {
  margin-bottom: 1.25rem;
}

/* Alertas */
.auth-alert {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
  border-radius: var(--auth-radius);
  border: 1px solid transparent;
}

.auth-alert[hidden] {
  display: none !important;
}

.auth-alert--error {
  color: #fecaca;
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
}

.auth-alert--warning {
  color: #fde68a;
  background: rgba(217, 119, 6, 0.12);
  border-color: rgba(251, 191, 36, 0.35);
}

.auth-alert--success {
  color: #bbf7d0;
  background: rgba(37, 211, 102, 0.1);
  border-color: rgba(37, 211, 102, 0.35);
}

/* Cadastro — painel scrollável */
.auth-panel--signup .auth-card {
  max-width: 520px;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}

.auth-signup-intro {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  font-size: 0.8125rem;
  color: var(--auth-muted);
  background: var(--auth-green-dim);
  border: 1px solid rgba(37, 211, 102, 0.2);
  border-radius: var(--auth-radius);
  line-height: 1.5;
}

.auth-whatsapp-cta {
  margin-top: 0.5rem;
}

/* Boleto sucesso */
.auth-boleto-box {
  padding: 1rem 1.15rem;
  border-radius: var(--auth-radius);
  background: var(--auth-green-dim);
  border: 1px solid rgba(37, 211, 102, 0.3);
}

.auth-boleto-box p {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
}

.auth-boleto-box p:first-child {
  font-weight: 700;
  color: var(--auth-green);
}

.auth-boleto-box a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--auth-green);
  font-weight: 600;
  text-decoration: none;
}

.auth-boleto-box a:hover {
  text-decoration: underline;
}

.auth-spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(5, 46, 22, 0.25);
  border-top-color: #052e16;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}

.auth-btn-loading[hidden],
.auth-btn-text[hidden] {
  display: none !important;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Desktop — painel único centralizado (evita “mar” vazio ao redor do card) */
@media (min-width: 900px) {
  body.auth {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background:
      radial-gradient(ellipse 80% 50% at 50% -10%, rgba(37, 211, 102, 0.08) 0%, transparent 55%),
      var(--auth-bg);
  }

  .auth-layout {
    width: 100%;
    max-width: 920px;
    min-height: min(520px, calc(100vh - 4rem));
    max-height: calc(100vh - 4rem);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-lg);
    box-shadow: var(--auth-shadow);
    overflow: hidden;
    background: var(--auth-bg-elevated);
  }

  .auth-brand {
    flex: 0 0 38%;
    max-width: none;
    min-width: 300px;
    padding: 2.25rem 2rem;
    border-right: 1px solid var(--auth-border);
  }

  .auth-tagline {
    font-size: 1.25rem;
  }

  .auth-logo {
    height: 3.75rem;
    margin-bottom: 1.5rem;
  }

  .auth-main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 2.25rem;
    background: var(--auth-surface);
    overflow-y: auto;
  }

  .auth-main:has(#registerPanel:not([hidden])) {
    align-items: flex-start;
  }

  .auth-panel {
    width: 100%;
  }

  .auth-card {
    max-width: none;
    width: 100%;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .auth-panel--signup .auth-card {
    max-width: none;
    max-height: none;
    overflow: visible;
  }

  /* Cadastro: coluna única (como no mobile), sem scroll espremido ao lado da marca */
  body.auth.auth--signup {
    align-items: flex-start;
    padding: 1.5rem 1.25rem 2.5rem;
  }

  body.auth.auth--signup .auth-layout {
    flex-direction: column;
    max-width: 520px;
    min-height: auto;
    max-height: none;
    overflow: visible;
    margin: 0 auto;
  }

  body.auth.auth--signup .auth-brand {
    flex: none;
    min-width: 0;
    padding: 1.25rem 1.5rem 1rem;
    border-right: none;
    border-bottom: 1px solid var(--auth-border);
  }

  body.auth.auth--signup .auth-back {
    margin-bottom: 1rem;
  }

  body.auth.auth--signup .auth-logo {
    height: 2.75rem;
    margin-bottom: 0;
  }

  body.auth.auth--signup .auth-tagline,
  body.auth.auth--signup .auth-desc,
  body.auth.auth--signup .auth-brand-badges,
  body.auth.auth--signup .auth-brand-footer {
    display: none;
  }

  body.auth.auth--signup .auth-brand-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  body.auth.auth--signup .auth-main {
    flex: none;
    width: 100%;
    align-items: stretch;
    justify-content: flex-start;
    padding: 1.5rem 1.5rem 1.75rem;
    overflow: visible;
  }

  body.auth.auth--signup .auth-panel-header {
    margin-bottom: 0.5rem;
  }

  body.auth.auth--signup .auth-card-sub {
    margin-bottom: 1rem;
  }
}

/* Mobile */
@media (max-width: 899px) {
  .auth-layout {
    flex-direction: column;
  }

  .auth-brand {
    flex: none;
    max-width: none;
    padding: 1.5rem 1.25rem 1.25rem;
    border-right: none;
    border-bottom: 1px solid var(--auth-border);
  }

  .auth-back {
    margin-bottom: 1.25rem;
  }

  .auth-logo {
    height: 3rem;
    margin-bottom: 1rem;
  }

  .auth-tagline {
    font-size: 1.125rem;
  }

  .auth-desc {
    font-size: 0.875rem;
  }

  .auth-brand-badges {
    margin-top: 1rem;
  }

  .auth-brand-footer {
    display: none;
  }

  .auth-main {
    padding: 1.25rem 1rem 2rem;
    align-items: flex-start;
  }

  .auth-card {
    padding: 1.5rem 1.25rem;
  }

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

  .auth-panel--signup .auth-card {
    max-height: none;
  }
}

