:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #059669;
  --bg: #f7f9fc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #5b677a;
  --border: #dbe5f4;
  --danger: #b91c1c;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(247, 249, 252, 0.94)),
    radial-gradient(circle at 18% 12%, rgba(37, 99, 235, 0.12), transparent 32%),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

a {
  color: var(--primary);
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.auth-shell {
  display: grid;
  min-height: 100dvh;
  place-items: center;
}

.auth-panel,
.quota-panel,
.create-panel,
.result-panel,
.list-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.auth-panel {
  width: min(480px, 100%);
  padding: 42px;
}

.logo {
  width: 173px;
  height: auto;
  display: block;
  margin-bottom: 30px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-logo {
  width: 138px;
  height: auto;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(32px, 6vw, 52px);
  line-height: 1.05;
  letter-spacing: 0;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
}

h2 {
  margin-bottom: 10px;
  font-size: 22px;
  line-height: 1.2;
}

.lead {
  max-width: 34rem;
  color: var(--muted);
  font-size: 17px;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
}

.quota-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  gap: 28px;
  align-items: center;
  padding: 30px;
}

.quota-copy p {
  color: var(--muted);
}

.quota-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.quota-grid div {
  padding: 22px 16px;
  background: #f8fbff;
  text-align: center;
}

.quota-grid div + div {
  border-left: 1px solid var(--border);
}

.quota-grid span {
  display: block;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.quota-grid small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.create-panel,
.result-panel,
.list-panel {
  padding: 26px;
}

.create-panel p {
  color: var(--muted);
}

label {
  display: block;
  margin-bottom: 8px;
  color: #243047;
  font-size: 14px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: #fff;
  outline: none;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.primary-action,
.ghost-button,
.copy-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 700;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    opacity 180ms ease;
}

.primary-action {
  margin-top: 18px;
  background: var(--primary);
  color: #fff;
}

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

.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.ghost-button,
.copy-button {
  background: #fff;
  border-color: var(--border);
  color: #1f2a44;
}

.ghost-button:hover,
.copy-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.alert {
  margin-bottom: 18px;
  border: 1px solid rgba(185, 28, 28, 0.22);
  border-radius: 8px;
  background: #fff5f5;
  color: var(--danger);
  padding: 14px 16px;
  font-weight: 600;
}

.result-panel,
.list-panel {
  margin-top: 18px;
}

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

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-title h2 {
  margin: 0;
}

.section-title span {
  color: var(--muted);
  font-size: 14px;
}

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

.invite-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: #fbfdff;
}

.invite-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.invite-item p,
.empty,
.footnote {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 820px) {
  .topbar,
  .dashboard,
  .quota-panel,
  .copy-row,
  .invite-item {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }

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

  .quota-grid div + div {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .auth-panel,
  .quota-panel,
  .create-panel,
  .result-panel,
  .list-panel {
    padding: 22px;
  }
}
