.auth-chip {
  opacity: 0.92;
  cursor: pointer;
}

.auth-modal[hidden] {
  display: none;
}

.auth-modal [hidden] {
  display: none !important;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 12, 20, 0.72);
  backdrop-filter: blur(4px);
}

.auth-dialog {
  position: relative;
  width: min(640px, calc(100% - 1.2rem));
  margin: 5vh auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(9, 16, 26, 0.98), rgba(16, 27, 42, 0.98));
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.38);
  overflow: hidden;
}

.auth-head,
.auth-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-foot {
  border-bottom: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  justify-content: flex-end;
}

.auth-kicker {
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-head h2 {
  margin: 0.2rem 0 0;
  font-family: "Sora", sans-serif;
  font-size: 1.35rem;
}

.auth-close {
  border: 0;
  background: transparent;
  color: var(--ink-0);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.auth-body {
  display: grid;
  gap: 1rem;
  padding: 1rem 1.1rem 1.2rem;
}

.auth-state {
  color: var(--ink-0);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.auth-message {
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-0);
}

.auth-message.ok {
  border-color: rgba(62, 232, 181, 0.32);
  background: rgba(62, 232, 181, 0.12);
}

.auth-message.err {
  border-color: rgba(255, 120, 120, 0.32);
  background: rgba(255, 120, 120, 0.12);
}

.auth-section {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 0.95rem;
  background: linear-gradient(160deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.auth-section-connected {
  border-color: rgba(62, 232, 181, 0.22);
}

.auth-section-head h3 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 1rem;
}

.auth-section-head p {
  margin: 0.35rem 0 0;
  color: var(--ink-1);
  font-size: 0.92rem;
}

.auth-form {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.85rem;
}

.auth-field {
  display: grid;
  gap: 0.35rem;
}

.auth-field span {
  color: var(--ink-1);
  font-size: 0.88rem;
}

.auth-field input {
  width: 100%;
  padding: 0.78rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(7, 15, 25, 0.9);
  color: var(--ink-0);
  font: inherit;
  cursor: text;
}

.auth-field input:focus {
  outline: 0;
  border-color: rgba(126, 214, 255, 0.48);
  box-shadow: 0 0 0 3px rgba(126, 214, 255, 0.14);
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.auth-dialog .primary-btn,
.auth-dialog .secondary-btn,
.auth-dialog .ghost-btn {
  appearance: none;
  border-radius: 999px;
  padding: 0.7rem 1.05rem;
  font: inherit;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  transition: 150ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.auth-dialog .primary-btn {
  border: 0;
  color: #062018;
  background: linear-gradient(120deg, var(--accent), #6af7d0);
}

.auth-dialog .secondary-btn,
.auth-dialog .ghost-btn {
  color: var(--ink-0);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.auth-dialog .primary-btn:hover,
.auth-dialog .secondary-btn:hover,
.auth-dialog .ghost-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

#auth-trigger-btn {
  appearance: none;
  font-family: inherit;
  line-height: inherit;
}

.auth-dialog button,
#auth-trigger-btn,
#auth-session-chip {
  cursor: pointer;
}

.auth-dialog button:disabled {
  cursor: not-allowed;
}

.auth-wallet-box,
.auth-google-wrap {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.85rem;
}

.auth-wallet-status,
.auth-google-note {
  color: var(--ink-1);
  font-size: 0.92rem;
  min-height: 1.35rem;
}

.auth-google-stack {
  position: relative;
  display: inline-block;
  width: min(100%, 320px);
  min-height: 44px;
}

.auth-google-trigger {
  width: 100%;
  min-height: 44px;
  justify-content: center;
  pointer-events: none;
}

.auth-google-button {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0.015;
  overflow: hidden;
}

.auth-google-button > div,
.auth-google-button iframe {
  width: 100% !important;
  height: 100% !important;
}

.auth-disabled-btn {
  opacity: 0.72;
}

.auth-modal-authenticated .auth-body {
  gap: 0.85rem;
}

.auth-modal-authenticated .auth-state {
  margin-bottom: -0.1rem;
}

@media (max-width: 720px) {
  .auth-dialog {
    margin: 2vh auto;
  }

  .auth-actions {
    flex-direction: column;
  }

  .auth-actions .primary-btn,
  .auth-actions .secondary-btn,
  .auth-wallet-box .primary-btn,
  .auth-google-stack .primary-btn,
  .auth-foot .ghost-btn {
    width: 100%;
    text-align: center;
  }
}
