:root {
  color-scheme: dark;
  font-family: "Manrope", system-ui, sans-serif;
  background: #041126;
  color: #f7fbff;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -10%, rgba(38, 105, 222, .24), transparent 34rem),
    linear-gradient(180deg, #06162f 0%, #030b1b 100%);
  font-size: 16px;
}

button, input { font: inherit; }
button { cursor: pointer; }

.ambient {
  position: fixed;
  width: 25rem;
  height: 25rem;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .16;
  pointer-events: none;
}
.ambient-one { background: #2571ff; top: 20%; left: -17rem; }
.ambient-two { background: #19b6dc; bottom: 5%; right: -18rem; }

.site-header {
  width: min(100% - 32px, 760px);
  margin: 0 auto;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(163, 198, 255, .14);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: .18em;
  font-size: .95rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  background: linear-gradient(135deg, #9cf0ff, #4b66ff 52%, #e5f9ff);
  color: #06132a;
  clip-path: polygon(50% 0, 94% 18%, 72% 100%, 50% 72%, 28% 100%, 6% 18%);
  font-size: .72rem;
}
.brand-avatar {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 5px 12px rgba(43, 142, 255, .35));
}
.brand-accent { color: #64dff1; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.admin-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(100, 223, 241, .32);
  border-radius: 13px;
  color: #eafcff;
  background: rgba(100, 223, 241, .08);
  font-size: .92rem;
  font-weight: 700;
  text-decoration: none;
}
.admin-link:hover { background: rgba(100, 223, 241, .16); }
.hero-mascot {
  float: right;
  width: 138px;
  max-height: 150px;
  object-fit: contain;
  margin: -18px -6px 4px 14px;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, .28));
}

.support-link {
  border: 0;
  background: transparent;
  color: #a8b9d4;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: .88rem;
}
.help-icon {
  width: 22px;
  height: 22px;
  border: 1px solid #536887;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

main {
  width: min(100% - 28px, 580px);
  margin: 26px auto 40px;
}

.access-card, .product-card {
  border: 1px solid rgba(122, 173, 255, .22);
  box-shadow: 0 30px 80px rgba(0, 3, 12, .46);
  animation: appear .42s ease both;
}

.access-card {
  margin: 6vh auto 0;
  max-width: 500px;
  padding: 30px;
  border-radius: 28px;
  background: linear-gradient(155deg, rgba(19, 47, 91, .96), rgba(7, 23, 51, .98));
}

.eyebrow {
  color: #70c6ff;
  text-transform: uppercase;
  letter-spacing: .15em;
  font-weight: 800;
  font-size: .74rem;
}
h1 { margin: 10px 0 10px; font-size: clamp(1.65rem, 5vw, 2.15rem); line-height: 1.13; }
.intro { color: #9db1d0; line-height: 1.55; margin: 0 0 24px; }

form { display: grid; gap: 16px; }
label span { display: block; color: #aabbd4; font-size: .85rem; margin: 0 0 7px 2px; }
input {
  width: 100%;
  color: #fff;
  border: 1px solid #2b4d7e;
  border-radius: 14px;
  outline: none;
  background: #071a37;
  padding: 15px 16px;
  transition: border .2s, box-shadow .2s;
}
input:focus { border-color: #58a2ff; box-shadow: 0 0 0 4px rgba(57, 138, 255, .12); }

.primary-button {
  min-height: 52px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, #4c9dff, #2863dc);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(41, 104, 224, .28);
}
.primary-button:hover { filter: brightness(1.08); }
.primary-button:disabled { opacity: .68; cursor: wait; }
.privacy-note { color: #7188a9; font-size: .77rem; text-align: center; margin: 18px 0 0; }
.privacy-note span { color: #4de0a2; }

.product-card { border-radius: 28px; overflow: hidden; background: #0a2349; }
.product-hero {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 25px 26px;
  background: linear-gradient(135deg, #3b8df1, #2c5fc4 72%, #304ca0);
}
.xbox-badge {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: white;
  color: #2d6fd5;
  font-size: 1.35rem;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(0,0,0,.16);
}
.product-title { font-size: 1.35rem; font-weight: 700; }
.product-subtitle { color: #d4e8ff; font-size: .87rem; margin-top: 3px; }
.expiry-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 25px;
  color: #8fa7ca;
  background: #0b2853;
  font-size: .8rem;
  border-bottom: 1px solid #1b3c6b;
}
.active-pill { color: #b7f9dc; display: flex; align-items: center; gap: 7px; }
.active-pill i { width: 7px; height: 7px; border-radius: 50%; background: #49dfa0; box-shadow: 0 0 12px #49dfa0; }
.card-body { padding: 25px; }
.issued { color: #9dcbff; font-size: .83rem; margin-bottom: 12px; }
.issued span { color: #51d79e; margin-right: 4px; }
h2 { font-size: 1.62rem; margin: 0 0 8px; }
.body-copy { color: #99adca; line-height: 1.55; margin: 0 0 22px; font-size: .92rem; }

.credentials { display: grid; gap: 10px; }
.credential-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid #244d80;
  background: #071a36;
  border-radius: 16px;
}
.credential-label { display: block; color: #7891b4; font-size: .72rem; margin-bottom: 3px; }
.credential-row strong { font-size: .86rem; overflow-wrap: anywhere; }
.copy-button, .code-copy {
  flex: 0 0 auto;
  border: 1px solid #315b8e;
  color: #c4d6ed;
  background: #102b51;
  border-radius: 10px;
  padding: 9px 11px;
  font-size: .74rem;
}

.request-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  margin: 18px 0;
  border: 0;
  border-radius: 16px;
  color: #092046;
  background: linear-gradient(135deg, #e8f5ff, #cbe8ff);
  padding: 15px 17px;
  box-shadow: 0 8px 24px rgba(81, 159, 229, .16);
}
.request-button strong { display: block; font-size: .9rem; }
.request-button small { display: block; margin-top: 3px; color: #466587; }
.request-button:disabled { opacity: .68; cursor: wait; }
.key-icon { font-size: 1.7rem; }

.code-panel {
  text-align: center;
  border: 1px solid #224a7d;
  border-radius: 18px;
  padding: 22px 16px;
  background: linear-gradient(180deg, #06182f, #081d3c);
}
.code-label { color: #7890b1; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.code-value { font-size: clamp(2.1rem, 10vw, 3.25rem); font-weight: 800; letter-spacing: .16em; margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.code-panel p { color: #8fa4c2; font-size: .77rem; line-height: 1.5; margin: 0 auto 12px; max-width: 340px; }
.code-copy { padding: 10px 14px; color: #e9f4ff; }
.code-panel.loading .code-value { animation: pulse 1s infinite; }

.warranty { margin: 22px 0; border-bottom: 1px solid #1b3c69; padding-bottom: 20px; }
.warranty summary { color: #f5d862; font-size: .83rem; cursor: pointer; }
.warranty p { color: #91a4c2; font-size: .79rem; line-height: 1.5; }
.instructions h3 { font-size: 1.22rem; margin: 0 0 12px; }
.instructions ol { color: #bac9dc; padding-left: 22px; line-height: 1.55; font-size: .87rem; }
.instructions li { margin-bottom: 10px; padding-left: 5px; }

.security-note { display: flex; align-items: center; gap: 12px; background: rgba(32, 121, 180, .12); border: 1px solid rgba(64, 153, 211, .24); border-radius: 15px; padding: 12px 14px; }
.security-note p { margin: 0; color: #91a9c6; font-size: .75rem; line-height: 1.45; }
.security-note strong { color: #dff5ff; font-size: .81rem; }
.shield { display: grid; place-items: center; min-width: 29px; height: 29px; background: #1a6d9f; clip-path: polygon(50% 0, 91% 18%, 82% 73%, 50% 100%, 18% 73%, 9% 18%); }

footer { width: min(100% - 32px, 560px); margin: 0 auto 34px; text-align: center; color: #6f85a5; font-size: .76rem; }
footer button { border: 0; padding: 0; background: transparent; color: #9ec9ff; text-decoration: underline; }
footer a { color: #9ec9ff; }
.footer-separator { margin: 0 7px; }

.admin-shell { width: min(100% - 28px, 760px); }
.admin-card { padding: 28px; border-radius: 26px; background: linear-gradient(155deg, rgba(19, 47, 91, .98), rgba(7, 23, 51, .99)); border: 1px solid rgba(122, 173, 255, .22); }
.admin-card h1 { margin-top: 0; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-actions { display: flex; gap: 10px; margin-top: 18px; }
.admin-actions .primary-button { flex: 1; }
.admin-actions .copy-button { min-width: 220px; }
.admin-code-result { margin-top: 20px; }
.result-box { margin-top: 20px; padding: 16px; border: 1px solid #315b8e; border-radius: 15px; background: #071a37; }
.result-box a { color: #81c8ff; overflow-wrap: anywhere; }
.orders-list { margin-top: 22px; display: grid; gap: 10px; }
.order-item { padding: 13px 14px; border: 1px solid #244d80; border-radius: 14px; background: #071a36; color: #aabbd4; font-size: .82rem; }
.order-item strong { color: white; }
.status-used { color: #ffd36a; }
.status-active { color: #58dfa6; }
.client-card { max-width: 520px; margin: 7vh auto 0; text-align: center; }
.client-card .hero-mascot { float: none; display: block; width: 180px; max-height: 190px; margin: -18px auto 4px; }
.client-login { color: #dceaff; font-weight: 700; overflow-wrap: anywhere; }

@media (max-width: 650px) {
  .admin-grid { grid-template-columns: 1fr; }
  .admin-actions { flex-direction: column; }
  .admin-actions .copy-button { min-width: 0; width: 100%; }
  .hero-mascot { width: 105px; }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  translate: -50% 20px;
  opacity: 0;
  pointer-events: none;
  background: #e8f5ff;
  color: #0b2548;
  border-radius: 12px;
  padding: 11px 16px;
  font-size: .8rem;
  font-weight: 700;
  transition: .25s ease;
  box-shadow: 0 12px 40px #0008;
  z-index: 5;
}
.toast.show { opacity: 1; translate: -50% 0; }
.support-modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(1, 9, 24, .78);
  backdrop-filter: blur(8px);
}
.support-dialog {
  position: relative;
  width: min(100%, 420px);
  padding: 28px;
  border: 1px solid rgba(122, 173, 255, .28);
  border-radius: 24px;
  background: linear-gradient(155deg, #153664, #071832);
  box-shadow: 0 24px 80px #0009;
}
.support-dialog h2 { margin: 8px 0; font-size: 1.65rem; }
.support-dialog p { margin: 0 0 20px; color: #9fb2ce; }
.support-close { position: absolute; top: 12px; right: 14px; border: 0; background: transparent; color: #dceaff; font-size: 1.8rem; }
.support-action { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 50px; margin-top: 10px; text-decoration: none; }
.is-hidden { display: none !important; }

@keyframes appear { from { opacity: 0; transform: translateY(14px); } }
@keyframes pulse { 50% { opacity: .4; } }

@media (max-width: 520px) {
  .site-header { min-height: 68px; }
  .support-link { font-size: 0; }
  main { margin-top: 18px; }
  .access-card { padding: 24px 20px; border-radius: 23px; }
  .product-card { border-radius: 23px; }
  .product-hero { padding: 21px 20px; }
  .card-body { padding: 20px; }
  .expiry-row { padding: 12px 20px; }
  .credential-row { align-items: flex-end; }
  .copy-button { padding: 8px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
