html,
body {
  height: auto;
  overflow-y: auto;
  overscroll-behavior: auto;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  color: var(--text-primary);
  margin: 0;
  padding: 20px 16px;
  box-sizing: border-box;
  font-family: var(--font-sans);
}

.auth-card {
  width: 100%;
  max-width: 540px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  box-shadow: var(--shadow-md);
  box-sizing: border-box;
  text-align: center;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  text-decoration: none;
  color: inherit;
}

.auth-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 6px 0;
  color: var(--text-primary);
}

.auth-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.48;
  margin: 0 0 20px 0;
}

.auth-alert-error {
  background: var(--status-red-bg);
  border: 1px solid var(--status-red-border);
  color: var(--status-red);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 0.8125rem;
  text-align: left;
}

.auth-alert-info {
  background: var(--brand-primary-bg);
  border: 1px solid var(--brand-primary-border);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.8rem;
  text-align: left;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 11px 16px;
  background: var(--google-btn-bg);
  color: var(--google-btn-text);
  border: 1px solid var(--google-btn-border);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--google-btn-shadow);
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease;
  box-sizing: border-box;
}

.btn-google:hover {
  background: var(--google-btn-bg-hover);
  box-shadow: var(--google-btn-shadow-hover);
}

.btn-sandbox-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-canvas);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.btn-sandbox-cta:hover {
  border-color: var(--brand-primary);
  background: var(--bg-surface-elevated);
}

.btn-local-dev {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: var(--brand-primary-bg);
  color: var(--brand-primary);
  border: 1px solid var(--brand-primary-border);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
}

.login-demo-section {
  margin: 18px 0;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  text-align: left;
}

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

@media (max-width: 520px) {
  .auth-card {
    padding: 22px 16px;
  }
  .login-demo-grid {
    grid-template-columns: 1fr;
  }
}

.login-demo-card {
  text-decoration: none;
  background: var(--brand-primary-bg);
  border: 1px solid var(--brand-primary-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.login-demo-card:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--brand-primary);
}

.auth-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.auth-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

.auth-links a:hover {
  color: var(--brand-primary);
  text-decoration: underline;
}


/* Login and Beta Gate page additions */
.auth-brand img {
  border-radius: var(--radius-sm);
  display: block;
}

.auth-brand span {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.auth-alert-invite-title {
  color: var(--brand-primary);
}

.auth-invite-form {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-invite-input {
  width: 100%;
  box-sizing: border-box;
}

.auth-btn-join {
  background: var(--brand-primary);
  color: var(--text-on-brand);
  border-color: var(--brand-primary);
  font-size: 0.88rem;
  padding: 10px 14px;
}

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

.btn-sandbox-resume {
  border-color: var(--status-green-border);
  background: var(--status-green-bg);
}

.auth-sandbox-clean-slate {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.auth-link-highlight {
  color: var(--brand-primary);
  font-weight: 600;
  text-decoration: underline;
}

.auth-local-dev-form {
  margin: 0;
}

.login-demo-header {
  text-align: center;
}

.login-demo-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.login-demo-sub {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

.login-demo-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.login-demo-card-title {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--brand-primary);
}

.login-demo-card-icon {
  color: var(--brand-primary);
  flex-shrink: 0;
}

.login-demo-card-sub {
  color: var(--text-primary);
  font-size: 0.73rem;
  font-weight: 600;
}

.login-demo-card-desc {
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.auth-terms {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.45;
}

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

.auth-version {
  font-family: var(--font-mono);
}

.gate-card {
  max-width: 440px;
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-md);
  box-sizing: border-box;
  text-align: center;
}

.gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: var(--radius-badge);
  background: var(--color-amber-bg);
  color: var(--color-amber);
  border: 1px solid var(--color-amber-border);
  margin-bottom: 16px;
}

.gate-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 10px 0;
}

.gate-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0 0 24px 0;
}

.btn-gate-signin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 16px;
  background: var(--brand-primary);
  color: var(--text-on-brand);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: opacity 0.15s ease;
}

.btn-gate-signin:hover {
  opacity: 0.9;
}

.gate-return-link {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gate-return-link:hover {
  color: var(--text-secondary);
  text-decoration: underline;
}

.gate-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.gate-logo {
  border-radius: var(--radius-md);
  display: block;
}

.gate-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gate-version {
  margin-top: 24px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.asst-google-path-blue {
  fill: var(--google-blue);
}

.asst-google-path-green {
  fill: var(--google-green);
}

.asst-google-path-yellow {
  fill: var(--google-yellow);
}

.asst-google-path-red {
  fill: var(--google-red);
}
