:root {
  color-scheme: light;
  font-family: "SF Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  --forest: #075a49;
  --forest-dark: #03483a;
  --mint: #b9f2df;
  --mint-soft: #e9f8f2;
  --ink: #15251f;
  --muted: #65766f;
  --surface: rgba(255, 255, 255, 0.96);
  --line: #dfe9e5;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #eef6f2;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 12%, rgba(185, 242, 223, 0.72), transparent 28rem),
    radial-gradient(circle at 88% 90%, rgba(7, 90, 73, 0.12), transparent 25rem),
    linear-gradient(145deg, #f7fbf9, #eaf4ef);
}

button,
a {
  font: inherit;
}

.page-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-content: center;
  padding: max(24px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

.invite-card {
  width: min(100%, 440px);
  min-width: min(404px, calc(100vw - 36px));
  padding: 26px 26px 24px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 30px;
  box-shadow: 0 24px 70px rgba(18, 54, 42, 0.15), 0 3px 10px rgba(18, 54, 42, 0.06);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
  color: var(--forest);
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: var(--forest);
  border-radius: 11px;
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
  transform: rotate(-4deg);
}

.brand-name {
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.join-icon,
.invalid-icon {
  display: grid;
  width: 82px;
  height: 82px;
  margin: 0 auto 20px;
  place-items: center;
  color: var(--forest);
  background: var(--mint);
  border-radius: 26px;
  box-shadow: inset 0 0 0 1px rgba(7, 90, 73, 0.06);
}

.join-icon svg {
  width: 47px;
  height: 47px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 5;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--forest);
  font-size: 14px;
  font-weight: 750;
  text-align: center;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(26px, 8vw, 32px);
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  text-wrap: balance;
}

.intro,
.invalid-state p {
  max-width: 34ch;
  margin: 10px auto 24px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
  text-align: center;
}

.code-panel {
  display: grid;
  gap: 9px;
  margin: 4px 0 20px;
  padding: 18px;
  background: var(--mint-soft);
  border: 1px solid #d7eee5;
  border-radius: 20px;
  text-align: center;
}

.code-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.invite-code {
  color: var(--forest-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(34px, 11vw, 44px);
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.actions {
  display: grid;
  gap: 11px;
}

.button {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 18px;
  border: 0;
  border-radius: 17px;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
  transition: transform 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
  -webkit-tap-highlight-color: transparent;
}

.button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.button-primary {
  color: #fff;
  background: var(--forest);
  box-shadow: 0 10px 22px rgba(7, 90, 73, 0.2);
}

.button-secondary {
  color: var(--forest);
  background: #e3ebe8;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary:hover {
  background: var(--forest-dark);
  box-shadow: 0 12px 26px rgba(7, 90, 73, 0.25);
}

.button-secondary:hover {
  background: #d8e5e0;
}

.button:active {
  transform: translateY(1px);
}

.button:focus-visible {
  outline: 3px solid rgba(7, 90, 73, 0.28);
  outline-offset: 3px;
}

.privacy-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

.invalid-state {
  padding: 12px 0 14px;
}

.invalid-icon {
  color: #8b4d08;
  background: #fff0d5;
  font-size: 42px;
  font-weight: 800;
}

.invalid-state p {
  margin-bottom: 0;
}

.status {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--forest-dark);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

@media (max-width: 420px) {
  .invite-card {
    min-width: 0;
    padding: 22px 18px 20px;
    border-radius: 25px;
  }

  .brand {
    margin-bottom: 22px;
  }

  .join-icon,
  .invalid-icon {
    width: 72px;
    height: 72px;
    border-radius: 23px;
  }

  .invite-code {
    letter-spacing: 0.12em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button {
    transition: none;
  }
}
