@font-face {
  font-family: "Titillium Web";
  src:
    url("/fonts/TitilliumWeb-Regular.woff2") format("woff2"),
    url("/fonts/TitilliumWeb-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Titillium Web";
  src:
    url("/fonts/TitilliumWeb-SemiBold.woff2") format("woff2"),
    url("/fonts/TitilliumWeb-SemiBold.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Titillium Web";
  src:
    url("/fonts/TitilliumWeb-Bold.woff2") format("woff2"),
    url("/fonts/TitilliumWeb-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --text: #ead8b8;
  --text-muted: #b2a38c;
  --panel: rgba(19, 15, 12, 0.82);
  --panel-border: rgba(150, 121, 74, 0.85);
  --input: rgba(8, 8, 8, 0.92);
  --input-border: rgba(93, 86, 74, 1);
  --green: #7fbe33;
  --shadow: rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Titillium Web", system-ui, sans-serif;
  color: var(--text);
  background:
    linear-gradient(rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.22)),
    url("/assets/sf-bg.webp") center center / cover fixed no-repeat;
  background-color: #17130f;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(0,0,0,0.08), rgba(0,0,0,0.34));
}

.page {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.hero {
  flex: 1;
  width: min(100% - 32px, 980px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(32px, 7vh, 86px) 0 36px;
}

.logo {
  width: min(680px, 82vw);
  max-width: 100%;
  height: auto;
  margin-bottom: clamp(24px, 4vh, 40px);
  filter: drop-shadow(0 12px 10px rgba(0, 0, 0, 0.75));
}

.panel {
  width: min(820px, 100%);
  padding: clamp(24px, 4vw, 44px) clamp(18px, 5vw, 56px) clamp(22px, 4vw, 38px);
  background: var(--panel);
  border: 2px solid var(--panel-border);
  border-radius: 18px;
  box-shadow:
    0 20px 44px var(--shadow),
    inset 0 0 0 1px rgba(255,255,255,0.03);
  position: relative;
}

.panel::before,
.panel::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: rgba(160, 134, 86, 0.9);
  border-style: solid;
  opacity: 0.8;
}

.panel::before {
  top: -2px;
  left: -2px;
  border-width: 2px 0 0 2px;
}

.panel::after {
  right: -2px;
  bottom: -2px;
  border-width: 0 2px 2px 0;
}

h1 {
  margin: 0 0 22px;
  text-align: center;
  font-size: clamp(1.55rem, 3vw, 2.3rem);
  line-height: 1.12;
  font-weight: 600;
  text-shadow: 0 2px 2px #000;
}

.invite-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
}

input {
  width: 100%;
  height: 72px;
  padding: 0 24px;
  border-radius: 12px;
  border: 2px solid var(--input-border);
  background: var(--input);
  color: #f3dfbe;
  font: 600 clamp(1.05rem, 2vw, 1.4rem) "Titillium Web", system-ui, sans-serif;
  letter-spacing: 0.12em;
  text-align: center;
  outline: none;
  box-shadow:
    inset 0 3px 10px rgba(0, 0, 0, 0.7),
    0 2px 0 rgba(255,255,255,0.03);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

input::placeholder {
  color: #857a69;
  opacity: 1;
}

input:focus {
  border-color: rgba(172, 145, 100, 1);
  box-shadow:
    inset 0 3px 10px rgba(0, 0, 0, 0.7),
    0 0 0 3px rgba(172, 145, 100, 0.14);
}

button {
  width: 76px;
  height: 76px;
  border: 3px solid #223216;
  border-radius: 12px;
  background: linear-gradient(#a4de4f, #6aa52a 58%, #54851f);
  color: #152009;
  cursor: pointer;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.28),
    inset 0 -5px 0 rgba(26, 42, 12, 0.42),
    0 4px 0 #1c2911,
    0 0 0 2px rgba(149, 118, 72, 0.45),
    0 0 18px rgba(127, 190, 51, 0.26);
  transition: transform .12s ease, filter .12s ease, opacity .12s ease;
}

button span {
  display: block;
  font-size: 2.9rem;
  line-height: 1;
  font-weight: 900;
  transform: translateY(-2px);
}

button:hover {
  filter: brightness(1.08);
}

button:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.18),
    inset 0 -2px 0 rgba(26, 42, 12, 0.42),
    0 1px 0 #1c2911,
    0 0 0 2px rgba(149, 118, 72, 0.45);
}

button:disabled,
input:disabled {
  opacity: .72;
  cursor: wait;
}

.message {
  margin: 24px 0 0;
  min-height: 58px;
  text-align: center;
  color: var(--text-muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.35;
  text-shadow: 0 2px 2px #000;
}

.message.success {
  color: #b5df7b;
}

.message.error {
  color: #e09373;
}

.footer {
  padding: 16px 20px 20px;
  text-align: center;
  color: rgba(234, 216, 184, 0.7);
  font-size: 1rem;
  text-shadow: 0 2px 2px #000;
}

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

@media (max-width: 700px) {
  body {
    background-attachment: scroll;
  }

  .hero {
    width: min(100% - 20px, 520px);
    padding: 28px 0 30px;
  }

  .logo {
    width: min(420px, 92vw);
    margin-bottom: 22px;
  }

  .panel {
    padding: 22px 14px 18px;
    border-radius: 14px;
  }

  h1 {
    font-size: 1.38rem;
    margin-bottom: 18px;
  }

  .invite-form {
    gap: 10px;
  }

  input {
    height: 58px;
    padding: 0 10px;
    font-size: 0.93rem;
    letter-spacing: 0.06em;
  }

  button {
    width: 60px;
    height: 60px;
    border-radius: 10px;
  }

  button span {
    font-size: 2.2rem;
  }

  .message {
    margin-top: 20px;
    font-size: 1rem;
  }

  .footer {
    font-size: 0.92rem;
  }
}

@media (max-width: 390px) {
  .hero {
    width: calc(100% - 14px);
  }

  .panel {
    padding-inline: 12px;
  }

  .invite-form {
    gap: 8px;
  }

  input {
    font-size: 0.84rem;
  }

  button {
    width: 54px;
    height: 54px;
  }

  button span {
    font-size: 1.95rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
