:root {
  font-synthesis: none;
  --auth-control-height: 48px;
}

body.auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 16px;
  background: #111111;
  color: var(--ink);
  margin: 0;
  gap: 32px;
}

.auth-shell {
  width: min(480px, 100%);
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 34px;
}

.auth-shell__brand {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: -10px;
}

.auth-shell__brand .brand--auth {
  padding: 6px 16px;
}

.auth-shell__brand .brand-word {
  font-size: 1.25rem;
}

.auth-panel {
  width: 100%;
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  isolation: isolate;
  overflow: hidden;
}

.brand--auth {
  text-decoration: none;
  color: inherit;
  align-self: center;
  justify-content: center;
}

.brand--auth:focus-visible {
  outline: 2px solid #a5b4fc;
  outline-offset: 4px;
}

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

.auth-header h1 {
  margin: 4px 0;
  font-size: 1.9rem;
  letter-spacing: -0.01em;
}

.auth-header p {
  margin: 0;
  color: var(--muted);
}

.auth-tabs {
  display: flex;
  gap: 18px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}

.auth-tabs.is-hidden {
  display: none;
}

.auth-tabs__btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 10px 0;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}

.auth-tabs__btn::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 2px;
  border-radius: 999px;
  background: transparent;
  transition: background 0.2s ease;
}

.auth-tabs__btn.is-active {
  color: var(--ink);
}

.auth-tabs__btn.is-active::after {
  background: var(--ink);
}

.auth-tabs__btn:focus-visible {
  outline: 2px solid #a5b4fc;
  outline-offset: 2px;
}

.auth-view {
  display: none;
  flex-direction: column;
  gap: 18px;
}

.auth-view.is-active {
  display: flex;
}

.auth-view h2 {
  margin: 0;
  font-size: 1.1rem;
}

.auth-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.auth-hint span {
  color: var(--ink);
  font-weight: 600;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.auth-field label {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.auth-input {
  width: 100%;
  padding: 12px 14px;
  height: calc(var(--auth-control-height, 48px) - 6px);
  border-radius: var(--input-radius, 8px);
  border: 1px solid var(--border);
  background: var(--input-surface, #0e0f12);
  color: var(--ink);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-inline{
  display:flex;
  gap:10px;
  align-items:center;
}

.auth-inline .auth-input{
  flex:1;
  min-width:0;
}

.auth-inline .auth-submit{
  flex:0 0 auto;
  height:calc(var(--auth-control-height, 48px) - 6px);
}

.auth-submit {
  height: var(--auth-control-height, 48px);
  padding: 0 18px;
  text-transform: none;
  min-width: 112px;
}

.status.auth-status {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  line-height: 1.4;
}

.status.auth-status.success {
  color: var(--accent-success);
}

.status.auth-status.error {
  color: var(--accent-danger);
}

.auth-footer {
  width: min(480px, 100%);
  margin-top: auto;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.auth-footer__link {
  color: inherit;
  text-decoration: none;
}

.auth-footer__link:hover {
  text-decoration: underline;
}

@media (max-width: 520px) {
  .auth-panel {
    padding: 28px 24px;
  }

  .auth-tabs {
    gap: 12px;
  }

  .auth-tabs__btn {
    padding: 8px 0;
  }

  .auth-inline{
    flex-direction:column;
    align-items:stretch;
  }

  .auth-inline .auth-submit{
    width:100%;
  }

  .auth-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
  }
}
