/* ============================================================
   Юмедиа Сервис — личный кабинет клиента
   Светлая «банковская» тема, акцент — фирменный золотой remont3
   ============================================================ */

:root {
  /* Фирменная палитра Юмедиа (снята с remont3.ru) */
  --gold:        #E6007E;  /* главный бренд-цвет — малиновая магента */
  --gold-press:  #C2006A;
  --gold-soft:   #FDE3F1;  /* бледно-розовый фон */
  --gold-ink:    #FFFFFF;  /* текст на магенте */

  --teal:        #0E7C8A;  /* вторичный акцент */
  --yellow:      #FFD21F;  /* жёлтый — только телефон */

  --ink:         #15181C;
  --ink-2:       #3C424B;
  --muted:       #757D88;
  --faint:       #9AA1AB;

  --page:        #F6F6F6;
  --card:        #FFFFFF;
  --line:        #E9EBEE;
  --line-soft:   #F2F3F4;

  --green:       #14935A;  --green-bg:  #E6F5ED;
  --blue:        #0E7C8A;  --blue-bg:   #E1F1F3;  /* «в работе» — фирменная бирюза */
  --orange:      #E08A00;  --orange-bg: #FDEFD2;
  --gray:        #7C8694;  --gray-bg:   #EEF0F3;

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;

  --shadow-card: 0 1px 2px rgba(20,24,28,.04), 0 6px 20px rgba(20,24,28,.05);
  --shadow-pop:  0 8px 30px rgba(20,24,28,.12);

  --col: 440px;
  --pad: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.45;
}
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

/* ---- App shell: телефонная колонка, по центру на десктопе ---- */
.app {
  position: relative;
  width: 100%;
  max-width: var(--col);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--page);
  overflow: hidden;
}
@media (min-width: 600px) {
  body { padding: 28px 0; background: #E4E6EA; }
  .app {
    min-height: min(880px, calc(100dvh - 56px));
    height: min(880px, calc(100dvh - 56px));
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(20,24,28,.18), 0 2px 8px rgba(20,24,28,.08);
    border: 1px solid rgba(20,24,28,.05);
  }
}

/* ---- Screens ---- */
.screen { display: none; flex-direction: column; height: 100dvh; }
@media (min-width: 600px) { .screen { height: 100%; } }
.screen[data-active] { display: flex; }
.screen--center { align-items: center; justify-content: center; }
.screen--app { background: var(--page); }

/* ---- Loader ---- */
.loader { display: flex; gap: 8px; }
.loader__dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gold);
  animation: bounce 1.2s infinite ease-in-out both;
}
.loader__dot:nth-child(1){ animation-delay: -.24s; }
.loader__dot:nth-child(2){ animation-delay: -.12s; }
@keyframes bounce { 0%,80%,100%{ transform: scale(.5); opacity:.4 } 40%{ transform: scale(1); opacity:1 } }

/* ============================================================
   AUTH
   ============================================================ */
.screen--auth { background: var(--card); }
.auth {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-top) + 28px) var(--pad) calc(var(--safe-bot) + 22px);
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand__mark {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 700; font-size: 24px; line-height: 1;
  box-shadow: 0 4px 14px rgba(230,0,126,.38);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.18; }
.brand__name { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand__sub { font-size: 12.5px; color: var(--faint); font-weight: 500; }

.auth__body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 8px 0; }
.auth__title { font-size: 27px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 10px; }
.auth__lead { font-size: 15px; color: var(--muted); margin: 0 0 26px; max-width: 30ch; }
.auth__legal { font-size: 12px; color: var(--faint); text-align: center; line-height: 1.4; min-height: 1em; }

.topback {
  width: 40px; height: 40px; border-radius: 12px;
  border: none; background: var(--line-soft); color: var(--ink-2);
  display: grid; place-items: center; margin-bottom: 6px;
  transition: background .15s;
}
.topback:active { background: var(--line); }

/* ---- Fields ---- */
.field { display: block; }
.field__label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 8px; }
.field__input {
  width: 100%; height: 56px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  padding: 0 16px;
  font-size: 17px; font-weight: 500; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.field__input::placeholder { color: var(--faint); font-weight: 400; }
.field__input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(230,0,126,.16); }
.field__input--phone { letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.field__input.is-error { border-color: #DD3B3B; box-shadow: 0 0 0 4px rgba(221,59,59,.10); }

.form-error { color: #D23B3B; font-size: 13px; margin: 9px 2px 0; min-height: 18px; line-height: 1.35; }

/* ---- Buttons ---- */
.btn {
  position: relative;
  width: 100%; height: 54px;
  border: none; border-radius: var(--r-md);
  font-size: 16px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .08s, background .15s, opacity .15s;
}
.btn:active { transform: scale(.985); }
.btn--primary { background: var(--gold); color: var(--gold-ink); margin-top: 18px; }
.btn--primary:active { background: var(--gold-press); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.is-loading .btn__label { visibility: hidden; }
.btn__spinner {
  position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff;
  display: none; animation: spin .7s linear infinite;
}
.btn.is-loading .btn__spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- OTP ---- */
.otp { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.otp__cell {
  height: 64px; width: 100%;
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: var(--card);
  text-align: center;
  font-size: 26px; font-weight: 600; color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.otp__cell:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(230,0,126,.16); }
.otp__cell.is-filled { border-color: var(--gold); background: var(--gold-soft); }
.otp.is-error .otp__cell { border-color: #DD3B3B; }
.otp.shake { animation: shake .4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-6px)} 40%,80%{transform:translateX(6px)} }

.resend { margin-top: 22px; text-align: center; min-height: 22px; }
.resend__timer { font-size: 14px; color: var(--muted); }
.resend__btn { border: none; background: none; color: var(--gold-press); font-size: 15px; font-weight: 600; padding: 4px; }

/* ============================================================
   APP BAR
   ============================================================ */
.appbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-top) + 18px) var(--pad) 14px;
  background: var(--page);
}
.appbar--detail {
  position: sticky; top: 0; z-index: 5;
  background: rgba(241,242,244,.86);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  gap: 8px;
}
.appbar__greet { display: flex; flex-direction: column; line-height: 1.15; }
.appbar__hello { font-size: 13.5px; color: var(--muted); font-weight: 500; }
.appbar__name { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.appbar__title { font-size: 17px; font-weight: 600; }

.iconbtn {
  width: 42px; height: 42px; border-radius: 13px; flex: 0 0 auto;
  border: none; background: var(--card); color: var(--ink-2);
  display: grid; place-items: center;
  box-shadow: var(--shadow-card);
  transition: transform .08s;
}
.iconbtn:active { transform: scale(.93); }
.iconbtn--ghost { background: none; box-shadow: none; pointer-events: none; }

/* ---- Scroll region ---- */
.scroll {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 6px var(--pad) calc(var(--safe-bot) + 28px);
}

/* ============================================================
   СПИСОК РЕМОНТОВ
   ============================================================ */
.section-head {
  display: flex; align-items: baseline; gap: 8px;
  margin: 20px 4px 12px;
}
.section-head:first-child { margin-top: 8px; }
.section-head__title { font-size: 14px; font-weight: 600; color: var(--ink-2); letter-spacing: .01em; }
.section-head__count {
  font-size: 12px; font-weight: 600; color: var(--muted);
  background: var(--line); border-radius: 20px; padding: 1px 9px;
}

.cards { display: flex; flex-direction: column; gap: 12px; }

.rcard {
  display: block; width: 100%; text-align: left;
  background: var(--card); border: none;
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  transition: transform .1s, box-shadow .15s;
}
.rcard:active { transform: scale(.985); box-shadow: 0 1px 2px rgba(20,24,28,.04); }
.rcard__top { display: flex; align-items: flex-start; gap: 13px; }
.rcard__icon {
  width: 46px; height: 46px; flex: 0 0 auto;
  border-radius: 13px; background: var(--line-soft);
  display: grid; place-items: center; color: var(--ink-2);
}
.rcard__main { flex: 1; min-width: 0; }
.rcard__device { display: block; font-size: 16px; font-weight: 600; letter-spacing: -.01em; margin: 1px 0 3px; }
.rcard__model { display: block; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rcard__chev { color: var(--faint); flex: 0 0 auto; margin-top: 12px; }

.rcard__meta {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line-soft);
}
.rcard__rec { font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 1px; }
.rcard__rec b { color: var(--ink-2); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---- Status badge ---- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; line-height: 1;
  padding: 7px 11px 7px 9px; border-radius: 20px; white-space: nowrap;
}
.badge__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.badge--green  { color: var(--green);  background: var(--green-bg); }
.badge--blue   { color: var(--blue);   background: var(--blue-bg); }
.badge--orange { color: var(--orange); background: var(--orange-bg); }
.badge--gray   { color: var(--gray);   background: var(--gray-bg); }

/* ---- Empty state ---- */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 64px 30px; gap: 14px; min-height: 60dvh;
}
.empty__icon {
  width: 76px; height: 76px; border-radius: 24px;
  background: var(--gold-soft); color: var(--gold-press);
  display: grid; place-items: center;
}
.empty__title { font-size: 18px; font-weight: 600; margin: 4px 0 0; }
.empty__text { font-size: 14.5px; color: var(--muted); max-width: 26ch; margin: 0; }

/* ============================================================
   КАРТОЧКА РЕМОНТА
   ============================================================ */
.detail { display: flex; flex-direction: column; gap: 14px; padding-top: 8px; }

.dhero {
  background: var(--card); border-radius: var(--r-lg);
  padding: 20px; box-shadow: var(--shadow-card);
}
.dhero__row { display: flex; align-items: flex-start; gap: 14px; }
.dhero__icon {
  width: 54px; height: 54px; flex: 0 0 auto; border-radius: 15px;
  background: var(--gold-soft); color: var(--gold-press);
  display: grid; place-items: center;
}
.dhero__device { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 4px; }
.dhero__model { font-size: 14px; color: var(--muted); margin: 0; }
.dhero__sep { height: 1px; background: var(--line-soft); margin: 16px 0; }
.dhero__facts { display: flex; gap: 22px; }
.fact { display: flex; flex-direction: column; gap: 3px; }
.fact__k { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.fact__v { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.dhero__status { margin-top: 16px; }

.block {
  background: var(--card); border-radius: var(--r-lg);
  padding: 18px 18px 20px; box-shadow: var(--shadow-card);
}
.block__title {
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em; margin: 0 0 14px;
}
.block__text { font-size: 15px; color: var(--ink-2); margin: 0; line-height: 1.5; }

/* ---- Timeline ---- */
.timeline { display: flex; flex-direction: column; }
.tl { position: relative; display: flex; gap: 14px; padding-bottom: 18px; }
.tl:last-child { padding-bottom: 0; }
.tl__rail { position: relative; flex: 0 0 auto; width: 18px; display: flex; justify-content: center; }
.tl__dot {
  width: 15px; height: 15px; border-radius: 50%; margin-top: 2px;
  background: var(--card); border: 2.5px solid var(--line); z-index: 1;
}
.tl__line { position: absolute; top: 16px; bottom: -4px; width: 2px; background: var(--line); }
.tl:last-child .tl__line { display: none; }
.tl--done .tl__dot { background: var(--green); border-color: var(--green); }
.tl--done .tl__line { background: var(--green); }
.tl--current .tl__dot {
  background: var(--gold); border-color: var(--gold);
  box-shadow: 0 0 0 5px rgba(230,0,126,.18);
}
.tl__body { display: block; padding-bottom: 2px; }
.tl__name { display: block; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.tl--current .tl__name { color: var(--gold-press); }
.tl__date { display: block; font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; margin-top: 1px; }

/* ---- Works list ---- */
.works { display: flex; flex-direction: column; gap: 0; }
.work { display: flex; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.work:first-child { padding-top: 0; border-top: none; }
.work__check {
  width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px;
  border-radius: 50%; background: var(--green-bg); color: var(--green);
  display: grid; place-items: center;
}
.work__main { flex: 1; }
.work__desc { display: block; font-size: 14.5px; color: var(--ink-2); line-height: 1.45; }
.work__date { display: block; font-size: 12px; color: var(--faint); margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ---- Price ---- */
.price { display: flex; flex-direction: column; gap: 0; }
.price__row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; }
.price__k { font-size: 14.5px; color: var(--muted); }
.price__v { font-size: 14.5px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.price__row--total {
  margin-top: 6px; padding-top: 14px; border-top: 1.5px solid var(--line);
}
.price__row--total .price__k { font-size: 16px; font-weight: 600; color: var(--ink); }
.price__row--total .price__v { font-size: 20px; font-weight: 700; color: var(--ink); }
.price__hint { font-size: 12.5px; color: var(--faint); margin: 10px 0 0; }

/* ---- People rows ---- */
.person { display: flex; align-items: center; gap: 13px; }
.person + .person { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.person__av {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 13px;
  background: var(--line-soft); color: var(--ink-2);
  display: grid; place-items: center; font-weight: 600; font-size: 15px;
}
.person__main { flex: 1; min-width: 0; }
.person__role { display: block; font-size: 12.5px; color: var(--muted); }
.person__name { display: block; font-size: 15px; font-weight: 600; color: var(--ink); margin-top: 1px; }

/* ---- Call button (sticky footer) ---- */
.callbar {
  position: sticky; bottom: 0;
  padding: 12px var(--pad) calc(var(--safe-bot) + 16px);
  background: linear-gradient(to top, var(--page) 62%, rgba(241,242,244,0));
}
.btn--call {
  background: var(--ink); color: #fff; gap: 9px; height: 56px;
}
.btn--call:active { background: #000; }
.btn--call svg { margin-top: -1px; }

.detail-wrap { display: flex; flex-direction: column; min-height: 100%; }

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

/* ---- Вход через Telegram (кнопка + ожидание привязки) ---- */
.btn--tg {
  width: 100%; margin-top: 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent; color: #2AABEE;
  border: 1.5px solid #BFE3F8; border-radius: var(--r-md);
  padding: 13px 16px; font-size: 15.5px; font-weight: 600;
}
.btn--tg:active { background: #EAF6FD; }

.tgwait { margin-top: 14px; padding: 16px; background: #F2F9FE; border-radius: var(--r-md); }
.tgwait__text { margin: 0 0 12px; font-size: 14.5px; color: var(--ink-2); }
.tgwait__open { display: block; text-align: center; text-decoration: none; }
.tgwait__hint {
  margin: 12px 0 0; font-size: 13px; color: var(--muted);
  display: flex; align-items: center; gap: 8px;
}
.tgwait__spinner {
  width: 14px; height: 14px; flex: 0 0 auto;
  border: 2px solid var(--line); border-top-color: #2AABEE; border-radius: 50%;
  animation: spin .8s linear infinite;
}
