/* =============================================================
   RENTROP HR — MOBILE (Telegram WebApp)
   iPhone 15 frame: 393 × 852 (width fixed — height scrolls)
   ============================================================= */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  min-height: 100vh;
  background: var(--color-navy-700);
  font-family: var(--font-ui);
  color: var(--color-text-primary);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
img, svg { display: block; }

/* =================================================
   APP SHELL — fixed 393px column inside black page
   ================================================= */

.phone {
  width: var(--mobile-width);
  min-height: var(--mobile-height);
  margin: 0 auto;
  background: var(--color-navy-700);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ---------- Status bar (iOS 9:41) ---------- */
.status-bar {
  height: var(--mobile-status-h);
  position: relative;
  display: flex;
  align-items: flex-start;
  padding-top: 11px;
  color: var(--color-status-icon);
  font-family: 'SF Pro Text', -apple-system, system-ui, sans-serif;
  font-size: 17px;
  font-weight: 600;
}
.status-bar__time {
  padding-left: 34px;
  letter-spacing: -0.3px;
}
.status-bar__island {
  position: absolute;
  left: 50%;
  top: 11px;
  transform: translateX(-50%);
  width: 125px;
  height: 37px;
  background: var(--color-dynamic-island);
  border-radius: 100px;
}
.status-bar__icons {
  position: absolute;
  right: 22px;
  top: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-bar__icons svg { fill: #fff; }

/* ---------- Telegram header ---------- */
.tg-header {
  height: var(--mobile-tg-header-h);
  background: var(--color-navy-900);
  border-radius: var(--radius-tg-header);
  padding: 11px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--color-text-on-dark);
  font-family: var(--font-tg);
  position: relative;
  z-index: 2;
}
.tg-header__close {
  font-family: var(--font-tg);
  font-size: 16px;
  font-weight: 400;
  color: #fff;
  width: 60px;
}
.tg-header__info {
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.tg-header__title {
  font-size: var(--fs-tg-title);
  font-weight: 700;
  line-height: 19px;
}
.tg-header__subtitle {
  font-size: var(--fs-tg-subtitle);
  font-weight: 400;
  line-height: 16px;
  opacity: 0.6;
}
.tg-header__menu {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  border: 1px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.tg-header__menu span {
  width: 3px;
  height: 3px;
  background: #fff;
  border-radius: 50%;
}

/* ---------- App space (big blue container below TG header) ---------- */
.app-space {
  flex: 1;
  background: var(--color-navy-700);
  display: flex;
  flex-direction: column;
  min-height: calc(var(--mobile-height) - var(--mobile-status-h) - var(--mobile-tg-header-h));
}

/* ---------- Screen title (home, chat, etc.) ---------- */
.screen-title {
  height: var(--mobile-title-h);
  background: var(--grad-header);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--color-text-on-dark);
  font-size: var(--fs-screen-title);
  font-weight: 500;
  line-height: 1;
  padding: 16px 0;
  flex-shrink: 0;
}
.screen-title__icon {
  width: 24px;
  height: 24px;
  color: var(--color-gold-500);
}
.screen-title__icon svg { width: 100%; height: 100%; stroke: currentColor; fill: currentColor; }

/* Secondary strip under title (e.g. «Продолжите регистрацию») */
.title-strip {
  background: var(--color-navy-700);
  padding: 0 16.5px 16px;
  flex-shrink: 0;
}
.title-strip__card {
  width: 100%;
  height: 32px;
  background: var(--color-surface-blue2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.title-strip__left {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xsmall);
  color: var(--color-text-primary);
}
.title-strip__left svg { width: 14px; height: 14px; stroke: var(--color-text-primary); }
.title-strip__right {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xsmall);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-text-primary);
}
.title-strip__arrow {
  width: 16px;
  height: 16px;
  background: var(--grad-cta);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.title-strip__arrow svg {
  width: 10px;
  height: 10px;
  stroke: #fff;
  stroke-width: 2.5;
}

/* ---------- Main content area ---------- */
.main-space {
  flex: 1;
  background: var(--color-bg-content);
  border-radius: var(--radius-main-space);
  padding: 20px 16.5px calc(var(--mobile-navmenu-h) + 12px);
  position: relative;
  overflow: hidden;
}

/* ---------- Bottom nav ---------- */
.navmenu {
  position: absolute;
  bottom: 0;
  left: -0.5px;
  width: calc(var(--mobile-width) + 1px);
  height: var(--mobile-navmenu-h);
  background: var(--grad-nav);
  border-radius: var(--radius-main-space);
  padding: 10px 21px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2;
}
.navmenu__item {
  flex: 1;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #fff;
  transition: opacity .15s ease;
}
.navmenu__item:hover { opacity: 0.85; }
.navmenu__item svg { width: 24px; height: 24px; stroke: currentColor; fill: none; }
/* home icon is filled-style */
.navmenu__item .icon-home svg { fill: currentColor; stroke: none; }
.navmenu__item--active {
  border: 1px solid #fff;
  color: var(--color-gold-500);
}
.navmenu__item--disabled {
  color: rgba(255,255,255,0.4);
  pointer-events: none;
}
.navmenu__label {
  font-size: var(--fs-xsmall);
  font-weight: 400;
  line-height: 1;
}

/* =================================================
   CONTENT BUILDING BLOCKS
   ================================================= */

.content-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* A white card containing the expandable rows ---------------- */
.card {
  background: var(--color-surface-white);
  border-radius: var(--radius-lg);
  padding: 12px;
  width: 100%;
}
.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
}
.card__header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.card__badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--grad-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.card__badge svg { width: 16px; height: 16px; stroke: #fff; fill: #fff; }
.card__badge img {
  width: 14px;
  height: 14px;
  filter: brightness(0) invert(1); /* force white */
}
.card__badge--text {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

/* Icon color hacks for img-based SVG icons (handoff keeps inline monochrome) */
.icon-white img,
.screen-title__icon img {
  filter: brightness(0) saturate(100%) invert(83%) sepia(24%) saturate(866%) hue-rotate(358deg) brightness(95%) contrast(89%);
  /* approximates #E7C768 gold */
}
.screen-title__icon img {
  width: 24px; height: 24px;
}
.card__chevron img,
.sub-row__chevron img {
  width: 100%; height: 100%;
  filter: brightness(0) saturate(100%) invert(83%) sepia(24%) saturate(866%) hue-rotate(358deg) brightness(95%) contrast(89%);
}
.navmenu__item img {
  width: 24px; height: 24px;
  filter: brightness(0) invert(1);
}
.navmenu__item--active img {
  filter: brightness(0) saturate(100%) invert(83%) sepia(24%) saturate(866%) hue-rotate(358deg) brightness(95%) contrast(89%);
}
.navmenu__item--disabled img { opacity: 0.4; }
.navmenu__badge {
  position: absolute;
  top: 2px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #E53935;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}
.navmenu__item { position: relative; }

.title-strip__left img { filter: none; width: 14px; height: 14px; }
.title-strip__arrow img { filter: brightness(0) invert(1); width: 10px; height: 10px; }
.card__title {
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-text-primary);
  letter-spacing: 0.02em;
}
.card__title--plain {
  font-weight: 400;
  text-transform: none;
}
.card__subtitle {
  font-size: var(--fs-small);
  color: var(--color-text-primary);
  margin-top: 4px;
  line-height: 1.2;
}
.card__chevron {
  width: 24px;
  height: 24px;
  color: var(--color-gold-500);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.card__chevron svg { width: 13px; height: 8px; stroke: currentColor; stroke-width: 2; }

/* HR chip inside welcome card */
.hr-chip {
  margin-top: 16px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-mint);
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-small);
  color: var(--color-text-primary);
}
.hr-chip svg { width: 16px; height: 16px; stroke: var(--color-text-primary); }

/* Sub-rows (accordion items) inside the white card */
.sub-row {
  background: var(--color-surface-blue);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  margin-top: 4px;
}
.sub-row:first-child { margin-top: 16px; }
.sub-row__label {
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.2;
}
.sub-row__chevron {
  width: 20px;
  height: 20px;
  color: var(--color-gold-500);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sub-row__chevron svg { width: 11px; height: 7px; stroke: currentColor; stroke-width: 2; }
.sub-row--expanded {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 8px;
}
.sub-row--expanded .sub-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Video placeholder ---------------------------------------- */
.video-box {
  width: 100%;
  height: 180px;
  background: var(--color-navy-900);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-box__play {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-box__play svg { width: 26px; height: 26px; fill: #fff; margin-left: 3px; }

/* Stats 2x2 grid ------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 10px;
}
.stats__item { display: flex; flex-direction: column; gap: 4px; }
.stats__value {
  font-size: var(--fs-huge);
  font-weight: 600;
  line-height: 1.1;
  color: var(--color-text-primary);
}
.stats__label {
  font-size: var(--fs-small);
  line-height: 1.25;
  color: var(--color-text-primary);
}

/* =================================================
   CHAT
   ================================================= */
.chat-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-ghost);
  font-size: var(--fs-small);
  text-align: center;
}
.chat-input {
  position: absolute;
  left: 16.5px;
  right: 16.5px;
  bottom: calc(var(--mobile-navmenu-h) + 12px);
  height: 48px;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-input input {
  flex: 1;
  border: 0;
  outline: 0;
  font: inherit;
  font-size: var(--fs-small);
  color: var(--color-text-muted);
  background: transparent;
}
.chat-input input::placeholder { color: var(--color-text-muted); }

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 60px;
}
.chat-bubble {
  max-width: 80%;
  padding: 10px 12px;
  border-radius: 16px;
  font-size: var(--fs-small);
  line-height: 1.3;
  word-wrap: break-word;
}
.chat-bubble--in {
  align-self: flex-start;
  background: #fff;
  color: var(--color-text-primary);
  border-bottom-left-radius: 4px;
}
.chat-bubble--out {
  align-self: flex-end;
  background: var(--color-navy-700);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-meta {
  font-size: 10px;
  opacity: 0.6;
  margin-top: 2px;
  text-align: right;
}

/* =================================================
   PROGRESS SCREEN
   ================================================= */
.progress-step {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 16px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.progress-step__num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}
.progress-step--done .progress-step__num {
  background: var(--grad-gold);
  color: #fff;
}
.progress-step--active .progress-step__num {
  background: var(--color-navy-700);
  color: var(--color-gold-500);
}
.progress-step--locked .progress-step__num {
  background: #E0E0E0;
  color: #999;
}
.progress-step__body { flex: 1; }
.progress-step__title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}
.progress-step__meta {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
}
.progress-step__status {
  width: 24px;
  height: 24px;
  color: var(--color-gold-500);
  flex-shrink: 0;
}
.progress-step__status svg { width: 100%; height: 100%; stroke: currentColor; fill: none; }

.progress-bar {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.progress-bar__head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.progress-bar__track {
  height: 6px;
  background: #EAEAEA;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  background: var(--grad-gold);
  border-radius: 999px;
}

/* =================================================
   PROJECTS
   ================================================= */
.project-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.project-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.project-card__title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}
.project-card__badge {
  background: var(--color-surface-blue);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 500;
  color: var(--color-navy-900);
}
.project-card__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* =================================================
   LEARNING
   ================================================= */
.lesson-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 16px 12px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.lesson-card__thumb {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: var(--grad-header);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gold-500);
}
.lesson-card__thumb svg { width: 28px; height: 28px; stroke: currentColor; fill: currentColor; }
.lesson-card__body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.lesson-card__title { font-size: 14px; font-weight: 500; line-height: 1.2; }
.lesson-card__meta { font-size: 12px; color: var(--color-text-muted); }
.lesson-card__status { width: 24px; height: 24px; color: var(--color-gold-500); flex-shrink: 0; }
.lesson-card--locked { opacity: 0.5; }
.lesson-card--locked .lesson-card__thumb { background: #E0E0E0; color: #888; }
