@font-face {
  font-family: "Inter";
  src: url("/static/fonts/InterVariable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --auth-black: #111111;
  --auth-graphite: #242424;
  --auth-muted: #69645b;
  --auth-gold: #b58a31;
  --auth-gold-dark: #8e671c;
  --auth-border: #d9d4cb;
  --auth-surface: #ffffff;
  --auth-panel: #f3f1ed;
  --auth-error: #b42318;
  --auth-success: #18704b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Inter", "Segoe UI Variable", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--auth-black);
  background: var(--auth-panel);
  letter-spacing: 0;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 55fr) minmax(460px, 45fr);
  min-height: 100dvh;
}

.auth-visual {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100dvh;
  overflow: hidden;
  background: #090909 url("/assets/login-workshop.webp") center center / cover no-repeat;
}

.auth-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 6, 6, 0.02) 0%, rgba(6, 6, 6, 0.08) 55%, rgba(6, 6, 6, 0.46) 100%),
    linear-gradient(180deg, rgba(6, 6, 6, 0.18) 12%, rgba(6, 6, 6, 0.38) 58%, rgba(6, 6, 6, 0.86) 100%);
}

.auth-visual-content {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100% - 128px));
  margin: 0 64px 88px;
  color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.auth-visual h1 {
  margin: 0;
  color: #c7aa67;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0;
}

.auth-visual-content > p:last-child {
  max-width: 460px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.94rem;
  font-weight: 400;
  line-height: 1.6;
}

.auth-subtitle-line {
  display: block;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 100dvh;
  padding: 36px clamp(28px, 4vw, 72px) 24px;
  background: var(--auth-panel);
}

.auth-card {
  width: min(100%, 430px);
  padding: 32px 38px 30px;
  background: var(--auth-surface);
  border: 1px solid rgba(21, 21, 21, 0.08);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(28, 25, 20, 0.12);
}

.auth-card-recovery {
  width: min(100%, 460px);
}

.auth-card-header {
  text-align: center;
}

.auth-logo {
  display: block;
  width: 114px;
  height: 114px;
  margin: 0 auto 18px;
  object-fit: cover;
  border: 1px solid #c49b45;
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(18, 18, 18, 0.15);
}

.auth-card-header h2 {
  margin: 0;
  font-size: 1.62rem;
  line-height: 1.2;
}

.auth-card-header p {
  margin: 8px 0 0;
  color: var(--auth-muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.auth-form {
  margin-top: 26px;
}

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

.auth-field label {
  display: block;
  margin-bottom: 7px;
  color: #302d28;
  font-size: 0.84rem;
  font-weight: 700;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 46px;
  background: #ffffff;
  border: 1px solid var(--auth-border);
  border-radius: 6px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.auth-input-wrap:focus-within {
  border-color: var(--auth-gold);
  box-shadow: 0 0 0 3px rgba(181, 138, 49, 0.16);
}

.auth-input-wrap.has-error {
  border-color: var(--auth-error);
}

.auth-input-wrap > img {
  width: 18px;
  height: 18px;
  margin-left: 14px;
  opacity: 0.68;
}

.auth-input-wrap input {
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0 13px;
  color: var(--auth-black);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 0.95rem;
}

.password-toggle {
  position: relative;
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  color: #4b4740;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: #f2efe9;
  outline: 0;
}

.password-toggle img {
  width: 18px;
  height: 18px;
}

.password-toggle.is-visible::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 1.5px;
  background: currentColor;
  transform: rotate(-45deg);
}

.field-error,
.caps-warning {
  min-height: 0;
  margin: 5px 0 0;
  font-size: 0.77rem;
  line-height: 1.35;
}

.field-error:empty {
  display: none;
}

.field-error {
  color: var(--auth-error);
}

.caps-warning {
  color: var(--auth-gold-dark);
}

.password-policy {
  margin: 10px 0 0;
  color: var(--auth-muted);
  font-size: 0.77rem;
  line-height: 1.4;
}

.auth-alert {
  margin-bottom: 16px;
  padding: 10px 12px;
  color: #8d2018;
  background: #fff2f0;
  border: 1px solid #efc4be;
  border-radius: 6px;
  font-size: 0.83rem;
  line-height: 1.4;
}

.turnstile-block {
  margin-top: 18px;
}

.turnstile-widget {
  width: 100%;
  min-height: 65px;
}

.turnstile-widget:empty {
  display: grid;
  place-items: center;
  background: #f7f6f3;
  border: 1px solid var(--auth-border);
  border-radius: 6px;
}

.turnstile-widget:empty::before {
  content: "Carregando verificação de segurança...";
  color: var(--auth-muted);
  font-size: 0.78rem;
}

.turnstile-block.is-disabled {
  display: none;
}

.auth-submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  margin-top: 18px;
  padding: 0 20px;
  color: #ffffff;
  background: linear-gradient(110deg, #96701f 0%, #c69a3b 52%, #9c7420 100%);
  border: 1px solid #9f7724;
  border-radius: 6px;
  box-shadow: 0 7px 18px rgba(130, 91, 17, 0.2);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, filter 150ms ease, box-shadow 150ms ease;
}

.auth-submit:hover:not(:disabled) {
  filter: brightness(1.05);
  box-shadow: 0 9px 22px rgba(130, 91, 17, 0.25);
  transform: translateY(-1px);
}

.auth-submit:focus-visible {
  outline: 3px solid rgba(181, 138, 49, 0.3);
  outline-offset: 2px;
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.78;
}

.button-spinner {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: auth-spin 700ms linear infinite;
}

.auth-submit.is-loading .button-label {
  visibility: hidden;
}

.auth-submit.is-loading .button-spinner {
  position: absolute;
  display: block;
}

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

.auth-link {
  display: block;
  width: max-content;
  margin: 17px auto 0;
  color: #765517;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.auth-link:hover,
.auth-link:focus-visible {
  color: var(--auth-black);
  text-decoration: underline;
}

.auth-link-back {
  display: flex;
  gap: 7px;
  align-items: center;
}

.auth-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px 10px;
  width: min(100%, 520px);
  margin-top: 24px;
  color: #777168;
  font-size: 0.7rem;
  line-height: 1.35;
  text-align: center;
}

.auth-footer strong {
  width: 100%;
  color: #4f4a43;
}

.auth-success {
  padding: 12px 0 2px;
  text-align: center;
}

.success-icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  place-items: center;
  color: var(--auth-success);
  background: #e7f5ed;
  border: 1px solid #a9ddc1;
  border-radius: 50%;
  font-size: 1.35rem;
  font-weight: 700;
}

.auth-success h3 {
  margin: 0;
  font-size: 1.2rem;
}

.auth-success p {
  margin: 10px 0 0;
  color: var(--auth-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.auth-success.is-invalid .success-icon {
  color: var(--auth-error);
  background: #fff2f0;
  border-color: #efc4be;
}

.auth-submit-link {
  margin-top: 22px;
}

@media (max-width: 820px) {
  .auth-layout {
    display: block;
    min-height: 100dvh;
  }

  .auth-visual {
    display: none;
  }

  .auth-panel {
    justify-content: center;
    min-height: 100dvh;
    padding: 24px 18px 18px;
  }

  .auth-card,
  .auth-card-recovery {
    width: min(100%, 480px);
    padding: 28px 26px 26px;
  }
}

@media (max-width: 430px) {
  .auth-panel {
    padding: 14px 10px 12px;
  }

  .auth-card,
  .auth-card-recovery {
    width: 100%;
    padding: 24px 18px 22px;
    box-shadow: 0 10px 30px rgba(28, 25, 20, 0.1);
  }

  .auth-logo {
    width: 96px;
    height: 96px;
    margin-bottom: 15px;
  }

  .auth-form {
    margin-top: 22px;
  }

  .auth-footer {
    margin-top: 16px;
  }
}

@media (max-height: 720px) and (min-width: 821px) {
  .auth-panel {
    justify-content: flex-start;
    overflow-y: auto;
    padding-top: 22px;
  }

  .auth-card {
    padding-top: 24px;
    padding-bottom: 22px;
  }

  .auth-logo {
    width: 90px;
    height: 90px;
    margin-bottom: 12px;
  }

  .auth-form {
    margin-top: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
