:root {
  color-scheme: light;
  font-family: Arial, sans-serif;
  background: #f6f2ea;
  color: #252018;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.card {
  width: min(100%, 420px);
  background: #fffdf8;
  border-radius: 24px;
  padding: 32px 24px;
  box-shadow: 0 12px 35px #33250f18;
}

.brand { margin: 0; color: #ba4f26; font-size: 14px; font-weight: 700; letter-spacing: .16em; }
.guest-label { margin: 32px 0 4px; color: #857a6c; font-size: 14px; }
h1 { margin: 0; font-size: 30px; }

.loyalty-card {
  background: #292117;
  color: #fff8ee;
  border-radius: 18px;
  margin-top: 28px;
  padding: 22px;
}

h2 { margin: 0 0 20px; font-size: 20px; }
.progress-row { display: flex; justify-content: space-between; padding: 13px 0; border-top: 1px solid #ffffff24; }
.hint { margin: 22px 0 0; color: #857a6c; font-size: 14px; line-height: 1.45; }

form { display: grid; gap: 16px; margin-top: 28px; }
label { display: grid; gap: 7px; font-size: 14px; font-weight: 700; }
input[type="text"], input[type="tel"] { border: 1px solid #d9d0c4; border-radius: 10px; font: inherit; padding: 12px; }
.consent { grid-template-columns: 18px 1fr; align-items: start; font-size: 13px; font-weight: 400; line-height: 1.45; }
.consent input { margin: 2px 0 0; }
a { color: #ba4f26; }
button { background: #ba4f26; border: 0; border-radius: 10px; color: white; cursor: pointer; font: inherit; font-weight: 700; padding: 13px; }
button:disabled { cursor: wait; opacity: .65; }
.form-error { color: #b3261e; font-size: 14px; margin: -6px 0 0; min-height: 1em; }
.staff-result { margin-top: 28px; }
.staff-result h2 { margin-bottom: 6px; }
.staff-result p { color: #857a6c; margin: 0 0 14px; }
.staff-actions { display: grid; gap: 10px; margin-top: 18px; }
.secondary { background: #665849; }
.profile-actions { display: grid; gap: 10px; margin-top: 28px; }
.danger-button { background: #b3261e; }
.text-button { background: transparent; color: #857a6c; font-size: 14px; margin-top: 22px; padding: 0; text-decoration: underline; }

/* Фирменный интерфейс Mini App НЕПАРИЖ. Селекторы ограничены .mini-app,
   поэтому техническая страница сотрудника сохраняет свой текущий вид. */
.mini-app {
  --neparizh-blue: #0a0a8f;
  --neparizh-blue-dark: #060657;
  --neparizh-yellow: #f5b700;
  --neparizh-silver: #9ba0aa;
  --neparizh-ink: #111117;
  --neparizh-mist: #f2f3f7;
  background:
    radial-gradient(circle at 100% 0, #f5b700 0 8px, transparent 8.5px),
    linear-gradient(135deg, #eef0f8 0%, #ffffff 48%, #f7f7fa 100%);
  color: var(--neparizh-ink);
  font-family: "Geologica", "Montserrat", "Arial Narrow", Arial, sans-serif;
  min-height: 100svh;
  padding: 16px;
}

.mini-app .card {
  position: relative;
  width: min(100%, 430px);
  overflow: hidden;
  isolation: isolate;
  background: #fff;
  border: 1px solid #dfe1ea;
  border-radius: 28px;
  box-shadow: 0 18px 46px #0a0a8f1f;
  padding: 28px 22px 24px;
}

.mini-app .card::before,
.mini-app .card::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

.mini-app .card::before {
  width: 164px;
  height: 164px;
  right: -104px;
  top: -106px;
  background: var(--neparizh-yellow);
}

.mini-app .card::after {
  width: 92px;
  height: 92px;
  left: -56px;
  bottom: 68px;
  border: 16px solid #e6e8f2;
}

.mini-app .brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--neparizh-blue);
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: .055em;
  line-height: 1;
}

.mini-app .brand-mark {
  display: inline-block;
  width: 17px;
  height: 17px;
  border: 4px solid var(--neparizh-blue);
  border-radius: 50% 50% 50% 3px;
  transform: rotate(-26deg);
}

.mini-app .guest-label {
  margin: 34px 0 6px;
  color: var(--neparizh-silver);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.mini-app h1 {
  max-width: 330px;
  color: var(--neparizh-blue);
  font-family: "Montserrat", Arial, sans-serif;
  font-size: clamp(27px, 8vw, 35px);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1.02;
}

.mini-app #card-screen { position: relative; padding-top: 232px; }
.mini-app .guest-qr-button {
  position: absolute;
  top: 0;
  right: 0;
  width: min(52vw, 214px);
  min-height: 0;
  padding: 9px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 14px #0a0a8f24;
}

.mini-app .guest-qr-button img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.mini-app .qr-modal {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #0a0a8fe8;
}

.mini-app .qr-modal[hidden] { display: none; }
.mini-app .qr-modal img {
  width: min(84vw, 318px);
  height: auto;
  padding: 12px;
  border-radius: 18px;
  background: #fff;
  image-rendering: pixelated;
}

.mini-app .qr-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: none;
  color: var(--neparizh-blue);
  font-size: 27px;
  line-height: 1;
}

@media (max-width: 385px) {
  .mini-app .guest-qr-button { width: 190px; }
}

/* Финальная композиция Mini App по фирменному концепту. */
@font-face {
  font-family: "Neparizh Geologica";
  src: url("brand/Geologica_Auto-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Neparizh Geologica";
  src: url("brand/Geologica_Auto-ExtraLight.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Neparizh Montserrat";
  src: url("brand/Montserrat-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

.mini-app {
  background: #fff;
  color: #0a0a8f;
  font-family: "Neparizh Geologica", Arial, sans-serif;
  padding: 0;
}

.mini-app .card {
  width: min(100%, 440px);
  min-height: 100svh;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  padding: 22px 18px 24px;
}

.mini-app .card::before {
  width: 160px;
  height: 160px;
  right: -125px;
  top: 220px;
  background: #f2b705;
  opacity: .9;
}

.mini-app .card::after { display: none; }

.mini-app .brand-header {
  position: relative;
  min-height: 74px;
  margin-bottom: 8px;
}

.mini-app .brand-logo {
  display: block;
  width: 142px;
  height: auto;
  margin: 0 auto;
}

.mini-app .refresh-card-button {
  position: absolute;
  top: 5px;
  right: 0;
  min-height: 0;
  padding: 5px 0;
  background: transparent;
  box-shadow: none;
  color: #0a0a8f;
  font-family: "Neparizh Geologica", Arial, sans-serif;
  font-size: 10px;
  font-weight: 500;
}

.mini-app .refresh-card-button:active { box-shadow: none; transform: none; }

.mini-app .brand { display: none; }
.mini-app .guest-label { color: #0a0a8f; font-family: "Neparizh Geologica", Arial, sans-serif; }

.mini-app h1 {
  max-width: none;
  margin: 0 0 18px;
  color: #0a0a8f;
  font-family: "Neparizh Montserrat", Arial, sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.1;
}

.mini-app #card-screen { padding-top: 0; }
.mini-app .loyalty-card {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: #0a0a8f;
}

.mini-app .loyalty-card::after { display: none; }
.mini-app .loyalty-panel {
  position: relative;
  min-height: 174px;
  overflow: hidden;
  border: 1px solid #e4e4eb;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 4px 12px #0a0a8f12;
  padding: 17px 14px;
}

.mini-app .panel-content { position: relative; z-index: 1; max-width: 63%; }
.mini-app .loyalty-panel h2 {
  margin: 0 0 10px;
  color: #0a0a8f;
  font-family: "Neparizh Montserrat", Arial, sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.mini-app .loyalty-panel p {
  margin: 5px 0 0;
  color: #0a0a8f;
  font-size: 12px;
  font-weight: 300;
  line-height: 1.28;
}

.mini-app .progress-row {
  display: block;
  min-height: 0;
  padding: 2px 0 0;
  border: 0;
}

.mini-app .progress-row strong {
  color: #0a0a8f;
  font-family: "Neparizh Montserrat", Arial, sans-serif;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -.05em;
}

.mini-app #guest-name {
  font-family: "Neparizh Geologica", Arial, sans-serif;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -.035em;
}

.mini-app .progress-row::after { display: none; }
.mini-app .coffee-stamps,
.mini-app .shawarma-stamps {
  display: flex;
  gap: 6px;
  height: 25px;
  margin: 0 0 4px;
}

.mini-app .coffee-stamps i {
  position: relative;
  display: block;
  width: 16px;
  height: 14px;
  margin-top: 6px;
  border-radius: 2px 2px 5px 5px;
  background: #0a0a8f;
}

.mini-app .coffee-stamps i::before {
  content: "";
  position: absolute;
  top: -3px;
  right: -6px;
  width: 7px;
  height: 8px;
  border: 2px solid #0a0a8f;
  border-left: 0;
  border-radius: 0 6px 6px 0;
}

.mini-app .coffee-stamps i { background: #fff; border: 1.5px solid #0a0a8f; }
.mini-app .coffee-stamps i::before { border-color: #0a0a8f; }
.mini-app .coffee-stamps[data-filled="1"] i:nth-child(-n + 1),
.mini-app .coffee-stamps[data-filled="2"] i:nth-child(-n + 2),
.mini-app .coffee-stamps[data-filled="3"] i:nth-child(-n + 3),
.mini-app .coffee-stamps[data-filled="4"] i:nth-child(-n + 4),
.mini-app .coffee-stamps[data-filled="5"] i:nth-child(-n + 5),
.mini-app .coffee-stamps[data-filled="6"] i:nth-child(-n + 6) { background: #0a0a8f; }
.mini-app .shawarma-stamps i {
  display: block;
  width: 15px;
  height: 21px;
  border: 1.5px solid #0a0a8f;
  border-radius: 9px 9px 7px 7px;
  background: repeating-linear-gradient(135deg, #0a0a8f 0 2px, #fff 2px 5px);
  transform: rotate(-12deg);
}

.mini-app .shawarma-stamps i { background: #fff; }
.mini-app .shawarma-stamps[data-filled="1"] i:nth-child(-n + 1),
.mini-app .shawarma-stamps[data-filled="2"] i:nth-child(-n + 2),
.mini-app .shawarma-stamps[data-filled="3"] i:nth-child(-n + 3),
.mini-app .shawarma-stamps[data-filled="4"] i:nth-child(-n + 4),
.mini-app .shawarma-stamps[data-filled="5"] i:nth-child(-n + 5),
.mini-app .shawarma-stamps[data-filled="6"] i:nth-child(-n + 6) { background: repeating-linear-gradient(135deg, #0a0a8f 0 2px, #fff 2px 5px); }

.mini-app .loyalty-panel.has-reward {
  border-color: #f2b705;
  box-shadow: 0 4px 14px #f2b70533;
}

.mini-app .loyalty-panel.has-reward .progress-row::before {
  content: "Бесплатный кофе";
  display: block;
  margin: 3px 0 2px;
  color: #b17c00;
  font-family: "Neparizh Geologica", Arial, sans-serif;
  font-size: 11px;
  font-weight: 500;
}

.mini-app .shawarma-panel.has-reward .progress-row::before { content: "Бесплатная шаверма"; }
.mini-app .panel-illustration {
  position: absolute;
  z-index: 0;
  right: -13px;
  bottom: -18px;
  width: 154px;
  height: 162px;
  object-fit: contain;
  object-position: right bottom;
}

.mini-app .coffee-illustration { width: 147px; right: -2px; bottom: -24px; }
.mini-app .shawarma-illustration { width: 150px; right: -9px; bottom: -25px; }

.mini-app .guest-qr-button {
  position: relative;
  top: auto;
  right: auto;
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 17px;
  padding: 12px 16px;
  border: 0;
  border-radius: 9px;
  background: #0a0a8f;
  box-shadow: none;
  color: #fff;
  font-family: "Neparizh Geologica", Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
}

.mini-app .guest-qr-button:active { box-shadow: none; transform: none; }
.mini-app .qr-source { display: none !important; }
.mini-app .qr-button-icon {
  width: 17px;
  height: 12px;
  border: 1.5px solid #fff;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent 30%, #fff 30% 38%, transparent 38% 61%, #fff 61% 69%, transparent 69%);
}

.mini-app .hint {
  margin: 12px 0 0;
  color: #0a0a8f;
  font-size: 12px;
  font-weight: 300;
  text-align: center;
}

.mini-app .text-button {
  width: 100%;
  margin-top: 28px;
  color: #0a0a8f;
  font-family: "Neparizh Geologica", Arial, sans-serif;
  font-size: 12px;
  font-weight: 300;
}

.mini-app .qr-modal {
  z-index: 20;
  background: #fffffffa;
}

.mini-app .qr-modal img {
  width: min(84vw, 318px);
  padding: 16px;
  border: 1px solid #e4e4eb;
  border-radius: 0;
  background: #fff;
  box-shadow: 0 10px 30px #0a0a8f1f;
}

.mini-app .qr-modal-close {
  top: 18px;
  right: 18px;
  background: #0a0a8f;
  color: #fff;
  font-family: Arial, sans-serif;
}

.mini-app form { margin-top: 22px; }
.mini-app #registration-screen h1,
.mini-app #delete-confirmation-screen h1,
.mini-app #profile-deleted-screen h1 { text-align: center; }
.mini-app #registration-screen .guest-label,
.mini-app #delete-confirmation-screen .guest-label,
.mini-app #profile-deleted-screen .guest-label { text-align: center; }

@media (max-width: 360px) {
  .mini-app .card { padding: 18px 14px 22px; }
  .mini-app .brand-logo { width: 126px; margin-bottom: 18px; }
  .mini-app .brand-header { min-height: 64px; }
  .mini-app .loyalty-panel { min-height: 161px; }
  .mini-app .panel-illustration { width: 140px; }
}

.mini-app .loyalty-card {
  position: relative;
  overflow: hidden;
  margin-top: 28px;
  padding: 22px 20px 18px;
  border: 0;
  border-radius: 21px;
  background: var(--neparizh-blue);
  box-shadow: 0 12px 0 var(--neparizh-yellow), 0 20px 30px #0a0a8f30;
  color: #fff;
}

.mini-app .loyalty-card::after {
  content: "НЕПАРИЖ";
  position: absolute;
  right: -12px;
  top: 20px;
  color: #ffffff14;
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 29px;
  font-weight: 900;
  letter-spacing: -.08em;
  transform: rotate(-90deg) translateX(-50%);
  transform-origin: right top;
}

.mini-app .loyalty-card h2 {
  margin-bottom: 19px;
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.03em;
}

.mini-app .progress-row {
  position: relative;
  align-items: center;
  min-height: 54px;
  padding: 14px 0 10px;
  border-color: #ffffff38;
  font-size: 15px;
}

.mini-app .progress-row span { font-weight: 500; }
.mini-app .progress-row strong {
  color: var(--neparizh-yellow);
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 15px;
  font-weight: 800;
}

.mini-app .progress-row::after {
  content: "● ● ● ● ● ●";
  position: absolute;
  left: 0;
  bottom: 0;
  color: #ffffff48;
  font-size: 7px;
  letter-spacing: 2px;
}

.mini-app .hint {
  margin: 27px 0 0;
  color: #676b78;
  font-size: 14px;
  line-height: 1.45;
}

.mini-app form {
  gap: 17px;
  margin-top: 27px;
}

.mini-app label {
  color: var(--neparizh-blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.mini-app input[type="text"],
.mini-app input[type="tel"] {
  border: 1px solid #cfd2df;
  border-radius: 13px;
  background: #fbfbfd;
  color: var(--neparizh-ink);
  font-family: "Geologica", Arial, sans-serif;
  font-size: 16px;
  outline-color: var(--neparizh-blue);
  padding: 14px;
}

.mini-app .consent {
  color: #5e6270;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.45;
  text-transform: none;
}

.mini-app .consent input { accent-color: var(--neparizh-blue); }
.mini-app a { color: var(--neparizh-blue); font-weight: 700; }

.mini-app button {
  min-height: 50px;
  border-radius: 13px;
  background: var(--neparizh-blue);
  box-shadow: 0 5px 0 #060657;
  color: #fff;
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .01em;
  transition: transform .15s ease, box-shadow .15s ease;
}

.mini-app button:active { box-shadow: 0 2px 0 #060657; transform: translateY(3px); }
.mini-app button:disabled { box-shadow: none; }
.mini-app .secondary { background: #7b808b; box-shadow: 0 5px 0 #565a63; }
.mini-app .danger-button { background: #22222a; box-shadow: 0 5px 0 #050506; }

.mini-app .form-error { color: #bc2434; font-weight: 600; }
.mini-app .profile-actions { margin-top: 30px; }
.mini-app .text-button {
  min-height: 0;
  margin-top: 29px;
  background: transparent;
  box-shadow: none;
  color: #777b87;
  font-family: "Geologica", Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 360px) {
  .mini-app { padding: 10px; }
  .mini-app .card { border-radius: 23px; padding: 24px 18px 22px; }
  .mini-app h1 { font-size: 27px; }
}
