.reg-page,
.start-page { position: relative; }
.reg-page[hidden] { display: none !important; }
.reg-page.is-ready { animation: regPageIn .32s ease both; }
@keyframes regPageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

html, body.route-registration {
  margin: 0 !important;
  padding: 0 !important;
}

body.route-registration {
  min-height: 100vh;
  display: flex !important;
  justify-content: center !important;
  align-items: flex-start !important;
  overflow-x: hidden !important;
}

body.route-registration .mafia-page-shell {
  width: min(100%, 430px) !important;
  max-width: 430px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  float: none !important;
  display: block !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.reg-loader-card {
  position: relative;
  width: 100% !important;
  max-width: 430px !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  margin: 0 auto !important;
  overflow: hidden;
  background: #030806;
}
.reg-loader-card.is-leaving { animation: regLoaderFade .34s ease forwards; }
.reg-loader-card.is-gone { display: none !important; }
@keyframes regLoaderFade { from { opacity: 1; } to { opacity: 0; } }
.reg-loader-cover,
.reg-loader-shade,
.reg-loader-content { position: absolute; inset: 0; }
.reg-loader-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center center; display: block; }
.reg-loader-shade {
  background:
    radial-gradient(circle at 50% 38%, rgba(31, 148, 79, .14), transparent 26%),
    linear-gradient(180deg, rgba(0,0,0,.18) 0%, rgba(1,7,4,.44) 38%, rgba(2,10,6,.78) 70%, rgba(2,9,6,.96) 100%);
}
.reg-loader-content {
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 32px;
  text-align: center;
}
.reg-loader-card__title {
  color: #fff3d6;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: .06em;
  text-shadow: 0 2px 12px rgba(0,0,0,.48);
}
.reg-loader-progress-wrap { width: 100%; max-width: 285px; margin-top: 18px; }
.reg-loader-progress {
  width: 100%; height: 16px; border-radius: 999px; overflow: hidden;
  border: 1px solid rgba(97, 214, 141, .38);
  background: rgba(3, 18, 9, .84);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), 0 0 18px rgba(0,0,0,.18);
}
.reg-loader-progress span {
  display: block; width: 0; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #5df293 0%, #2fb164 100%);
  box-shadow: 0 0 14px rgba(86, 242, 146, .28);
}
.reg-loader-progress__percent {
  margin-top: 8px;
  color: #e7fbe9;
  font-size: 15px;
  font-weight: 800;
  text-shadow: 0 1px 8px rgba(0,0,0,.36);
}
.reg-loader-card__text {
  max-width: 300px;
  margin-top: 16px;
  color: #e0f6e7;
  font-size: 16px;
  line-height: 1.4;
  text-shadow: 0 1px 8px rgba(0,0,0,.38);
}
.reg-loader-flavor {
  margin-top: 8px;
  color: #c7e7d1;
  font-size: 13px;
  font-style: italic;
  text-shadow: 0 1px 6px rgba(0,0,0,.32);
}

.reg-hero {
  margin: 0 0 12px;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(84, 195, 124, .28);
  background: linear-gradient(180deg, rgba(8,34,21,.98), rgba(4,18,11,.98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 14px 28px rgba(0,0,0,.2);
  clip-path: inset(0 round 28px);
}
.reg-hero__art {
  position: relative; min-height: 420px; display:flex; align-items:center; justify-content:center;
  overflow: hidden; border-radius: 28px 28px 0 0; clip-path: inset(0 round 28px 28px 0 0);
}
.reg-hero__art img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top;
  display:block; border-radius: 28px 28px 0 0; margin: 0; padding: 0;
}
.reg-hero__overlay { position:absolute; inset:0; background: linear-gradient(180deg, rgba(0,0,0,.02) 18%, rgba(2,10,6,.15) 45%, rgba(4,18,11,.90) 92%); }
.reg-hero__body { position: relative; z-index: 1; margin-top: -108px; padding: 0 16px 20px; text-align: center; }
.reg-hero__title { color:#f4f1d6; font-size: 28px; line-height:1.06; font-weight:900; text-shadow:0 2px 10px rgba(0,0,0,.45); }
.reg-hero__subtitle { margin-top:10px; color:#d5efdd; font-size:14px; line-height:1.45; text-shadow:0 1px 6px rgba(0,0,0,.32); }

.reg-panel, .start-panel {
  border-radius: 22px; padding: 14px; margin-bottom: 12px; border: 1px solid rgba(84, 190, 122, .24);
  background: linear-gradient(180deg, rgba(8,46,25,.98), rgba(4,24,14,.98)); box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.reg-panel__title, .start-panel__title { margin:0 0 8px; color:#f5ffe2; font-size:19px; font-weight:800; text-align:center; }
.reg-step-panel { display: none; }
.reg-step-panel.is-active { display: block; animation: regFadeIn .22s ease; }
@keyframes regFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.reg-side-grid,
.reg-choice-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:10px; margin-top:12px; }
.reg-side-card,
.reg-choice-card {
  position: relative;
  display:flex; flex-direction:column; width:100%; padding:0; overflow:hidden; border-radius:20px; cursor:pointer;
  border:1px solid rgba(66,179,110,.24); background: linear-gradient(180deg, rgba(10,55,29,.98), rgba(4,24,13,.98));
  color:#efffec; box-shadow: inset 0 1px 0 rgba(255,255,255,.05); text-decoration:none !important;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.reg-side-card:hover,
.reg-choice-card:hover { transform: translateY(-1px); }
.reg-side-card::after,
.reg-choice-card::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  box-shadow: inset 0 0 0 2px rgba(118, 244, 166, .42), 0 0 18px rgba(72, 226, 132, .24);
  transition: opacity .16s ease;
}
.reg-side-card.is-selected,
.reg-choice-card.is-selected {
  border-color: rgba(132,246,178,.66);
  box-shadow: 0 10px 24px rgba(0,0,0,.22), 0 0 20px rgba(67, 225, 129, .18);
  transform: translateY(-1px) scale(1.01);
}
.reg-side-card.is-selected::after,
.reg-choice-card.is-selected::after { opacity: 1; }
.reg-side-card__visual,
.reg-choice-card__visual {
  display:flex; align-items:center; justify-content:center;
  background: radial-gradient(circle at top, rgba(71,189,117,.18), transparent 45%), linear-gradient(180deg, rgba(17,70,38,.96), rgba(6,27,15,.98));
  padding: 0 !important;
  min-height: 120px;
}
.reg-side-card__visual img,
.reg-choice-card__visual img { width: 140px; max-width: 100%; height:auto; display:block; margin: 0 auto; }
.reg-side-card__title,
.reg-choice-card__title { display:block; padding:1px 5px 4px; text-align:center; color:#f2e7bf; font-size:12px; font-weight:800; line-height:1.12; }
.reg-choice-card__body { padding:0; text-align:center; }
.reg-choice-card__desc { display:none !important; }
.reg-side-grid .reg-side-card:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 5px); }

.reg-alert { margin:0 0 12px; padding:12px 14px; border-radius:16px; background: linear-gradient(180deg, rgba(82,20,20,.94), rgba(53,7,7,.96)); border:1px solid rgba(237,117,117,.22); color:#ffe4e4; font-size:13px; line-height:1.45; }
.reg-form { display:grid; gap:18px; margin-top:12px; }
.reg-field { display:block; }
.reg-field__label { display:block; color:#d9f7e3; font-size:13px; font-weight:700; line-height:1.2; margin: 0 0 8px; position: relative; z-index: 2; }
.reg-field input, .reg-field textarea, .reg-field select {
  display:block; width:100%; min-height:52px; border-radius:14px; border:1px solid rgba(92,206,139,.28); background:rgba(4,22,12,.96); color:#fff; padding:0 16px; font-size:15px; line-height:1.2; box-sizing:border-box;
}
.reg-field input::placeholder { color: rgba(239, 217, 154, .76); font-style: italic; }
.reg-form__agree {
  display:flex; align-items:center; gap:10px; padding:12px 14px; border-radius:14px; background:rgba(14,53,29,.75); border:1px solid rgba(91,201,137,.16); color:#e8fff0; font-size:13px; line-height:1.4; cursor:pointer;
}
.reg-form__agree input { width:18px; height:18px; margin:0; accent-color:#36c865; flex: 0 0 auto; }
.reg-form__agree a { color:#d7f8a9; }

.reg-actions { display:flex; flex-direction:column; align-items:center; gap:10px; margin-top:14px; }
.reg-submit, .start-next {
  display:inline-flex; align-items:center; justify-content:center; width: min(100%, 240px); min-height:52px; padding:0 22px; border-radius:17px; border:1px solid rgba(119, 235, 161, .26);
  text-decoration:none !important; color:#fff7d7 !important; font-weight:900; font-size:18px; letter-spacing:.01em;
  background: linear-gradient(180deg, #178245 0%, #0f5d30 60%, #0c4a26 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 8px 22px rgba(0,0,0,.18), 0 0 14px rgba(61, 206, 114, .12);
  position: relative; overflow: hidden;
}
.reg-submit::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: -38%; width: 38%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.10) 50%, transparent 100%);
  transform: skewX(-22deg); animation: regButtonSheen 2.35s linear infinite;
}
@keyframes regButtonSheen { from { left: -42%; } to { left: 118%; } }
.reg-back {
  display:inline-flex; align-items:center; justify-content:center; min-height: 38px; padding: 0 14px; width: auto;
  border-radius: 14px; border: 1px solid rgba(104, 195, 138, .22); text-decoration:none !important; font-size: 14px; font-weight: 700;
  color: #a8dbc0 !important; background: transparent; box-shadow:none;
}
.reg-home-link { color: #b7e8c8 !important; border-color: rgba(112, 199, 142, .2) !important; }

.reg-alert[hidden] { display: none !important; }
.reg-submit.is-loading,
.reg-submit:disabled { cursor: wait; opacity: .82; filter: saturate(.72); }
.reg-page.is-submitting { pointer-events: none; opacity: .86; transition: opacity .2s ease; }
body.reg-no-footer .down,
body.reg-no-footer .footer,
body.reg-no-footer .foot,
body.reg-no-footer #footer,
body.reg-no-footer .menuDown,
body.reg-no-footer .footer_classic,
body.reg-no-footer .nav-footer,
body.reg-no-footer .bottom-menu,
body.reg-no-footer .menubottom,
body.reg-no-footer .menu_bottom,
body.reg-no-footer .balka,
body.reg-no-footer .mafia-footer,
body.reg-no-footer .mf-wrap,
body.reg-no-footer .mf-lower,
body.reg-no-footer .mf-grid,
body.reg-no-footer .mf-col,
body.reg-no-footer .mf-center,
body.reg-no-footer .mf-exit-row,
body.reg-no-footer .mf-guest,
body.reg-no-footer .mf-telegram,
body.reg-no-footer .mf-switch,
body.reg-no-footer .mf-promo { display: none !important; }

@media (max-width: 480px) {
  body.route-registration .mafia-page-shell,
  .reg-page,
  .reg-loader-card { max-width: 100% !important; }
  .reg-hero__art { min-height: 360px; }
  .reg-hero__body { margin-top: -96px; }
  .reg-hero__title { font-size: 24px; }
  .reg-side-grid, .reg-choice-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .reg-submit { width: min(100%, 210px); font-size: 16px; }
  .reg-side-grid .reg-side-card:last-child:nth-child(odd) { width: min(100%, 175px); }
  .reg-loader-card__title { font-size: 24px; }
}


/* Registration v18 desktop centering hard-fix */
body.route-registration .mafia-page-shell {
  position: relative !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body.route-registration .reg-loader-card,
body.route-registration .reg-page {
  width: 100% !important;
  max-width: 430px !important;
}

@media (max-width: 480px) {
  body.route-registration .mafia-page-shell {
    left: 0 !important;
    transform: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* Registration v19: same desktop centering model as the main page */
html {
  min-width: 0 !important;
}

body.route-registration,
body.route-registration.mafia-layout {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  max-width: 430px !important;
  min-width: 0 !important;
  margin: 0 auto !important;
  padding: 0 !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  float: none !important;
  box-sizing: border-box !important;
}

body.route-registration .mafia-page-shell {
  display: block !important;
  position: static !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  float: none !important;
  box-sizing: border-box !important;
}

body.route-registration .reg-page,
body.route-registration .reg-loader-card {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
}

@media (max-width: 430px) {
  body.route-registration,
  body.route-registration.mafia-layout {
    max-width: 100% !important;
    border-left: 0 !important;
    border-right: 0 !important;
    box-shadow: none !important;
  }
}


/* Registration v20 side/gender cards compact photo style */
.reg-side-grid,
.reg-choice-grid {
  gap: 12px !important;
  align-items: start;
}

.reg-side-card,
.reg-choice-card {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 24px !important;
  overflow: visible !important;
  transform: none !important;
}

.reg-side-card::after,
.reg-choice-card::after {
  inset: -2px !important;
  border-radius: 24px !important;
  box-shadow: 0 0 0 2px rgba(126, 245, 172, .0), 0 0 0 rgba(0,0,0,0) !important;
}

.reg-side-card__visual,
.reg-choice-card__visual {
  min-height: 0 !important;
  padding: 0 !important;
  background: linear-gradient(180deg, rgba(13,67,36,.96), rgba(6,27,15,.98)) !important;
  border-radius: 24px !important;
  overflow: hidden !important;
  border: 1px solid rgba(78, 187, 118, .30);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 8px 18px rgba(0,0,0,.14);
  line-height: 0;
}

.reg-side-card__visual img,
.reg-choice-card__visual img {
  width: 100% !important;
  max-width: none !important;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center top;
  border-radius: 22px 22px 0 0;
  margin: 0 !important;
}

.reg-side-card__body,
.reg-choice-card__body {
  padding: 0 !important;
}

.reg-side-card__title,
.reg-choice-card__title {
  display: block;
  margin: 0 !important;
  padding: 6px 8px 8px !important;
  background: linear-gradient(180deg, rgba(9,48,25,.98), rgba(4,24,13,.98));
  border-radius: 0 0 22px 22px;
  border: 1px solid rgba(78, 187, 118, .30);
  border-top: 0;
  color: #f4f0cf !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1.12 !important;
  text-align: center;
}

.reg-side-card:hover .reg-side-card__visual,
.reg-choice-card:hover .reg-choice-card__visual {
  border-color: rgba(111, 232, 156, .48);
}

.reg-side-card.is-selected .reg-side-card__visual,
.reg-choice-card.is-selected .reg-choice-card__visual,
.reg-side-card.is-selected .reg-side-card__title,
.reg-choice-card.is-selected .reg-choice-card__title {
  border-color: rgba(133, 248, 179, .82) !important;
  box-shadow: 0 0 0 2px rgba(110, 240, 160, .32), 0 0 18px rgba(71, 232, 133, .18), inset 0 1px 0 rgba(255,255,255,.06) !important;
}

.reg-side-card.is-selected::after,
.reg-choice-card.is-selected::after {
  opacity: 1 !important;
  box-shadow: 0 0 0 2px rgba(122, 246, 170, .32), 0 0 18px rgba(70, 230, 132, .16) !important;
}

.reg-side-card:last-child:nth-child(odd) {
  width: calc(50% - 6px) !important;
}

@media (max-width: 480px) {
  .reg-side-card__title,
  .reg-choice-card__title {
    font-size: 10px !important;
    padding: 5px 6px 7px !important;
  }
}


/* Registration v21 form label/input spacing hard-fix */
body.route-registration .reg-form {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 20px !important;
  margin-top: 14px !important;
}

body.route-registration label.reg-field,
body.route-registration .reg-field {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto minmax(52px, auto) !important;
  row-gap: 12px !important;
  align-items: stretch !important;
  position: relative !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  overflow: visible !important;
}

body.route-registration .reg-field__label {
  display: block !important;
  position: static !important;
  float: none !important;
  clear: both !important;
  inset: auto !important;
  width: auto !important;
  min-height: 18px !important;
  margin: 0 !important;
  padding: 0 0 2px !important;
  line-height: 18px !important;
  transform: none !important;
  z-index: auto !important;
}

body.route-registration .reg-field > input,
body.route-registration .reg-field > textarea,
body.route-registration .reg-field > select {
  display: block !important;
  position: static !important;
  float: none !important;
  clear: both !important;
  inset: auto !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 54px !important;
  margin: 0 !important;
  padding: 0 16px !important;
  transform: none !important;
  box-sizing: border-box !important;
}

body.route-registration .reg-field + .reg-field {
  margin-top: 0 !important;
}


/* Registration v22 overlay labels on side/gender photos */
body.route-registration .reg-side-card,
body.route-registration .reg-choice-card {
  overflow: visible !important;
}

body.route-registration .reg-side-card__visual,
body.route-registration .reg-choice-card__visual {
  position: relative !important;
  overflow: hidden !important;
  border-radius: 24px !important;
}

body.route-registration .reg-side-card__visual::after,
body.route-registration .reg-choice-card__visual::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36%;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(3,15,8,.22) 28%, rgba(5,22,12,.94) 100%);
  pointer-events: none;
}

body.route-registration .reg-side-card__title,
body.route-registration .reg-choice-card__title {
  position: relative !important;
  z-index: 3 !important;
  margin: -34px 6px 0 !important;
  padding: 6px 8px 10px !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 0 18px 18px !important;
  color: #f6f2cf !important;
  text-shadow: 0 2px 8px rgba(0,0,0,.72);
  box-shadow: none !important;
}

body.route-registration .reg-side-card.is-selected .reg-side-card__title,
body.route-registration .reg-choice-card.is-selected .reg-choice-card__title {
  color: #fff8db !important;
}

body.route-registration .reg-side-card.is-selected .reg-side-card__visual,
body.route-registration .reg-choice-card.is-selected .reg-choice-card__visual {
  border-color: rgba(133, 248, 179, .92) !important;
  box-shadow: 0 0 0 2px rgba(110, 240, 160, .34), 0 0 18px rgba(71, 232, 133, .18), inset 0 1px 0 rgba(255,255,255,.06) !important;
}

@media (max-width: 480px) {
  body.route-registration .reg-side-card__title,
  body.route-registration .reg-choice-card__title {
    margin: -30px 5px 0 !important;
    padding: 5px 6px 8px !important;
  }
}
