:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --border: #e5e7eb;
  --border-strong: #dfe3ea;
  --text: #151a33;
  --muted: #777d8d;
  --purple: #6f35f5;
  --purple-dark: #5926dc;
  --button-bg: #f8f9fc;
  --error: #b42318;
  --success: #027a48;
  --shadow: 0 16px 55px rgba(32, 40, 70, 0.05);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 14px;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 60px 1fr 44px;
  background:
    linear-gradient(90deg, transparent 55px, var(--border) 56px, transparent 57px),
    linear-gradient(90deg, transparent calc(100% - 61px), var(--border) calc(100% - 60px), transparent calc(100% - 59px)),
    #fff;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  border-color: var(--border);
}

.site-header {
  justify-content: space-between;
  padding: 0 68px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.brand-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.org-header-name {
  padding-left: 16px;
  border-left: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.dev-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 9px;
  border: 1px solid rgba(111, 53, 245, 0.2);
  border-radius: 999px;
  color: var(--purple-dark);
  background: rgba(111, 53, 245, 0.08);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.brand-mark {
  width: 21px;
  height: 18px;
  background: linear-gradient(145deg, #7438fa, #5e2bed);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-radius: 4px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-button,
.auth-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow: hidden;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.nav-button {
  min-width: 82px;
  background: #fcfcfe;
  color: #151a33;
}

.nav-button:hover {
  border-color: #cfd5e3;
  background: #f4f6fb;
  box-shadow: 0 7px 20px rgba(20, 28, 48, 0.08);
  transform: translateY(-1px);
}

.nav-button.primary {
  min-width: 94px;
  color: #fff;
  background: var(--purple);
  border-color: var(--purple);
  box-shadow: 0 6px 18px rgba(111, 53, 245, 0.2);
}

.disabled-signup {
  --glow-x: 50%;
  --glow-y: 50%;
  min-width: 94px;
  color: #9ba1b3;
  background: #eef0f5;
  border-color: #d8dde8;
  box-shadow: none;
  cursor: not-allowed;
  overflow: visible;
}

.disabled-signup:hover {
  color: #8a91a3;
  background: #e8ebf1;
  border-color: #d8dde8;
  box-shadow: none;
  transform: none;
}

.disabled-signup::after {
  content: attr(data-tooltip);
  position: absolute;
  top: var(--glow-y);
  left: var(--glow-x);
  z-index: 4;
  padding: 7px 10px;
  border-radius: 6px;
  color: #fff;
  background: #1d2440;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
  transition: opacity 120ms ease;
  white-space: nowrap;
}

.disabled-signup:hover::after,
.disabled-signup:focus-visible::after {
  opacity: 1;
}

.cursor-glow {
  --glow-x: 50%;
  --glow-y: 50%;
  isolation: isolate;
  overflow: visible;
}

.cursor-glow::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 0;
  background:
    radial-gradient(
      circle 82px at var(--glow-x) var(--glow-y),
      rgba(255, 222, 181, 0.32),
      rgba(142, 107, 200, 0.18) 38%,
      rgba(142, 107, 200, 0) 76%
    );
  opacity: 0;
  pointer-events: none;
  border-radius: inherit;
  transition: opacity 180ms ease;
}

.cursor-glow::after {
  content: "";
  position: absolute;
  inset: -8px;
  z-index: -1;
  background:
    radial-gradient(
      circle 118px at var(--glow-x) var(--glow-y),
      rgba(255, 170, 82, 0.16),
      rgba(142, 107, 200, 0.12) 44%,
      rgba(142, 107, 200, 0) 76%
    );
  opacity: 0;
  filter: blur(10px);
  pointer-events: none;
  border-radius: inherit;
  transition: opacity 180ms ease;
}

.cursor-glow:hover::before,
.cursor-glow:hover::after {
  opacity: 1;
}

.button-content {
  position: relative;
  z-index: 1;
}

.nav-button.primary:hover,
.primary-submit:hover {
  background: var(--purple-dark);
  border-color: var(--purple-dark);
  box-shadow: 0 10px 24px rgba(111, 53, 245, 0.24);
  transform: translateY(-1px);
}

.external-arrow {
  display: inline-block;
  margin-left: 8px;
  font-size: 15px;
  line-height: 1;
  transform-origin: 50% 50%;
  transition: transform 180ms ease;
}

a:hover .external-arrow,
button:hover .external-arrow {
  transform: translate(2px, 2px) rotate(45deg);
}

.auth-area {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-card {
  width: 328px;
  min-height: 440px;
  padding: 34px 34px 31px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
}

.signup-card {
  width: min(560px, 100%);
}

.auth-title {
  margin: 0 0 17px;
  text-align: center;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--purple-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.auth-note {
  margin: -6px 0 17px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

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

.org-signup-form {
  gap: 15px;
}

.field-group {
  display: block;
  color: #2f3658;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.field-group.is-disabled {
  color: #8f96a8;
}

.field-group.is-disabled .field {
  color: #8f96a8;
  background: #eef0f5;
  cursor: not-allowed;
}

.field {
  width: 100%;
  height: 52px;
  padding: 0 24px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  background: #fcfcfe;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  outline: none;
}

select.field {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #777d8d 50%),
    linear-gradient(135deg, #777d8d 50%, transparent 50%);
  background-position:
    calc(100% - 22px) 23px,
    calc(100% - 16px) 23px;
  background-repeat: no-repeat;
  background-size: 6px 6px;
}

.field:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(111, 53, 245, 0.1);
}

.field::placeholder {
  color: var(--text);
  opacity: 1;
}

.primary-submit {
  height: 40px;
  border: 1px solid var(--purple);
  border-radius: 4px;
  color: #fff;
  background: var(--purple);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(111, 53, 245, 0.16);
}

.auth-status {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.auth-status[data-type="error"] {
  color: var(--error);
}

.auth-status[data-type="success"] {
  color: var(--success);
}

.org-insight,
.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.org-insight {
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafbff;
}

.detected-org-preview {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(111, 53, 245, 0.16);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(111, 53, 245, 0.08), rgba(255, 255, 255, 0.72));
}

.detected-org-preview img,
.detected-org-preview span {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

.detected-org-preview img {
  object-fit: cover;
}

.detected-org-preview span {
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #7438fa, #5e2bed);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.detected-org-preview strong,
.detected-org-preview small {
  display: block;
}

.detected-org-preview small {
  margin-top: 3px;
  color: var(--muted);
}

.field-hint[data-type="error"] {
  color: var(--error);
}

.field-hint[data-type="success"] {
  color: var(--success);
}

.choice-group {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-group legend {
  margin-bottom: 8px;
  color: #2f3658;
  font-size: 12px;
  font-weight: 800;
}

.choice-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: flex-start;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fcfcfe;
  cursor: pointer;
}

.choice-card:has(input:checked) {
  border-color: rgba(111, 53, 245, 0.55);
  box-shadow: 0 0 0 3px rgba(111, 53, 245, 0.08);
}

.choice-card input {
  margin-top: 3px;
  accent-color: var(--purple);
}

.choice-card strong,
.choice-card small {
  display: block;
}

.choice-card small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}

.org-create-fields,
.org-invite-fields,
.org-profile-fields {
  display: grid;
  gap: 12px;
}

.divider {
  display: flex;
  align-items: center;
  margin: 12px 0 13px;
  color: var(--muted);
  font-size: 12px;
}

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

.divider span {
  padding: 0 10px;
}

.auth-button {
  width: 100%;
  min-height: 34px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  background: var(--button-bg);
  color: #1d2440;
  box-shadow: 0 1px 2px rgba(20, 28, 48, 0.02);
  cursor: pointer;
}

.auth-button:hover {
  border-color: #cfd5e3;
  background: #f1f4fa;
  box-shadow: 0 7px 20px rgba(20, 28, 48, 0.08);
  transform: translateY(-1px);
}

.auth-button:last-of-type {
  margin-bottom: 0;
}

.auth-button + .auth-button {
  margin-top: 6px;
}

.google-icon {
  margin-right: 9px;
  font-size: 16px;
  font-weight: 800;
}

.sso-disabled {
  --glow-x: 50%;
  --glow-y: 50%;
  color: #9ba1b3;
  background: #f0f2f6;
  cursor: not-allowed;
  overflow: visible;
}

.sso-disabled:hover {
  border-color: var(--border);
  background: #eceff4;
  box-shadow: none;
  transform: none;
}

.sso-disabled::after {
  content: attr(data-tooltip);
  position: absolute;
  top: var(--glow-y);
  left: var(--glow-x);
  z-index: 2;
  padding: 6px 9px;
  border-radius: 4px;
  color: #fff;
  background: #1d2440;
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
  transition:
    opacity 120ms ease;
  white-space: nowrap;
}

.sso-disabled:hover::after,
.sso-disabled:focus-visible::after {
  opacity: 1;
}

.switch-copy {
  margin: 16px 0 0;
  text-align: center;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.switch-copy a {
  color: var(--purple-dark);
  font-weight: 500;
}

.site-footer {
  justify-content: space-between;
  padding: 0 68px;
  border-top: 1px solid var(--border);
  color: #737888;
  font-size: 13px;
}

.dev-footer-label {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
  color: var(--purple-dark);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.footer-links {
  display: flex;
  gap: 39px;
}

.redirect-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.dashboard-card {
  width: min(520px, 100%);
  padding: 42px;
  text-align: center;
}

.dashboard-area {
  min-height: calc(100vh - 104px);
  padding: 28px 68px;
}

.under-construction-card {
  margin: 0 auto;
  align-self: center;
}

.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(10px);
  animation: modalFadeIn 240ms ease both;
}

.onboarding-modal {
  width: min(520px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  padding: 34px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(32, 40, 70, 0.12);
}

.onboarding-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.onboarding-progress span {
  height: 4px;
  border-radius: 999px;
  background: #e8ebf1;
}

.onboarding-progress span.is-active {
  background: var(--purple);
}

.onboarding-step {
  display: grid;
  gap: 14px;
}

.org-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #2f3658;
  font-size: 12px;
  font-weight: 800;
}

.org-action-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fcfcfe;
}

.org-action-row input {
  accent-color: var(--purple);
}

.onboarding-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dashboard-app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 24px;
  min-height: calc(100vh - 160px);
}

.dashboard-sidebar,
.dashboard-content,
.settings-card {
  border: 1px solid var(--border-strong);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.dashboard-sidebar {
  padding: 22px;
}

.sidebar-org {
  margin: 0 0 20px;
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -0.05em;
}

.sidebar-tab {
  width: 100%;
  min-height: 42px;
  margin-bottom: 10px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.sidebar-tab:hover,
.sidebar-tab.is-active {
  border-color: rgba(111, 53, 245, 0.18);
  color: var(--purple-dark);
  background: rgba(111, 53, 245, 0.08);
}

.dashboard-content {
  min-width: 0;
  padding: 34px;
}

.dashboard-tab-panel {
  display: none;
}

.dashboard-tab-panel.is-active {
  display: block;
}

.coming-soon-image {
  display: block;
  width: min(100%, 360px);
  margin: 0 auto 24px;
}

.dashboard-title {
  margin: 0 0 12px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.dashboard-copy {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.6;
}

.dashboard-email {
  color: var(--text);
  font-weight: 800;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 30px;
  text-align: left;
}

.dashboard-panel {
  min-height: 176px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fcfcfe;
}

.dashboard-panel h2 {
  margin: 10px 0 10px;
  color: var(--text);
  font-size: 18px;
  letter-spacing: -0.04em;
}

.dashboard-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.panel-kicker {
  color: var(--purple-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.settings-card {
  padding: 24px;
}

.image-settings-form {
  margin-bottom: 22px;
}

.image-preview-card {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 20px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 12%, rgba(111, 53, 245, 0.1), transparent 32%),
    #fcfcfe;
}

.image-preview-frame {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border: 1px solid rgba(111, 53, 245, 0.18);
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(111, 53, 245, 0.12), rgba(111, 53, 245, 0.02));
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.7);
}

.image-preview-frame.org {
  border-radius: 24px;
}

.image-preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-frame span,
.mini-avatar {
  color: #fff;
  background: linear-gradient(145deg, #7438fa, #5e2bed);
  font-weight: 900;
}

.image-preview-frame span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 22px;
  letter-spacing: 0.08em;
}

.image-preview-card h2 {
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: -0.04em;
}

.image-preview-card p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.5;
}

.upload-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(111, 53, 245, 0.22);
  border-radius: 999px;
  color: var(--purple-dark);
  background: rgba(111, 53, 245, 0.08);
  font-weight: 850;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.upload-button:hover {
  border-color: rgba(111, 53, 245, 0.42);
  background: rgba(111, 53, 245, 0.12);
  transform: translateY(-1px);
}

.upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.mini-avatar {
  display: block;
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  border-radius: 12px;
  object-fit: cover;
}

.settings-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.settings-list div {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.settings-list dt {
  color: var(--muted);
  font-weight: 800;
}

.settings-list dd {
  margin: 0;
  font-weight: 750;
}

.legal-card {
  width: min(620px, 100%);
  min-height: auto;
  padding: 44px;
  text-align: center;
}

.legal-title {
  margin: 0 0 14px;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.05em;
}

.legal-copy {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.legal-updated {
  margin: 22px 0 0;
  color: #9ba1b3;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.not-found-card {
  min-height: 340px;
}

.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

@media (max-width: 720px) {
  .page-shell {
    grid-template-rows: 66px 1fr auto;
    background: #fff;
  }

  .site-header {
    padding: 0 18px;
  }

  .brand-group {
    gap: 10px;
  }

  .org-header-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-actions {
    gap: 8px;
  }

  .nav-button {
    min-width: auto;
    padding: 0 14px;
  }

  .nav-button.primary {
    min-width: auto;
  }

  .auth-area {
    padding: 34px 18px;
  }

  .auth-card {
    width: 100%;
    max-width: 410px;
    min-height: auto;
    padding: 38px 28px 32px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-area {
    padding: 22px 18px;
  }

  .dashboard-app {
    grid-template-columns: 1fr;
  }

  .settings-list div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .image-preview-card {
    grid-template-columns: 1fr;
  }

  .site-footer {
    min-height: 74px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 14px 18px;
  }

  .footer-links {
    gap: 20px;
  }
}
