:root {
  color-scheme: light;
  --ink: #333333;
  --ink-strong: #202020;
  --ink-soft: #777777;
  --ink-faint: #9e9e9e;
  --line: #e7e7e5;
  --line-strong: #ddddda;
  --canvas: #fafafa;
  --container: #ffffff;
  --surface-soft: #f4f4f2;
  --green: #2d8052;
  --red: #a84848;
  --red-soft: #faeceb;
  --focus: rgba(0, 119, 230, .24);
  --shadow: 0 12px 30px -24px rgba(34, 34, 31, .24);
}

* { box-sizing: border-box; }

html,
body { min-height: 100%; margin: 0; }

body {
  min-height: 100dvh;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
}

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

button,
a { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.auth-shell {
  display: grid;
  align-items: safe center;
  justify-items: center;
  min-height: 100dvh;
  padding: 48px 20px 32px;
}

.auth-stage {
  display: grid;
  justify-items: center;
  width: min(456px, 100%);
  gap: 48px;
}

.maestro-brand {
  position: relative;
  display: grid;
  place-items: center;
  width: 312px;
  height: 60px;
  overflow: visible;
}

.maestro-brand img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  user-select: none;
}

.maestro-brand::before {
  position: absolute;
  inset: 0;
  background: #e2e2df;
  content: "";
  filter:
    drop-shadow(-2px -2px 1px #ffffff)
    drop-shadow(1px 1px 0 rgba(105, 105, 100, .2))
    drop-shadow(3px 3px 2px rgba(74, 74, 70, .22));
  -webkit-mask: url("/assets/brand/maestro-lockup.png") center / contain no-repeat;
  mask: url("/assets/brand/maestro-lockup.png") center / contain no-repeat;
}

.maestro-brand::after {
  position: absolute;
  inset: 0;
  background: #ffffff;
  content: "";
  opacity: .28;
  transform: translate(-1px, -1px);
  -webkit-mask: url("/assets/brand/maestro-lockup.png") center / contain no-repeat;
  mask: url("/assets/brand/maestro-lockup.png") center / contain no-repeat;
}

.auth-card {
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  width: min(304px, 100%);
  margin: 0 auto 18px;
  padding: 2px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.auth-tab {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  transition: background .14s ease, color .14s ease, box-shadow .14s ease;
}

.auth-tab:hover { color: var(--ink-strong); }

.auth-tab.active {
  background: var(--container);
  color: var(--ink-strong);
  box-shadow: 0 1px 2px rgba(34, 34, 31, .08);
}

.auth-error {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  line-height: 17px;
}

.auth-form { display: grid; gap: 10px; }

.auth-form[hidden],
.google-actions[hidden],
.google-button[hidden],
[hidden] { display: none !important; }

.auth-form label { display: grid; gap: 6px; }

.auth-form label > span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
}

.auth-form input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--container);
  color: var(--ink-strong);
  font-size: 13px;
  transition: border-color .14s ease, box-shadow .14s ease;
}

.auth-form input::placeholder { color: var(--ink-faint); }

.auth-form input:hover { border-color: #ccccca; }

.auth-form input:focus {
  border-color: #a8a8a4;
  outline: 0;
  box-shadow: 0 0 0 3px var(--focus);
}

.auth-submit,
.auth-secondary,
.google-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.google-button { gap: 9px; }

.google-logo {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  object-fit: contain;
}

.auth-submit {
  margin-top: 2px;
  border: 1px solid #252523;
  background: #252523;
  color: #ffffff;
}

.auth-submit:hover { background: #363633; }

.auth-submit:active,
.auth-secondary:active,
.google-button:active { transform: scale(.985); }

.auth-submit:disabled { cursor: wait; opacity: .58; }

.auth-secondary,
.google-button {
  border: 1px solid var(--line-strong);
  background: var(--container);
  color: var(--ink-strong);
}

.auth-secondary:hover,
.google-button:hover { background: var(--surface-soft); }

.google-button.disabled,
.google-button.disabled:hover {
  border-color: var(--line);
  background: #f8f8f7;
  color: var(--ink-faint);
  cursor: not-allowed;
  transform: none;
}

.google-actions { margin: 0 0 18px; }

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 14px 0 0;
  color: var(--ink-faint);
  font-size: 11px;
}

.signup-divider { margin: 4px 0 2px; }

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  background: var(--line);
  content: "";
}

.auth-invite-note {
  margin: 0 0 12px;
  color: #5c5c57;
  font-size: 14px;
  line-height: 1.4;
}
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--container);
}

.join-org-panel[hidden] { display: none !important; }

.join-org-panel strong {
  color: var(--ink-strong);
  font-size: 14px;
  font-weight: 600;
}

.join-org-panel p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 18px;
}

.join-org-actions { display: grid; gap: 8px; }

@media (max-width: 560px) {
  .auth-shell {
    place-items: start center;
    padding: 52px 20px 28px;
  }

  .auth-stage { gap: 38px; }

  .maestro-brand {
    width: 256px;
    height: 50px;
  }

  .auth-card {
    padding: 0;
  }

  .auth-tab { padding-inline: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
