:root {
  --ink: #151821;
  --muted: #626979;
  --line: #dfe3ea;
  --surface: #ffffff;
  --surface-soft: #f4f6f9;
  --accent: #3157d5;
  --accent-dark: #2443aa;
  --success: #18734a;
  --danger: #b42318;
  --shadow: 0 20px 60px rgba(24, 33, 54, 0.09);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--surface-soft);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 0%, rgba(49, 87, 213, 0.1), transparent 32rem),
    var(--surface-soft);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: var(--accent-dark);
}

button,
input {
  font: inherit;
}

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

:focus-visible {
  outline: 3px solid #2443aa;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 50;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-weight: 760;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
}

nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

nav a,
.nav-button {
  padding: 8px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
}

nav a:hover,
.nav-button:hover {
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
}

main {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

.hero {
  max-width: 700px;
  margin-bottom: 38px;
}

.hero h1 {
  max-width: 620px;
  margin: 7px 0 12px;
  font-size: clamp(2.2rem, 6vw, 4.7rem);
  font-weight: 760;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.hero > p:last-child,
.section-heading p,
.info-card p,
.form-switch,
small {
  color: var(--muted);
}

.eyebrow {
  margin: 0;
  color: var(--accent) !important;
  font-size: 0.72rem;
  font-weight: 780;
  letter-spacing: 0.16em;
}

.auth-layout,
.owner-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 22px;
  align-items: start;
}

.form-card,
.info-card,
.narrow-card,
.account-card,
.invite-panel {
  border: 1px solid rgba(223, 227, 234, 0.9);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.form-card,
.narrow-card,
.invite-panel {
  padding: clamp(24px, 4vw, 42px);
}

.info-card {
  position: sticky;
  top: 22px;
  padding: 30px;
  overflow: hidden;
}

.info-card::after {
  position: absolute;
  right: -65px;
  bottom: -90px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(49, 87, 213, 0.09);
  content: "";
}

.status-dot {
  display: block;
  width: 10px;
  height: 10px;
  margin-bottom: 46px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 7px rgba(24, 115, 74, 0.1);
}

.info-card h2,
.section-heading h2 {
  margin: 6px 0 8px;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  letter-spacing: -0.03em;
}

.section-heading {
  margin-bottom: 26px;
}

.compact-heading {
  margin-bottom: 18px;
}

form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 7px;
}

label {
  display: grid;
  gap: 7px;
  font-size: 0.92rem;
  font-weight: 680;
}

input {
  width: 100%;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid #cfd5df;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

input:hover {
  border-color: #abb5c4;
}

input:focus {
  border-color: var(--accent);
  outline: 3px solid #2443aa;
  outline-offset: 2px;
}

small {
  font-size: 0.78rem;
  font-weight: 450;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 720;
}

.primary-button {
  padding: 12px 18px;
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.secondary-button {
  padding: 10px 13px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  white-space: nowrap;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.form-switch {
  margin: 20px 0 0;
  font-size: 0.9rem;
}

.form-message {
  margin: 0;
  color: var(--danger);
  font-size: 0.88rem;
  font-weight: 600;
}

.form-message.success {
  color: var(--success);
}

.narrow-card {
  max-width: 620px;
}

.account-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
}

.account-card > div {
  display: grid;
  gap: 5px;
  min-height: 132px;
  padding: 24px;
  align-content: end;
  background: var(--surface);
}

.meta-label {
  color: var(--muted);
  font-size: 0.8rem;
}

.input-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.invite-list {
  display: grid;
  gap: 12px;
}

.invite-item,
.empty-state {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.invite-item header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.invite-item h3,
.invite-item p {
  margin: 0;
}

.invite-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 0.82rem;
}

.badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(24, 115, 74, 0.1);
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 700;
}

.badge.inactive {
  background: rgba(98, 105, 121, 0.11);
  color: var(--muted);
}

.invite-actions {
  margin-top: 14px;
}

.global-status {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100% - 36px));
  padding: 12px 15px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
}

footer {
  padding: 0 20px 28px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

@media (max-width: 780px) {
  .site-header {
    padding: 18px 20px;
  }

  main {
    width: min(100% - 28px, 680px);
    padding-top: 28px;
  }

  .auth-layout,
  .owner-layout {
    grid-template-columns: 1fr;
  }

  .info-card {
    position: static;
  }

  .info-card::after {
    right: 0;
  }

  .status-dot {
    margin-bottom: 24px;
  }

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

@media (max-width: 500px) {
  .site-header {
    align-items: flex-start;
  }

  nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .brand > span:last-child {
    display: none;
  }

  .hero h1 {
    font-size: 2.45rem;
  }

  .form-card,
  .narrow-card,
  .invite-panel,
  .info-card {
    padding: 22px;
    border-radius: 17px;
  }

  .info-card::after {
    right: 0;
    bottom: -55px;
    width: 130px;
    height: 130px;
  }

  .input-action-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .view:not([hidden]) {
    animation: reveal 180ms ease-out;
  }

  @keyframes reveal {
    from {
      opacity: 0;
      transform: translateY(5px);
    }
  }
}
