/* ==========================================================================
   System Commerce: tela de login (index.html)
   Fonte: Figma, frame "design-login-mercom" (1280 x 1024)
   Esta página tem CSS próprio (não usa os arquivos do sistema).
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;

  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-700: #334155;
  --slate-900: #0f172a;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

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

html,
body {
  margin: 0;
}

body {
  font-family: var(--font);
  color: var(--slate-900);
  background: var(--slate-50);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

img {
  display: block;
  max-width: 100%;
}

h1, h2, p, ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

.icon {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--8  { width: 8px;  height: 8px; }
.icon--20 { width: 20px; height: 20px; }
.icon--24 { width: 24px; height: 24px; }

:where(a, button, input):focus-visible {
  outline: 2px solid var(--blue-600);
  outline-offset: 2px;
}

/* ---------- Layout geral: 53% / 47% ---------- */
.login {
  position: relative;
  display: grid;
  grid-template-columns: 52.97fr 47.03fr;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Controles do topo ---------- */
.topbar {
  position: absolute;
  top: 20px;
  right: 32px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 24px;
}

/* ---------- Botão "Voltar ao site" (mesmo estilo do menu do site) ---------- */
.back {
  position: absolute;
  top: 20px;
  left: 32px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 16px 0 5px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  background: rgba(6, 22, 56, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9999px;
  box-shadow: 0 4px 14px -4px rgba(6, 22, 56, 0.35);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: background-color 0.15s;
}

.back__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  transition: transform 0.15s;
}

.back:hover {
  background: rgba(6, 22, 56, 0.92);
}

.back:hover .back__icon {
  transform: translateX(-2px);
}

.theme-toggle {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 9999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.theme-toggle__btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--slate-400);
  background: transparent;
  border: 0;
  border-radius: 9999px;
  cursor: pointer;
}

.theme-toggle__btn:disabled,
.lang:disabled {
  cursor: default;
}

.theme-toggle__btn[aria-pressed="true"] {
  color: var(--blue-600);
  background: rgba(239, 246, 255, 0.8);
}

.lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--slate-700);
  background: none;
  border: 0;
  cursor: pointer;
}

.lang .icon {
  color: var(--slate-500);
}

/* ==========================================================================
   Painel esquerdo
   ========================================================================== */
.showcase {
  position: relative;
  overflow: hidden;
  padding: clamp(80px, 14vh, 203px) 56px 128px;
  color: #fff;
  background: radial-gradient(
    circle 900px at 80% 30%,
    #0c4ad4 0,
    #0b3db0 13.75%,
    #09318c 27.5%,
    #082468 41.25%,
    #061744 55%,
    #030c29 100%
  );
}

.showcase__inner {
  max-width: 566px;
  margin-inline: auto;
}

/* Grade de pontos no canto inferior esquerdo */
.showcase__dots {
  position: absolute;
  left: 31px;
  bottom: 32px;
  width: 96px;
  height: 42px;
  opacity: 0.3;
  pointer-events: none;
  background: radial-gradient(circle at 3px 3px, #93c5fd 3px, transparent 3.5px);
  background-size: 18px 18px;
}

/* ---------- Headline ---------- */
.hero {
  padding-left: 11px;
}

.hero__title {
  font-size: 40px;
  line-height: 40px;
  font-weight: 800;
  letter-spacing: -1px;
  color: #fff;
}

.hero__text {
  max-width: 448px;
  margin-top: 5px;
  font-size: 16px;
  line-height: 24px;
  color: rgba(219, 234, 254, 0.8);
}

/* ---------- Mockup + cards flutuantes ---------- */
.mockup {
  position: relative;
  margin-top: 12px;
  aspect-ratio: 566.39 / 377.22;
}

.mockup__laptop {
  position: absolute;
  top: -7px;
  left: 0;
  width: 100%;
  aspect-ratio: 566.39 / 377.22;
  overflow: hidden;
  filter: drop-shadow(0 25px 12.5px rgba(0, 0, 0, 0.15));
}

/* Notebook recortado na área útil (sem margens transparentes), centralizado e inteiro dentro do frame */
.mockup__laptop img {
  position: absolute;
  top: 50%;
  left: 6%;
  width: 88%;
  max-width: none;
  height: auto;
  transform: translateY(-50%);
}

.stat {
  position: absolute;
  display: flex;
  align-items: center;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.stat__body {
  display: flex;
  flex-direction: column;
}

.stat__label {
  white-space: nowrap;
  font-size: 11px;
  line-height: 16.5px;
  font-weight: 500;
  color: var(--slate-500);
}

.stat__value {
  font-size: 24px;
  line-height: 30px;
  font-weight: 800;
  color: var(--slate-900);
}

.stat__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

/* Pedidos pendentes (card claro) */
.stat--orders {
  left: -24px;
  bottom: 80px;
  width: 187.11px;
  height: 95px;
  padding: 0 14px;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--slate-100);
}

.stat__icon--solid {
  color: #fff;
  background: var(--blue-600);
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3), 0 2px 4px -2px rgba(59, 130, 246, 0.3);
}

.stat__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 1.5px;
  font-size: 10px;
  line-height: 15px;
  font-weight: 700;
  color: var(--blue-600);
  text-decoration: none;
}

/* Produtos (card escuro) */
.stat--products {
  right: 10px;
  bottom: 112px;
  width: 180.28px;
  height: 74px;
  padding: 0 14px 0 16px;
  gap: 14px;
  background: rgba(9, 21, 56, 0.95);
  border: 1px solid rgba(96, 165, 250, 0.2);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.stat__icon--glass {
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.3);
  border: 1px solid rgba(96, 165, 250, 0.4);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat__label--caps {
  font-size: 10px;
  line-height: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(191, 219, 254, 0.9);
}

.stat__row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat__value--sm {
  font-size: 20px;
  line-height: 20px;
  color: #fff;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  font-size: 9px;
  line-height: 13.5px;
  font-weight: 600;
  color: #34d399;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 9999px;
}

/* ---------- Três pilares ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid rgba(30, 64, 175, 0.4);
}

.feature {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feature__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 12px;
}

.feature__title {
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
  color: #fff;
}

.feature__text {
  font-size: 12px;
  line-height: 16px;
  color: rgba(191, 219, 254, 0.7);
}

/* ==========================================================================
   Painel direito
   ========================================================================== */
.auth {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 24px 88px;
  background: var(--slate-50);
}

.auth__footer {
  position: absolute;
  right: 0;
  bottom: 60px;
  left: 0;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  color: var(--slate-400);
}

/* ---------- Card ---------- */
.card {
  width: 100%;
  max-width: 430px;
  padding: 40px;
  background: #fff;
  border: 1px solid var(--slate-100);
  border-radius: 24px;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.12), 0 0 1px 1px rgba(0, 0, 0, 0.04);
}

.card__footer {
  margin-top: 24px;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  color: var(--slate-500);
}

/* ---------- Cabeçalho do card ---------- */
.brand {
  text-align: center;
}

/* Logo horizontal do System Commerce (fundo transparente) */
.brand__logo {
  display: flex;
  justify-content: center;
  margin: 7px auto 0;
}

.brand__logo img {
  display: block;
  width: 190px;
  max-width: 100%;
  height: auto;
  transform: translateX(-10px);
}

.brand__title {
  margin-top: 24px;
  font-size: 24px;
  line-height: 32px;
  font-weight: 700;
  letter-spacing: -0.6px;
  color: var(--slate-900);
}

.brand__subtitle {
  margin-top: 4px;
  font-size: 14px;
  line-height: 20px;
  color: var(--slate-500);
}

/* ---------- Formulário ---------- */
.form {
  display: flex;
  flex-direction: column;
  margin-top: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field + .field {
  margin-top: 16px;
}

.field__label {
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  color: var(--slate-700);
}

.input {
  position: relative;
}

.input__control {
  width: 100%;
  height: 42px;
  padding: 0 16px 0 40px;
  font-size: 14px;
  line-height: 20px;
  color: var(--slate-900);
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input__control--password {
  padding-right: 44px;
}

.input__control::placeholder {
  color: var(--slate-400);
  opacity: 1;
}

.input__control:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.input__control[aria-invalid="true"] {
  border-color: #dc2626;
}

.input__control[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.input__icon {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: var(--slate-400);
  pointer-events: none;
}

.input__toggle {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 42px;
  padding: 0;
  color: var(--slate-400);
  background: none;
  border: 0;
  cursor: pointer;
}

.input__toggle:hover {
  color: var(--slate-500);
}

/* Lembrar-me / Esqueci minha senha */
.form__options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--slate-700);
  cursor: pointer;
}

.checkbox {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  background: #fff center / 16px no-repeat;
  border: 1px solid var(--slate-300);
  border-radius: 4px;
  cursor: pointer;
}

.checkbox:checked {
  background-color: var(--blue-600);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  border-color: transparent;
}

.link {
  color: var(--blue-600);
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

.link--bold {
  font-weight: 700;
}

/* Mensagem de erro / aviso do login */
.form__alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
}

.form__alert .icon {
  margin-top: 0;
}

.form__alert--info {
  color: var(--blue-700);
  background: #eff6ff;
  border-color: #bfdbfe;
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.btn--primary {
  height: 44px;
  margin-top: 16px;
  color: #fff;
  background: var(--blue-600);
  border: 0;
  box-shadow: 0 12px 30px -4px rgba(11, 95, 255, 0.45);
}

.btn--primary:hover {
  background: var(--blue-700);
}

.btn--google {
  height: 42px;
  margin-top: 16px;
  color: var(--slate-700);
  background: #fff;
  border: 1px solid var(--slate-200);
}

.btn--google:hover {
  background: var(--slate-50);
}

/* Divisor "ou" */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

/* Linhas dos dois lados do "ou", sem fundo no texto */
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--slate-200);
}

.divider span {
  font-size: 12px;
  line-height: 16px;
  color: var(--slate-400);
}

.divider + .btn--google {
  margin-top: 9px;
}

/* ==========================================================================
   Responsivo
   O Figma só traz a versão desktop. Abaixo de 960px o painel de marca é
   ocultado e o card ocupa a tela.
   ========================================================================== */
@media (max-width: 960px) {
  .login {
    grid-template-columns: 1fr;
  }

  .showcase {
    display: none;
  }

  .topbar {
    right: 16px;
  }

  .back {
    left: 16px;
  }
}

@media (max-width: 480px) {
  .back__long {
    display: none;
  }

  .auth {
    padding-inline: 16px;
  }

  .card {
    padding: 32px 24px;
  }
}

/* Dica abaixo do campo (ex.: regra da senha em "Criar conta") */
.field__hint {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 16px;
  color: var(--slate-500);
}

/* Botão enquanto espera a resposta do servidor */
.btn--primary:disabled {
  opacity: 0.7;
  cursor: wait;
}


/* ---------- Barras de rolagem da Mercom: trilho claro, barra azul-marinho (todas as telas) ---------- */
/* Chrome, Edge, Safari e celulares */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #e8eef5; border-radius: 10px; }
::-webkit-scrollbar-thumb { background: #0b1f4a; border: 2px solid #e8eef5; border-radius: 10px; min-height: 40px; }
::-webkit-scrollbar-thumb:hover { background: #0b5ed7; }
::-webkit-scrollbar-thumb:active { background: #102a5e; }
::-webkit-scrollbar-corner { background: #e8eef5; }
/* Firefox (não tem os estilos acima) */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: #0b1f4a #e8eef5; }
}
