/* =========================================================================
   Clubius Mini App — design system
   Faithful recreation of the "Мастер бот Clubius" mockups.
   ========================================================================= */

:root {
  /* Surfaces */
  --bg-top: #0c1220;
  --bg-bottom: #070b14;
  --card: #121b2c;
  --card-2: #0f1727;
  --card-3: #0c1424;
  --field: #0c1526;
  --footer: #1b2536;
  --border: #222e44;
  --border-soft: #1a2436;

  /* Brand */
  --blue: #2f80ff;
  --blue-2: #1f6ff0;
  --blue-bright: #3d8bff;
  --red: #ff1e3c;
  --red-soft: rgba(255, 30, 60, 0.9);
  --green: #17c964;
  --green-flag: #16b45a;

  /* Text */
  --text: #ffffff;
  --muted: #6c7a90;
  --muted-2: #55647c;
  --muted-3: #46536a;

  /* Pills */
  --pill-neg-bg: #0e2b22;
  --pill-neg-text: #23d67f;
  --pill-refund-bg: #3a1020;
  --pill-refund-text: #ff5b7a;
  --pill-pos-bg: #0e2b22;
  --pill-pos-text: #23d67f;

  --radius: 16px;
  --radius-lg: 20px;
  --maxw: 430px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-bottom);
  color: var(--text);
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  justify-content: center;
}

.app {
  width: 100%;
  max-width: var(--maxw);
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(120% 60% at 50% 0%, #101a2e 0%, var(--bg-top) 40%, var(--bg-bottom) 100%);
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--blue-bright); text-decoration: none; }

/* ------------------------------------------------------------------ layout */
.screen {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  padding: 18px 18px 0;
  animation: fade 0.22s ease;
}
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.stack { display: flex; flex-direction: column; gap: 14px; }
.grow { flex: 1 0 auto; }
.center-text { text-align: center; }
.muted { color: var(--muted); }

/* --------------------------------------------------------------- app header */
.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-top: 6px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand__logo { width: 46px; height: 46px; flex: none; }
.brand__word {
  font-weight: 800;
  font-size: 30px;
  letter-spacing: 0.5px;
  color: #eef2f8;
}
.header-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.header-action {
  display: flex; align-items: center; gap: 9px;
  background: none; border: none; color: #dfe6f0; padding: 0;
  font-size: 16px; font-weight: 500;
}
.header-action svg { width: 22px; height: 22px; }

/* -------------------------------------------------------------- page header */
.page-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
  margin-bottom: 8px;
}
.icon-btn {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 2px solid #e9eef6; border-radius: 12px;
  color: #e9eef6;
}
.icon-btn.plain { border: none; }
.icon-btn svg { width: 22px; height: 22px; }
.page-title {
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
}

/* --------------------------------------------------------------- offers row */
.section-label {
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--muted);
  text-transform: uppercase;
  margin: 18px 0 10px;
}
.offers {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
  margin: 0 -18px;
  padding-left: 18px;
  padding-right: 18px;
  scrollbar-width: none;
}
.offers::-webkit-scrollbar { display: none; }
.offer {
  scroll-snap-align: start;
  flex: 0 0 132px;
  height: 200px;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  color: #fff;
  background: #14243e;
}
.offer img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.offer__title {
  position: relative;
  z-index: 2;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.offer .art { position: absolute; inset: 0; z-index: 1; }
.offer.newarrival { background: linear-gradient(160deg, #f6e6b8, #e9d089); }
.offer.puzzle     { background: linear-gradient(160deg, #b17bff, #7b3ff0); }
.offer.gift       { background: linear-gradient(160deg, #9b6bff, #6a35d8); }
.offer.rocket     { background: linear-gradient(160deg, #ff9a6b, #f0603f); }

/* pagination dots under carousel */
.offers-dots { display: flex; gap: 6px; justify-content: flex-start; margin: 8px 0 2px; }
.offers-dots i { width: 26px; height: 4px; border-radius: 4px; background: #253046; }
.offers-dots i.active { background: var(--blue); }

.divider { height: 1px; background: var(--border-soft); margin: 16px 0 4px; border: 0; }

/* --------------------------------------------------------------------- card */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

/* accent card: red edge peeking at the bottom-left (income block) — as in the design */
.accent-card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
}

.income__row { display: flex; justify-content: space-between; align-items: center; }
.income__label { font-size: 18px; font-weight: 600; color: #dfe6f0; }
.income__history {
  display: flex; align-items: center; gap: 4px;
  color: var(--muted); font-size: 15px; font-weight: 500;
  background: none; border: none;
}
.income__history svg { width: 16px; height: 16px; }
.income__value { font-size: 34px; font-weight: 700; margin-top: 8px; letter-spacing: -0.5px; }
.income__value small { font-size: 20px; color: #aeb8c8; font-weight: 600; }

/* tariff strip on main screen */
.tariff-strip {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 16px;
}
.tariff-strip b { color: var(--blue-bright); }
.tariff-strip .until { color: var(--muted); font-size: 14px; margin-left: auto; margin-right: 12px; }
.tariff-strip svg { width: 22px; height: 22px; color: #cdd6e4; }

/* ------------------------------------------------------------------ buttons */
.btn {
  position: relative;
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 18px 20px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.06s ease, filter 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 22px; height: 22px; }

.btn-primary { background: linear-gradient(180deg, var(--blue) 0%, var(--blue-2) 100%); }
.btn-primary.edged {
}
/* green corner flag used on the main action buttons */
.btn-flagged { }
.btn-flagged::before {
  content: "";
  position: absolute;
  top: -1px; left: 12px;
  width: 14px; height: 20px;
  background: var(--green-flag);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
  box-shadow: 0 2px 4px rgba(0,0,0,.3);
}

.btn-red { background: linear-gradient(180deg, #ff2a48 0%, #e3122f 100%); box-shadow: -3px 4px 0 -1px rgba(47,128,255,.55); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: #dfe6f0; }
.btn-lg { padding: 20px; font-size: 18px; }
.btn:disabled { filter: grayscale(0.4) brightness(0.7); cursor: default; }

/* extra features row */
.features {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}
.features__label { font-size: 12px; font-weight: 700; color: #cdd6e4; max-width: 92px; line-height: 1.2; }
.feature { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; color: #cdd6e4; }
.feature svg { width: 22px; height: 22px; }
.feature span { font-size: 10px; color: var(--muted); text-align: center; }
.features__info { margin-left: auto; color: var(--muted); }
.features__info svg { width: 22px; height: 22px; }

/* text links (Контактная информация / Публичная оферта) */
.link-row {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 8px; color: #eef2f8; font-size: 16px; font-weight: 600;
}
.link-row svg { width: 22px; height: 22px; }

/* ad slots */
.ad-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ad-slot {
  background: var(--card-3);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 18px 12px;
  text-align: center;
  color: var(--muted);
}
.ad-slot svg { width: 30px; height: 30px; opacity: .5; margin-bottom: 8px; }
.ad-slot p { margin: 0; font-size: 12px; }
.ad-slot a { font-size: 12px; }

/* ------------------------------------------------------- transaction list */
.tx-title { text-align: center; font-size: 22px; font-weight: 800; margin: 22px 0 14px; }
.tx-empty { text-align: center; color: var(--muted-2); font-size: 16px; line-height: 1.5; padding: 0 20px 10px; }
.tx-list { display: flex; flex-direction: column; gap: 12px; }
.tx {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  background: var(--card);
  border-radius: 14px;
  padding: 14px 16px 14px 18px;
  overflow: hidden;
}
.tx::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 4px;
  background: var(--edge, var(--green));
}
.tx.edge-green::before { background: #17c964; }
.tx.edge-red::before   { background: var(--red); }
.tx.edge-purple::before{ background: #a24bff; }
.tx.edge-blue::before  { background: var(--blue); }
.tx__avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  background: #1c2740; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.tx__avatar img { width: 100%; height: 100%; object-fit: cover; }
.tx__avatar svg { width: 30px; height: 30px; color: #9fb0cc; }
.tx__body { flex: 1; min-width: 0; }
.tx__name { font-size: 17px; font-weight: 700; }
.tx__sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tx__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.tx__date { font-size: 11px; color: var(--muted-2); }
.tx__amount {
  font-size: 14px; font-weight: 800; padding: 6px 12px; border-radius: 999px; white-space: nowrap;
}
.amount-neg    { background: var(--pill-neg-bg);    color: var(--pill-neg-text); }
.amount-pos    { background: var(--pill-pos-bg);    color: var(--pill-pos-text); }
.amount-refund { background: var(--pill-refund-bg); color: var(--pill-refund-text); }

/* ------------------------------------------------------------------- footer */
.app-footer { margin-top: 26px; }
.footer-credit {
  background: var(--footer);
  padding: 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--muted); font-size: 13px;
  border-radius: 16px 16px 0 0;
}
.footer-credit .brand__word { font-size: 15px; }
.footer-credit svg { width: 20px; height: 20px; }
.footer-handle { text-align: center; color: var(--muted-3); font-size: 15px; padding: 16px; }

/* ------------------------------------------------------------------- fields */
.field-label { font-size: 16px; color: #cdd6e4; margin: 4px 0 8px; display: block; font-weight: 500; }
.input, .textarea {
  width: 100%;
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  color: #fff;
  font-size: 17px;
  font-family: inherit;
}
.input::placeholder, .textarea::placeholder { color: #4d5a72; }
.input:focus, .textarea:focus { outline: none; border-color: var(--blue); }
.textarea { min-height: 120px; resize: vertical; }
.input-wrap { position: relative; }
.input-wrap .ok-badge { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); }

/* stepper / progress */
.stepper { margin: 4px 0 20px; }
.stepper__track {
  position: relative;
  height: 30px; border-radius: 999px;
  background: #0e1626; border: 1px solid var(--border);
  display: flex; align-items: center;
}
.stepper__fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, #2f80ff, #1f6ff0);
  border-radius: 999px;
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 12px;
  color: #fff; font-size: 13px; font-weight: 700;
  transition: width 0.4s ease;
  min-width: 60px;
}
.stepper__check {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; color: var(--muted);
}
.stepper__ticks { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: center; padding: 0 14px; }
.stepper__ticks i { width: 3px; height: 8px; border-radius: 3px; background: #2a3550; }

/* completed section header (grey with minus / check) */
.wizard-step-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 20px; font-weight: 700; margin: 6px 0;
}
.wizard-step-title.done { color: var(--blue-bright); }
.wizard-step-title.muted { color: var(--muted-2); }
.ok-badge {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.ok-badge svg { width: 15px; height: 15px; }
.dim-badge {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--red); color: var(--red);
  display: inline-flex; align-items: center; justify-content: center;
}

.help-text { color: var(--muted); font-size: 15px; line-height: 1.5; margin: 6px 0 14px; }

/* preview screenshot block inside wizard */
.shot {
  border: 1px solid var(--blue);
  border-radius: 12px;
  overflow: hidden;
  background: #0b1220;
  aspect-ratio: 16 / 8;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-2); font-size: 12px; text-align: center; padding: 10px;
}

/* avatar uploader */
.avatar-upload { display: flex; justify-content: center; margin: 8px 0 18px; }
.avatar-upload__circle {
  position: relative;
  width: 116px; height: 116px; border-radius: 50%;
  background: #101a2c; border: 2px solid #253048;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.avatar-upload__circle img { width: 100%; height: 100%; object-fit: cover; }
.avatar-upload__circle > svg { width: 54px; height: 54px; color: #33415e; }
.avatar-upload__add {
  position: absolute; right: 4px; bottom: 4px;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--blue); color: #fff; border: 3px solid var(--bg-top);
  display: flex; align-items: center; justify-content: center;
}
.avatar-upload__add svg { width: 18px; height: 18px; }
.avatar-upload input { display: none; }

/* --------------------------------------------------------------- congrats */
.congrats-wrap { position: relative; }
.congrats-sub { text-align: center; color: #cdd6e4; font-size: 16px; margin-top: 4px; }
.congrats-card {
  margin-top: 30px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 70px 22px 26px;
  text-align: center;
  position: relative;
}
.congrats-card__avatar {
  position: absolute; top: -46px; left: 50%; transform: translateX(-50%);
  width: 92px; height: 92px; border-radius: 50%;
  border: 4px solid #cdd6e4; overflow: hidden; background: #1c2740;
}
.congrats-card h2 { font-size: 26px; font-weight: 800; margin: 0 0 12px; }
.congrats-card p { color: var(--muted); font-size: 15px; line-height: 1.5; margin: 0 0 22px; }

/* fireworks (decorative) */
.fireworks { position: absolute; inset: 0 0 auto; height: 200px; pointer-events: none; overflow: hidden; }

/* --------------------------------------------------------------- tariffs */
.tariff-card { margin-bottom: 26px; }
.tariff-card h3 { font-size: 22px; font-weight: 800; margin: 0 0 14px; }
.tariff-card__row { display: flex; gap: 16px; align-items: center; }
.tariff-icon {
  width: 96px; height: 96px; border-radius: 16px; flex: none;
  background: linear-gradient(160deg, #17223a, #0e1626);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.tariff-icon svg { width: 60px; height: 60px; }
.tariff-info { flex: 1; }
.tariff-info dt { font-size: 16px; font-weight: 700; color: #fff; }
.tariff-info dd { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.tariff-card .btn { margin-top: 16px; }

/* --------------------------------------------------------------- order */
.order-summary { margin: 20px 0; }
.order-summary .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 16px; }
.order-summary .row b { font-weight: 700; }
.order-summary .row span { color: #cdd6e4; }
.pay-methods-title { text-align: center; font-size: 24px; font-weight: 800; margin: 22px 0 16px; }
.pay-method {
  display: flex; align-items: center; justify-content: center; position: relative;
  border: 1px dashed #35415c;
  border-radius: 14px; padding: 18px; font-size: 17px; color: #eef2f8; font-weight: 600;
}
.pay-method svg.lock { position: absolute; right: 18px; color: var(--blue); width: 22px; height: 22px; }

/* --------------------------------------------------------------- my clubs */
.club-row {
  display: flex; align-items: center; gap: 16px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 16px 18px; margin-bottom: 14px;
  color: inherit;
}
.club-row__avatar { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; background: #1c2740; flex: none; }
.club-row__name { flex: 1; font-size: 18px; font-weight: 700; }
.club-row__chevron { color: var(--blue); }
.club-row__chevron svg { width: 22px; height: 22px; }

/* --------------------------------------------------------------- employee */
.select {
  position: relative;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
}
.select__avatar { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; background: #1c2740; flex: none; }
.select__name { flex: 1; font-size: 18px; font-weight: 700; }
.select__chevron { color: #cdd6e4; }
.select__options { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.select__option {
  display: flex; align-items: center; gap: 14px;
  border-radius: 14px; padding: 12px 14px; border: 1px solid transparent;
}
.select__option.active { background: #10203e; border-color: var(--blue); }
.select__option .select__avatar { width: 48px; height: 48px; }

.notice-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 24px 20px; text-align: center;
}
.notice-card svg { width: 44px; height: 44px; color: var(--blue); margin-bottom: 12px; }
.notice-card p { margin: 0; color: #cdd6e4; font-size: 16px; line-height: 1.5; }

/* --------------------------------------------------------------- club page */
.club-hero { text-align: center; }
.club-hero__avatar {
  width: 116px; height: 116px; border-radius: 50%;
  border: 4px solid #cdd6e4; overflow: hidden; background: #1c2740;
  margin: 0 auto -50px; position: relative; z-index: 2;
}
.club-hero__card {
  background: var(--card-2); border: 1px solid var(--border);
  border-radius: 20px; padding: 66px 20px 22px;
}
.club-hero__card h2 { font-size: 26px; font-weight: 800; margin: 0 0 12px; }
.club-hero__card p { color: var(--muted); font-size: 15px; line-height: 1.5; margin: 0 0 14px; }
.club-hero__created { color: #aeb8c8; font-size: 14px; }

.info-block { margin-top: 16px; }
.info-block__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.info-block__head h3 { font-size: 24px; font-weight: 800; margin: 0; }
.info-block__head svg { width: 24px; height: 24px; color: #cdd6e4; }
.info-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 16px; }
.info-row b { font-weight: 700; }
.info-row span { color: #cdd6e4; text-align: right; }
.info-row a { word-break: break-all; }

.sub-tariff { display: flex; gap: 14px; align-items: center; margin-top: 14px; }
.sub-tariff .tariff-icon { width: 76px; height: 76px; }
.sub-tariff dl { margin: 0; flex: 1; }
.sub-tariff .info-row { padding: 3px 0; }

/* --------------------------------------------------------------- delete */
.delete-hero { text-align: center; }
.confirm-strong { font-size: 20px; font-weight: 800; }

/* --------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(10px);
  background: #1b2536; color: #cdd6e4;
  padding: 14px 18px; border-radius: 12px; font-size: 15px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
  opacity: 0; transition: opacity .2s, transform .2s; z-index: 60;
  width: min(390px, 92vw); justify-content: center;
}
.toast svg { width: 20px; height: 20px; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --------------------------------------------------------------- modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(4, 8, 16, 0.72);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fade .18s ease;
}
.modal {
  width: 100%; max-width: 360px;
  background: var(--card-2); border: 1px solid var(--border);
  border-radius: 22px; padding: 60px 22px 22px; text-align: center; position: relative;
}
.modal__avatar {
  position: absolute; top: -44px; left: 50%; transform: translateX(-50%);
  width: 88px; height: 88px; border-radius: 50%;
  border: 4px solid #cdd6e4; overflow: hidden; background: #1c2740;
}
.modal h3 { font-size: 22px; font-weight: 800; margin: 0 0 6px; }
.modal p { color: #cdd6e4; font-size: 16px; margin: 0 0 20px; }
.modal__actions { display: flex; gap: 12px; }
.modal__actions .btn { padding: 15px; font-size: 16px; }

/* misc */
.spacer-sm { height: 8px; }
.spacer { height: 16px; }
.hidden { display: none !important; }
