/* Login / primeiro acesso — Portal do cliente */

/* base_auth: evita overflow hidden do login ERP esconder/cortar o portal */
html:has(.portal-auth) {
  height: auto;
  overflow: auto;
}

.auth-body:has(.portal-auth) {
  height: auto;
  min-height: 100dvh;
  max-height: none;
  overflow: auto;
}

.portal-auth {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1.25rem 2rem;
  background:
    radial-gradient(ellipse 90% 70% at 50% -10%, color-mix(in srgb, var(--color-primary, #702020) 18%, transparent), transparent 55%),
    linear-gradient(180deg, #f1f5f9 0%, #f8fafc 45%, #fff 100%);
}

@supports not (min-height: 100dvh) {
  .portal-auth { min-height: 100vh; }
}

.portal-auth__card {
  width: 100%;
  max-width: 26rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.75rem 1.65rem 1.5rem;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 16px 48px rgba(15, 23, 42, 0.08);
}

.portal-auth__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.35rem;
}

.portal-auth__logo-wrap {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 12px;
  background: linear-gradient(145deg, #fff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
}

.portal-auth__logo {
  width: 2.25rem;
  height: 2.25rem;
  object-fit: contain;
  border-radius: 6px;
}

.portal-auth__product {
  margin: 0;
  font-family: var(--font-brand, "Cormorant Garamond", Georgia, serif);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--color-primary, #702020);
  line-height: 1.1;
}

.portal-auth__badge {
  display: inline-block;
  margin-top: 0.45rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 999px;
}

.portal-auth__title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  color: #0f172a;
}

.portal-auth__sub {
  margin: 0 0 1.25rem;
  font-size: 0.88rem;
  line-height: 1.5;
  text-align: center;
  color: #64748b;
}

.portal-auth__flash {
  margin: 0 0 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.45;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.portal-auth__flash--danger { background: #fee2e2; color: #991b1b; }
.portal-auth__flash--success { background: #dcfce7; color: #166534; }
.portal-auth__flash--warning { background: #fef3c7; color: #92400e; }

.portal-auth__form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.portal-auth__form .field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.portal-auth__form .field__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
}

.portal-auth__form .input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.95rem;
}

.portal-auth__form .input:focus {
  outline: none;
  border-color: var(--color-primary, #702020);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary, #702020) 15%, transparent);
}

.portal-auth__form .field__error {
  font-size: 0.78rem;
  color: #b91c1c;
}

.portal-auth__submit {
  margin-top: 0.25rem;
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.portal-auth__lgpd {
  margin: 0.25rem 0 0;
  padding: 0.75rem 0.85rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.portal-auth__lgpd-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  cursor: pointer;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #475569;
}

.portal-auth__lgpd-check input {
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: var(--color-primary, #702020);
}

.portal-auth__lgpd-check a {
  color: var(--color-primary, #702020);
  font-weight: 500;
}

.portal-auth__lgpd-note {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #64748b;
  text-align: center;
}

.portal-auth__lgpd-note a {
  color: var(--color-primary, #702020);
  font-weight: 500;
}

.portal-auth__trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 1rem 0 0;
  font-size: 0.72rem;
  color: #94a3b8;
}

.portal-auth__trust svg {
  width: 0.9rem;
  height: 0.9rem;
  flex-shrink: 0;
}

.portal-auth__links {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
  text-align: center;
  font-size: 0.82rem;
  color: #64748b;
}

.portal-auth__links a {
  color: var(--color-primary, #702020);
  font-weight: 500;
  text-decoration: none;
}

.portal-auth__links a:hover { text-decoration: underline; }

.portal-auth__foot {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.5;
}

.portal-auth__foot a {
  color: #64748b;
  text-decoration: underline;
}

.portal-auth__foot strong {
  color: var(--color-primary, #702020);
  font-weight: 600;
}
