.auth-body {
  min-height: 100vh;
  background: radial-gradient(circle at top right, rgba(47, 155, 138, 0.12), transparent 34%), #f4f7f6;
}

.auth-main {
  padding: 56px 0 80px;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 48px;
  align-items: start;
}

.auth-intro h1 {
  margin: 8px 0 18px;
  font-size: clamp(2.3rem, 7vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.auth-intro > p {
  max-width: 640px;
  color: #536468;
  font-size: 1.04rem;
  line-height: 1.7;
}

.auth-note {
  margin-top: 26px;
  padding: 18px 20px;
  border: 1px solid #cbd8d5;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  display: grid;
  gap: 6px;
}

.auth-note span {
  color: #536468;
  line-height: 1.55;
}

.auth-card {
  background: #fff;
  border: 1px solid #d8e1df;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(24, 53, 56, 0.10);
  padding: 28px;
}

.auth-state {
  padding: 28px 8px;
  text-align: center;
  color: #5c6d70;
}

.firebase-auth-panel > h2 {
  margin: 0 0 10px;
  font-size: 1.65rem;
}

.firebase-auth-panel {
  padding-bottom: 6px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  margin-bottom: 24px;
  border-radius: 16px;
  background: #edf3f1;
}

.firebase-tabs {
  margin-top: 18px;
}

.auth-tab {
  border: 0;
  border-radius: 12px;
  background: transparent;
  padding: 12px 16px;
  font: inherit;
  font-weight: 700;
  color: #4f6265;
  cursor: pointer;
}

.auth-tab.active {
  background: #fff;
  color: #132a2e;
  box-shadow: 0 2px 10px rgba(20, 49, 52, 0.08);
}

.auth-form h2,
.auth-panel h2,
.access-key-panel h2,
.firebase-verification h2 {
  margin: 0 0 10px;
  font-size: 1.65rem;
}

.auth-help {
  margin: 0 0 22px;
  color: #66777a;
  line-height: 1.55;
}

.auth-help-compact {
  margin-top: -4px;
  margin-bottom: 12px;
  font-size: 0.92rem;
}

.auth-form label {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  font-weight: 700;
  color: #263d41;
}

.auth-form input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd7d5;
  border-radius: 13px;
  background: #fbfdfc;
  padding: 13px 14px;
  font: inherit;
  color: #132a2e;
  outline: none;
}

.auth-form input:focus {
  border-color: #2f8f7e;
  box-shadow: 0 0 0 3px rgba(47, 143, 126, 0.13);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 52px;
}

.password-eye-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 40px;
  height: 40px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #526669;
  cursor: pointer;
}

.password-eye-toggle:hover {
  background: #edf3f1;
  color: #173336;
}

.password-eye-toggle:focus-visible {
  outline: 2px solid #2f8f7e;
  outline-offset: 1px;
}

.password-eye {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-eye-open {
  display: none;
}

.password-eye-toggle[aria-pressed="true"] .password-eye-open {
  display: block;
}

.password-eye-toggle[aria-pressed="true"] .password-eye-off {
  display: none;
}

.turnstile-slot {
  min-height: 66px;
  margin: 6px 0 14px;
}

.form-message {
  min-height: 1.4em;
  margin: 6px 0 12px;
  color: #526669;
  line-height: 1.45;
}

.form-message.error {
  color: #a52d2d;
}

.form-message.success {
  color: #20725f;
}

.auth-submit {
  width: 100%;
  justify-content: center;
  border: 0;
  cursor: pointer;
}

.auth-submit:disabled,
.secondary-btn:disabled,
.auth-text-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.auth-text-btn {
  border: 0;
  background: transparent;
  padding: 2px 0;
  font: inherit;
  font-weight: 700;
  color: #247667;
  cursor: pointer;
  text-align: left;
}

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

.auth-back {
  color: #536568;
  text-decoration: none;
  font-weight: 700;
}

.auth-back:hover {
  color: #132a2e;
}

.secondary-btn {
  border: 1px solid #c7d4d2;
  border-radius: 12px;
  background: #fff;
  padding: 11px 15px;
  font: inherit;
  font-weight: 700;
  color: #243d40;
  cursor: pointer;
}

.account-details {
  display: grid;
  gap: 10px;
  margin: 24px 0;
}

.account-details div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid #e4ecea;
}

.account-details dt {
  color: #6a797b;
}

.account-details dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
  color: #173336;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.firebase-verification {
  padding-top: 6px;
}

.firebase-verification > p {
  color: #596c6f;
  line-height: 1.55;
}

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

.legacy-auth {
  margin-top: 28px;
  border-top: 1px solid #dce6e3;
  padding-top: 18px;
}

.legacy-auth summary {
  cursor: pointer;
  font-weight: 800;
  color: #536568;
}

.legacy-auth-body {
  padding-top: 20px;
}

.access-key-panel p {
  color: #596c6f;
  line-height: 1.55;
}

.access-key-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
  margin: 18px 0 8px;
}

.access-key-row code {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow-wrap: anywhere;
  border: 1px solid #cbd8d5;
  border-radius: 13px;
  background: #f4f8f7;
  padding: 12px 14px;
  font-size: 0.92rem;
  font-weight: 800;
  color: #132a2e;
}

@media (max-width: 820px) {
  .auth-main {
    padding: 34px 0 56px;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .auth-card {
    padding: 20px;
    border-radius: 20px;
  }

  .auth-back {
    font-size: 0.9rem;
  }

  .access-key-row {
    grid-template-columns: 1fr;
  }
}
