:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #101828;
  background: #f4f6f9;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(#ffffffb8, #ffffffb8),
    repeating-linear-gradient(90deg, transparent 0, transparent 79px, #e9edf3 80px),
    #f4f6f9;
}

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

button {
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.auth-card {
  width: min(100%, 480px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(16, 24, 40, 0.1);
  padding: 28px;
}

.auth-header {
  margin-bottom: 22px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.brand-name {
  font-size: 17px;
  font-weight: 750;
}

h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.35;
}

.auth-header p {
  margin: 7px 0 0;
  color: #667085;
  font-size: 14px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 20px;
  border-bottom: 1px solid #e4e7ec;
}

.mode-tabs button {
  position: relative;
  height: 42px;
  border: 0;
  background: transparent;
  color: #667085;
  font-size: 14px;
  font-weight: 650;
}

.mode-tabs button[aria-selected="true"] {
  color: #2563eb;
}

.mode-tabs button[aria-selected="true"]::after {
  content: "";
  position: absolute;
  right: 20%;
  bottom: -1px;
  left: 20%;
  height: 2px;
  background: #2563eb;
}

form,
#loginFields,
#registerFields,
.enterprise-fields {
  display: grid;
  gap: 16px;
}

[hidden] {
  display: none !important;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  border-radius: 6px;
  background: #f2f4f7;
  padding: 3px;
}

.segmented-control button {
  min-height: 34px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #667085;
  font-size: 13px;
  font-weight: 650;
}

.segmented-control button[aria-pressed="true"] {
  background: #fff;
  color: #2563eb;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12);
}

.field-group {
  display: grid;
  gap: 7px;
}

.field-group-label,
.field > span:first-child {
  color: #344054;
  font-size: 13px;
  font-weight: 650;
}

.field {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.field small {
  color: #98a2b3;
  font-weight: 400;
}

.field input {
  width: 100%;
  height: 40px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  background: #fff;
  color: #101828;
  padding: 0 12px;
  outline: 0;
}

.field input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.11);
}

.field input[aria-invalid="true"] {
  border-color: #f04438;
}

.inline-input,
.password-input {
  position: relative;
  display: flex;
  gap: 8px;
}

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

.secondary-button {
  width: 112px;
  flex: 0 0 112px;
  border: 1px solid #bfd3ff;
  border-radius: 6px;
  background: #f5f8ff;
  color: #2563eb;
  font-size: 13px;
  font-weight: 650;
}

.password-input input {
  padding-right: 58px;
}

.password-input button {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 52px;
  height: 38px;
  border: 0;
  background: transparent;
  color: #667085;
  font-size: 12px;
}

.two-column-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.auth-message {
  margin-bottom: 16px;
  border: 1px solid #fecdca;
  border-radius: 6px;
  background: #fef3f2;
  color: #b42318;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.55;
}

.auth-message.success {
  border-color: #abefc6;
  background: #ecfdf3;
  color: #067647;
}

.auth-message.notice {
  border-color: #fedf89;
  background: #fffaeb;
  color: #93370d;
}

.field-feedback {
  font-size: 12px;
}

.field-feedback.success {
  color: #079455;
}

.field-feedback.error {
  color: #d92d20;
}

.primary-button {
  width: 100%;
  height: 42px;
  margin-top: 2px;
  border: 1px solid #2563eb;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.primary-button:hover:not(:disabled) {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

.auth-footer {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 20px;
  color: #667085;
  font-size: 13px;
}

.auth-footer button {
  border: 0;
  background: transparent;
  color: #2563eb;
  padding: 0;
  font-weight: 650;
}

@media (max-width: 540px) {
  .auth-shell {
    align-items: start;
    padding: 0;
  }

  .auth-card {
    width: 100%;
    min-height: 100vh;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 24px 18px;
  }

  .two-column-fields {
    grid-template-columns: 1fr;
  }
}
