:root {
  color: #111111;
  background: #ffffff;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: #ffffff;
}

body.auth-locked {
  overflow: hidden;
}

button,
a {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: block;
  min-height: 100vh;
  background: #ffffff;
}

.main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  background: #ffffff;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 54px;
  padding: 10px 24px;
}

.auth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.auth-button.sign-in {
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
}

.auth-button.sign-up {
  border: 1px solid #111827;
  background: #111827;
  color: #ffffff;
}

.auth-button:hover,
.auth-button:focus-visible {
  outline: none;
  filter: brightness(0.97);
}

.empty-main {
  flex: 1;
  background: #ffffff;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(17, 24, 39, 0);
  opacity: 0;
  pointer-events: none;
  transition:
    background 360ms ease,
    opacity 360ms ease;
}

.auth-overlay.is-open,
.auth-overlay.is-closing {
  pointer-events: auto;
}

.auth-overlay.is-open {
  background: rgba(17, 24, 39, 0.48);
  opacity: 1;
}

.auth-overlay.is-closing {
  background: rgba(17, 24, 39, 0);
  opacity: 0;
}

.auth-dialog {
  position: relative;
  display: grid;
  width: min(460px, calc(100vw - 36px));
  max-height: calc(100dvh - 36px);
  gap: 22px;
  justify-items: center;
  overflow: visible;
  padding: 52px 34px 28px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 26px 76px rgba(15, 23, 42, 0.3);
  opacity: 0;
  transform: translate(30vw, -32vh) scale(0.18);
  transform-origin: calc(100% - 22px) 22px;
  transition:
    opacity 420ms ease,
    transform 520ms cubic-bezier(0.18, 0.86, 0.24, 1);
}

.auth-overlay.is-open .auth-dialog {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

.auth-overlay.is-closing .auth-dialog {
  opacity: 0;
  transform: translate(30vw, -32vh) scale(0.18);
}

.auth-dialog:focus {
  outline: none;
}

.auth-close-button {
  position: absolute;
  top: -15px;
  right: -15px;
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
  color: #111111;
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18);
}

.auth-close-button:hover,
.auth-close-button:focus-visible {
  border-color: #9ca3af;
  background: #ffffff;
  outline: none;
}

.brand-title {
  margin: 0;
  color: #000000;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.14;
  text-align: center;
}

.login-actions {
  display: grid;
  width: 100%;
  gap: 14px;
}

.password-login-form {
  display: grid;
  width: 100%;
  gap: 10px;
}

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

.field-label {
  color: #374151;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.2;
}

.login-input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  font-size: 0.98rem;
  outline: none;
}

.login-input:focus {
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

.login-submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 46px;
  margin-top: 4px;
  border: 1px solid #111827;
  border-radius: 8px;
  background: #111827;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 500;
}

.login-submit-button:hover,
.login-submit-button:focus-visible {
  background: #030712;
  outline: none;
}

.signup-note {
  width: 100%;
  margin: -2px 0 2px;
  color: #6b7280;
  font-size: 0.82rem;
  line-height: 1.4;
}

.login-divider {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  color: #6b7280;
}

.login-divider span {
  display: block;
  height: 1px;
  background: #e5e7eb;
}

.login-divider strong {
  font-size: 0.84rem;
  font-weight: 500;
}

.login-button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  color: #262626;
  text-align: center;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
}

.login-button:hover,
.login-button:focus-visible {
  border-color: #cbd5e1;
  background: #fafafa;
  outline: none;
}

.provider-mark {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  justify-self: center;
  color: #4285f4;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
}

.login-terms {
  margin: 0;
  color: #666666;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.9rem;
  line-height: 1.6;
  text-align: center;
}

.login-terms a {
  color: #222222;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .auth-overlay,
  .auth-dialog {
    transition: none;
  }
}

@media (max-width: 640px) {
  .topbar {
    min-height: 50px;
    padding: 8px 14px;
  }

  .auth-button {
    min-width: 78px;
    height: 32px;
    padding: 0 12px;
    font-size: 0.84rem;
  }

  .auth-overlay {
    padding: 16px;
  }

  .auth-dialog {
    gap: 20px;
    padding: 52px 20px 28px;
    border-radius: 14px;
  }

  .brand-title {
    font-size: 1.8rem;
  }

  .login-actions {
    gap: 12px;
  }

  .login-button {
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 1rem;
  }

  .provider-mark {
    width: 28px;
    height: 28px;
    font-size: 1.08rem;
  }

  .login-terms {
    font-size: 0.95rem;
  }
}
