.auth-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 76px);
  padding: 40px 20px 60px;
}

.auth-card {
  width: min(640px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.auth-head .eyebrow,
.auth-account__head .eyebrow {
  color: var(--brand-strong);
}

.auth-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.auth-head h1 {
  margin: 2px 0 0;
  font-size: 1.5rem;
  letter-spacing: -0.035em;
}

.auth-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 22px;
}

.auth-tab {
  padding: 10px 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.auth-tab:hover {
  color: var(--ink);
  background: #f7f9fc;
}

.auth-tab.is-active {
  color: var(--brand-strong);
  border-color: #c6d8f0;
  background: var(--brand-soft);
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-section {
  display: grid;
  gap: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.auth-section h2 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.auth-fieldset {
  display: grid;
  gap: 14px;
  margin: 4px 0 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f9fbfd;
}

.auth-consent {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fbfd;
}

.auth-consent strong {
  font-size: 0.86rem;
}

.auth-consent p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.auth-fieldset legend {
  padding: 0 6px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.auth-grid__full {
  grid-column: 1 / -1;
}

.field > span,
.field > label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.req {
  color: #b42318;
  font-style: normal;
}

.auth-input {
  position: relative;
  display: flex;
}

.auth-input input {
  padding-right: 92px;
}

.auth-input__action {
  position: absolute;
  top: 50%;
  right: 7px;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  color: var(--brand-strong);
  background: transparent;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.auth-input__action:hover {
  background: var(--brand-soft);
}

.auth-input__action:disabled {
  opacity: 0.55;
  cursor: progress;
}

.cep-feedback {
  min-height: 1.1em;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.cep-feedback.is-error {
  color: #b42318;
}

.auth-fieldset.is-busy input,
.auth-fieldset.is-busy select,
.field.is-locked input,
.field.is-locked select {
  background-color: #eef2f7;
  color: var(--muted);
  cursor: not-allowed;
}

.auth-input__action:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.auth-form__links {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}

.auth-link {
  padding: 0;
  border: 0;
  color: var(--brand-strong);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.auth-link:hover {
  color: var(--brand);
}

.auth-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.auth-message {
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid #bfe9d5;
  border-radius: 10px;
  color: #0b6b42;
  background: var(--green-soft);
  font-size: 0.9rem;
}

.auth-message.is-error {
  border-color: #f3c6c6;
  color: #8e2020;
  background: var(--red-soft);
}

.auth-account {
  display: grid;
  gap: 20px;
}

.auth-account__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.auth-account__head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.auth-account__head-actions form {
  margin: 0;
}

.auth-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.auth-back-link {
  display: inline-block;
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.auth-back-link:hover {
  color: var(--brand);
  text-decoration: underline;
}

.auth-account__identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.auth-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(140deg, var(--brand), var(--brand-strong));
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-account__head h2 {
  margin: 2px 0 0;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.auth-account__info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.auth-account__info div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f9fbfd;
}

.auth-account__info dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-account__info dd {
  margin: 4px 0 0;
  font-size: 0.86rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.auth-account__section {
  display: grid;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.auth-account__section h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

@media (max-width: 700px) {
  .auth-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-account__info {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .auth-grid__full {
    grid-column: auto;
  }

  .auth-account__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-account__head-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 24px 20px;
  }

  .auth-head .brand-mark {
    display: none;
  }
}

.auth-tabs a {
  text-align: center;
  text-decoration: none;
}
.auth-account__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-history {
  display: grid;
  gap: 8px;
}

.auth-history__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f9fbfd;
}

.auth-history__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.auth-history__main strong {
  font-size: 0.88rem;
}

.auth-history__main span {
  color: var(--muted);
  font-size: 0.76rem;
}

.auth-history__score {
  font-size: 0.92rem;
  font-weight: 800;
}

.auth-history__score.is-good {
  color: var(--green);
}

.auth-history__score.is-warn {
  color: #9a6b00;
}

.auth-history__score.is-bad {
  color: #a52828;
}

.auth-history__detail {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.75rem;
}

.preset-counter {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.preset-block {
  display: grid;
  gap: 8px;
}

.preset-block h4,
.preset-form h4 {
  margin: 0;
  font-size: 0.86rem;
  letter-spacing: -0.01em;
}

.preset-list {
  display: grid;
  gap: 8px;
}

.preset-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f9fbfd;
}

.preset-item__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.preset-item__text strong {
  font-size: 0.86rem;
}

.preset-item__text span {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.preset-item form {
  margin: 0;
}

.preset-form {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f9fbfd;
}

@media (max-width: 520px) {
  .preset-item {
    align-items: flex-start;
    flex-direction: column;
  }
}