/* ========================================================================== 
   DigiEstoque — Login
   Tela de autenticação vinculada ao Design System. Sem regras de negócio.
   ========================================================================== */

:root {
  --auth-context-bg: var(--brand-900);
  --auth-context-text: var(--text-inverse);
  --auth-context-muted: color-mix(in srgb, var(--text-inverse) 76%, transparent);
  --auth-context-border: rgba(255, 255, 255, .14);
  --auth-context-soft: rgba(255, 255, 255, .08);
}

[data-theme="dark"] {
  --auth-context-bg: color-mix(in srgb, var(--brand-900) 68%, var(--bg-page));
  --auth-context-text: var(--text-primary);
  --auth-context-muted: var(--text-secondary);
  --auth-context-border: rgba(255, 255, 255, .1);
  --auth-context-soft: rgba(255, 255, 255, .06);
}

.auth-page {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(400px, 1.05fr) minmax(460px, .95fr);
  background: var(--bg-page);
}

.auth-context {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--space-10) clamp(var(--space-8), 6vw, var(--space-20));
  overflow: hidden;
  color: var(--auth-context-text);
  background: var(--auth-context-bg);
}

.auth-context::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: .34;
  background-image:
    linear-gradient(var(--auth-context-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--auth-context-border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom right, black, transparent 72%);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.auth-wordmark,
.auth-mobile-brand {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  letter-spacing: var(--tracking-tight);
}

.auth-brand-label {
  padding-left: var(--space-3);
  border-left: 1px solid var(--auth-context-border);
  color: var(--auth-context-muted);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  letter-spacing: var(--tracking-wide);
}

.auth-context-copy {
  width: min(100%, 600px);
  margin: var(--space-16) 0;
}

.auth-eyebrow {
  margin-bottom: var(--space-4);
  color: var(--auth-context-muted);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
}

.auth-context h1 {
  max-width: 590px;
  font-size: clamp(34px, 4vw, 52px);
  font-weight: var(--font-semibold);
  line-height: 1.08;
  letter-spacing: -.04em;
  text-wrap: balance;
}

.auth-context-copy > p:not(.auth-eyebrow) {
  max-width: 520px;
  margin-top: var(--space-5);
  color: var(--auth-context-muted);
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  text-wrap: pretty;
}

.auth-journey {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-10);
  list-style: none;
}

.auth-journey li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--auth-context-border);
}

.auth-journey li::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--auth-context-text);
}

.auth-step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--auth-context-border);
  border-radius: var(--radius-md);
  background: var(--auth-context-soft);
}

.auth-step-icon svg {
  width: 17px;
  height: 17px;
}

.auth-journey b,
.auth-journey small {
  display: block;
}

.auth-journey b {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
}

.auth-journey small {
  margin-top: var(--space-1);
  color: var(--auth-context-muted);
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
}

.auth-context-foot {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--auth-context-muted);
  font-size: var(--text-xs);
}

.auth-context-foot svg {
  width: 15px;
  height: 15px;
}

.auth-entry {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: var(--space-10);
  background: var(--bg-page);
}

.auth-theme-toggle {
  position: absolute;
  top: var(--space-6);
  right: var(--space-6);
  border: 1px solid var(--border-default);
  background: var(--control-bg);
}

.auth-theme-toggle svg {
  width: 17px;
  height: 17px;
}

.auth-card {
  width: min(100%, 420px);
  padding: var(--space-8);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .auth-card {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .025);
}

.auth-card-head {
  margin-bottom: var(--space-8);
}

.auth-mobile-brand {
  display: none;
  margin-bottom: var(--space-8);
  color: var(--brand-text);
}

.auth-card h2 {
  font-size: var(--text-3xl);
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

.auth-card-head > p:not(.auth-mobile-brand) {
  margin-top: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  text-wrap: pretty;
}

.auth-error {
  margin-bottom: var(--space-5);
}

.auth-password-field .input {
  padding-right: 44px;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: var(--space-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  transform: translateY(-50%);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.auth-password-toggle:hover {
  color: var(--text-primary);
  background: var(--control-bg-hover);
}

.auth-password-toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.auth-password-toggle svg {
  width: 17px;
  height: 17px;
}

.auth-submit {
  margin-top: var(--space-2);
}

.auth-submit > svg {
  transition: transform var(--transition-fast);
}

.auth-submit:hover > svg {
  transform: translateX(2px);
}

.auth-submit.loading > svg {
  display: none;
}

.auth-help {
  margin-top: var(--space-5);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  text-align: center;
  text-wrap: pretty;
}

.auth-entry-foot {
  margin-top: var(--space-6);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}

@media (max-width: 1040px) {
  .auth-shell {
    grid-template-columns: minmax(340px, .9fr) minmax(420px, 1.1fr);
  }

  .auth-context {
    padding-inline: var(--space-8);
  }

  .auth-journey {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: var(--space-6);
  }
}

@media (max-width: 760px) {
  .auth-shell {
    display: block;
  }

  .auth-context {
    display: none;
  }

  .auth-entry {
    min-height: 100vh;
    min-height: 100dvh;
    padding: var(--space-20) var(--space-5) var(--space-8);
  }

  .auth-theme-toggle {
    top: var(--space-5);
    right: var(--space-5);
  }

  .auth-mobile-brand {
    display: block;
  }

  .auth-entry-foot {
    margin-top: var(--space-5);
  }
}

@media (max-width: 420px) {
  .auth-entry {
    justify-content: flex-start;
    padding-inline: var(--space-4);
  }

  .auth-card {
    padding: var(--space-6);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-password-toggle,
  .auth-submit > svg {
    transition: none;
  }
}
