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

:root {
  --green: #22a832;
  --blue-dark: #1a1f36;
  --radius-xl: 14px;
  --radius-pill: 999px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --account-slide-gap: 56px;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Pliant', system-ui, sans-serif;
  color: #1a1f36;
  min-height: 100vh;
}

button, input { font: inherit; }

[hidden] { display: none !important; }

.login-screen {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-x: clip;
  background:
    radial-gradient(circle at 12% 18%, rgba(34, 168, 50, 0.08), transparent 36%),
    radial-gradient(circle at 88% 82%, rgba(26, 31, 54, 0.04), transparent 34%),
    linear-gradient(145deg, #f8fafc 0%, #eef2f7 55%, #f4f6f9 100%);
}

.login-card {
  width: min(100%, 420px);
  max-width: 100%;
  min-width: 0;
  padding: 36px 32px;
  border-radius: var(--radius-xl);
  background: var(--blue-dark);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: clip;
  overflow-y: visible;
  isolation: isolate;
}

.login-logo {
  display: flex;
  justify-content: center;
  margin: 0 auto 24px;
}

.login-logo img { height: 44px; width: auto; }

.account-view-title {
  margin: 0 0 18px;
  text-align: left;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}

.account-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 0 18px;
}

.account-step {
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.account-step.active {
  color: #fff;
  background: rgba(34, 168, 50, 0.28);
  box-shadow: 0 0 0 1px rgba(34, 168, 50, 0.35);
}

.account-step.done {
  color: #d4f0d9;
  background: rgba(34, 168, 50, 0.16);
}

.account-step-num {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.12);
}

.account-step.active .account-step-num,
.account-step.done .account-step-num {
  background: #009812;
  color: #fff;
}

.account-step-label { line-height: 1; }

.account-step-line {
  flex: 1;
  height: 2px;
  min-width: 10px;
  margin: 0 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
}

.account-step-line.filled {
  background: linear-gradient(90deg, #22a832, #009812);
}

.account-pane {
  display: none;
  gap: 14px;
}

.account-pane.active {
  display: grid;
}

/* Slider de etapas (Continuar) — translate em px, clip no card */
.account-slider {
  display: block;
  overflow-x: clip;
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  touch-action: pan-y;
  transition: height 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.account-slider-track {
  display: flex;
  align-items: flex-start;
  width: 100%;
  min-width: 0;
  gap: var(--account-slide-gap);
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.account-slider .account-pane,
.account-slider .account-view {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: grid;
  gap: 14px;
  align-content: start;
  align-self: flex-start;
  pointer-events: none;
}

.account-slider .account-pane.is-active,
.account-slider .account-view.is-active {
  pointer-events: auto;
}

.login-card-slider {
  display: block;
  overflow-x: clip;
  overflow-y: visible;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  touch-action: pan-y;
}

.login-card-track {
  display: flex;
  align-items: flex-start;
  width: 100%;
  min-width: 0;
  gap: var(--account-slide-gap);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  /* ordem: register | login | forgot — posição inicial até o JS medir em px */
  transform: translate3d(calc(-100% - var(--account-slide-gap)), 0, 0);
}

html.account-view-register .login-card-track {
  transform: translate3d(0, 0, 0);
}

html.account-view-forgot .login-card-track {
  transform: translate3d(calc(-200% - 2 * var(--account-slide-gap)), 0, 0);
}

.login-card-track > .account-view {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: block;
  align-self: flex-start;
  pointer-events: none;
}

.login-card-track > .account-view.is-active {
  pointer-events: auto;
}

.login-form {
  display: grid;
  gap: 16px;
  width: 100%;
  min-width: 0;
  overflow-x: clip;
}

.login-card .input-container {
  --input-surface: var(--blue-dark);
}

.account-slider .account-pane {
  gap: 16px;
}

.form-error {
  margin: 0;
  font-size: 13px;
  color: #fca5a5;
}

.account-actions {
  display: grid;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
}

.btn-primary {
  background: #009812;
  color: #fff;
}

.btn-primary:hover:not(:disabled) { background: #007f10; }

.btn-primary:disabled {
  background: #a8d4ae;
  color: rgba(255, 255, 255, 0.85);
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.btn-block { width: 100%; }

.login-switch {
  display: block;
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.62);
  text-decoration: none;
}

.login-switch a,
.login-switch a:hover {
  color: #fff;
}

.login-switch a {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.login-forgot-wrap {
  margin: -6px 0 0;
  text-align: left;
}

.login-forgot {
  display: inline;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.login-forgot:hover {
  color: #fff;
}

a.login-forgot {
  color: rgba(255, 255, 255, 0.72);
}

.register-name-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  justify-self: start;
  padding: 7px 8px 7px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue-dark) 82%, var(--green) 18%);
  border: 1px solid rgba(34, 168, 50, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.register-name-chip-avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
}

.register-name-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.register-name-chip-edit {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  font-size: 17px;
  cursor: pointer;
}

.register-name-chip-edit:hover {
  background: rgba(34, 168, 50, 0.22);
  color: #fff;
}

@media (max-width: 480px) {
  .login-card { padding: 28px 22px; }

  .account-step-label {
    display: none;
  }

  .account-step {
    padding: 6px 8px;
  }
}
