/* МУРАВЕЙ — экраны заказа: создание, детали, отзыв, жалоба (owner: orders, docs/CONTRACT.md §7.4).
   Общие классы (.card, .form, .field, .input, .info-block, .toggle-row, .modal…) лежат в common.css,
   здесь только то, что нужно этим четырём экранам. Корень каждого экрана: .view.<name>-view.orders-view. */

/* ===== Кнопки во время запроса: спиннер справа от подписи ===== */
.orders-view .btn-next.busy::after,
.orders-view .btn-secondary.busy::after,
.orders-view .btn-danger.busy::after {
  content: '';
  display: inline-block; vertical-align: -2px;
  width: 14px; height: 14px; margin-left: 10px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ===== Карточка «кому заказ» (создание, отзыв, жалоба) ===== */
.order-target { display: flex; align-items: center; gap: 14px; }
.order-target-hex {
  flex-shrink: 0; width: 48px; height: 55px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(165deg, #FFDE5A 0%, #F0BB10 100%);
  clip-path: var(--hex-clip);
}
.order-target-hex svg { width: 22px !important; height: 22px !important; color: var(--ink); }
.order-target-body { flex: 1; min-width: 0; }
.order-target-kicker {
  font-size: 10px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--yellow);
}
.order-target-name { margin: 2px 0 4px; font-size: 16px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.order-target-text { margin-top: 3px; font-size: 12px; line-height: 1.4; color: rgba(245, 247, 250, 0.85); }

/* ===== Создание заказа ===== */
.suggest-wrap { position: relative; }
.suggest-list {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 240px; margin: 0; padding: 4px;
  overflow-y: auto; list-style: none;
  background: #0F2140;
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.suggest-list li {
  display: flex; align-items: center; min-height: 40px;
  padding: 10px 12px; border-radius: 8px;
  font-size: 14px; line-height: 1.3; cursor: pointer;
}
.suggest-list li:hover, .suggest-list li.active { background: rgba(255, 214, 64, 0.12); color: var(--yellow); }
.order-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.order-chips .chip { max-width: 100%; min-height: 40px; padding: 7px 12px; overflow: hidden; text-overflow: ellipsis; }
.order-form .photo-picker.invalid { outline: 1.5px solid var(--danger); outline-offset: 4px; border-radius: 12px; }

/* ===== Детали заказа: сводка ===== */
.order-summary-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 12px; margin-bottom: 12px; }
.order-summary-service { display: flex; align-items: center; gap: 12px; min-width: 0; }
.order-hex {
  flex-shrink: 0; width: 40px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(165deg, #FFDE5A 0%, #F0BB10 100%);
  clip-path: var(--hex-clip);
}
.order-hex svg { width: 20px !important; height: 20px !important; color: var(--ink); }
.order-summary-title { font-size: 17px; font-weight: 800; line-height: 1.2; }
.order-summary-sub { margin-top: 2px; font-size: 11px; color: var(--text-muted); }
.order-summary-desc { margin: 0 0 14px; font-size: 14px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.order-facts { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.order-fact { display: flex; align-items: flex-start; gap: 10px; }
.order-fact > svg { flex-shrink: 0; width: 16px !important; height: 16px !important; margin-top: 1px; color: var(--yellow); }
.order-fact > div { min-width: 0; }
.order-fact-label { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.order-fact-value { margin-top: 1px; font-size: 14px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.order-fact-note { margin-top: 1px; font-size: 12px; color: var(--text-muted); }

.order-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin-top: 14px; }
.order-photo {
  position: relative; aspect-ratio: 1; padding: 0;
  overflow: hidden; cursor: zoom-in;
  background: var(--panel-soft);
  border: 1px solid var(--line-soft); border-radius: 12px;
}
.order-photo img, .order-photo video { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s; }
.order-photo:hover img, .order-photo:hover video { transform: scale(1.05); }
.order-photo.video::after {
  content: ''; position: absolute; left: 6px; bottom: 6px;
  width: 22px; height: 22px;
  background: rgba(8, 20, 38, 0.85) center / 10px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath fill='%23FFD640' d='M2 1l7 4-7 4z'/%3E%3C/svg%3E");
  border-radius: 50%; pointer-events: none;
}

/* ===== Детали заказа: мастер / заказчик, контакты ===== */
.order-searching { display: flex; align-items: center; gap: 14px; }
.order-searching .loading-hex { flex-shrink: 0; width: 34px; height: 39px; }
.order-searching-title { font-size: 14px; font-weight: 800; color: var(--yellow); }
.order-searching-text { margin-top: 2px; font-size: 12px; line-height: 1.4; color: rgba(245, 247, 250, 0.8); }

.contact-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.contact-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line-soft); border-radius: 12px;
  font-size: 14px; font-weight: 600; color: var(--text); text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
a.contact-link:hover { border-color: rgba(255, 214, 64, 0.35); background: var(--panel); }
.contact-link > svg { flex-shrink: 0; width: 18px !important; height: 18px !important; color: var(--yellow); }
.contact-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.contact-kind { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.contact-value { overflow-wrap: anywhere; }

/* ===== Детали заказа: кнопки ===== */
.order-actions-wrap { margin-top: 16px; }
.order-hint {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 12px; padding: 12px 14px;
  border: 1px dashed rgba(255, 214, 64, 0.3); border-radius: 12px;
  font-size: 13px; line-height: 1.4; color: rgba(245, 247, 250, 0.8);
}
.order-hint svg { flex-shrink: 0; width: 16px !important; height: 16px !important; color: var(--yellow); }
.order-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.order-actions > button { position: relative; flex: 1 1 calc(50% - 5px); min-width: 140px; margin-top: 0; padding: 14px 10px; font-size: 13px; letter-spacing: 0.08em; }
.order-actions > .btn-next { flex-basis: 100%; }
.order-payment-note { margin-top: 16px; }

/* ===== Детали заказа: ход заказа ===== */
.timeline { margin: 0; list-style: none; }
.tl-step { position: relative; display: flex; gap: 14px; padding-bottom: 18px; }
.tl-step:last-child { padding-bottom: 0; }
.tl-step:not(:last-child)::before {
  content: ''; position: absolute; left: 8px; top: 24px; bottom: 3px; width: 2px;
  background: rgba(255, 214, 64, 0.15);
}
.tl-step.linked::before { background: var(--yellow); }
.tl-dot { flex-shrink: 0; width: 18px; height: 20px; background: var(--hex-empty); clip-path: var(--hex-clip); }
.tl-step.done .tl-dot, .tl-step.current .tl-dot { background: var(--yellow); }
.tl-step.stopped .tl-dot { background: var(--danger); }
.tl-step.current .tl-dot { animation: tlPulse 1.6s ease-in-out infinite; }
@keyframes tlPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.8); }
}
.tl-body { min-width: 0; }
.tl-title { font-size: 14px; font-weight: 800; line-height: 20px; }
.tl-step.todo .tl-title { font-weight: 700; color: var(--text-muted); }
.tl-step.stopped .tl-title { color: var(--danger); }
.tl-time { margin-top: 1px; font-size: 11px; color: var(--text-muted); }
.tl-reason { margin-top: 4px; font-size: 12px; line-height: 1.4; color: rgba(245, 247, 250, 0.85); overflow-wrap: anywhere; }

/* ===== Реквизиты для оплаты (модалка) ===== */
.pay-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pay-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line-soft); border-radius: 12px;
}
.pay-info { flex: 1; min-width: 0; }
.pay-label { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.pay-value { margin-top: 2px; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pay-copy {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  background: transparent; border: 1px solid var(--line); border-radius: 10px;
  color: var(--yellow); cursor: pointer;
  transition: background 0.2s;
}
.pay-copy:hover { background: rgba(255, 214, 64, 0.1); }
.pay-copy svg { width: 16px !important; height: 16px !important; }

/* ===== Просмотр фото ===== */
.lightbox { max-width: min(720px, 100%); background: rgba(8, 20, 38, 0.97); }
.lightbox .modal-body { padding: 0 12px 12px; }
.lightbox-body { position: relative; display: flex; align-items: center; justify-content: center; min-height: 160px; }
.lightbox-media { display: block; max-width: 100%; max-height: 70vh; object-fit: contain; border-radius: 12px; }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  background: rgba(8, 20, 38, 0.75); border: 1px solid var(--line); border-radius: 50%;
  color: var(--yellow); cursor: pointer;
}
.lightbox-nav[data-step='-1'] { left: 8px; }
.lightbox-nav[data-step='1'] { right: 8px; }
.lightbox-nav svg { width: 18px !important; height: 18px !important; }
.lightbox-count {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  padding: 3px 10px; border-radius: 999px;
  background: rgba(8, 20, 38, 0.75);
  font-size: 11px; font-weight: 700; color: var(--text);
}

/* ===== Отзыв: пять сот ===== */
.rate-hexes { display: flex; justify-content: center; gap: clamp(4px, 2vw, 10px); padding: 8px 0 2px; }
.rate-hex {
  position: relative; display: block; flex: 0 1 auto;
  width: clamp(44px, 15vw, 62px); aspect-ratio: 1 / 1.15;
  border-radius: 14px; cursor: pointer;
  transition: transform 0.15s;
}
.rate-hex:hover { transform: scale(1.06); }
.rate-hex:active { transform: scale(0.94); }
.rate-hex:has(.rate-input:focus-visible) { outline: 2px solid var(--yellow); outline-offset: 2px; }
.rate-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.rate-hex-shape {
  display: block; width: 100%; height: 100%;
  background: var(--hex-empty); clip-path: var(--hex-clip);
  transition: background 0.15s;
}
.rate-hex.on .rate-hex-shape { background: linear-gradient(165deg, #FFDE5A 0%, #FFD640 35%, #F0BB10 100%); }
.rate-caption { min-height: 22px; text-align: center; font-size: 16px; font-weight: 800; color: var(--yellow); }
.rate-caption.empty { font-size: 13px; font-weight: 600; color: var(--text-muted); }

/* ===== Жалоба: причины ===== */
.reason-list { display: flex; flex-direction: column; gap: 8px; }
.reason-card {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 14px;
  background: var(--panel-soft);
  border: 1.5px solid rgba(255, 214, 64, 0.18); border-radius: 12px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.reason-card:hover { border-color: rgba(255, 214, 64, 0.4); }
.reason-card.checked { background: rgba(255, 214, 64, 0.1); border-color: var(--yellow); }
.reason-list.invalid .reason-card:not(.checked) { border-color: rgba(248, 113, 113, 0.5); }
.reason-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.reason-mark {
  position: relative; flex-shrink: 0; width: 20px; height: 20px;
  border: 1.5px solid rgba(255, 214, 64, 0.5); border-radius: 50%;
  transition: border-color 0.2s;
}
.reason-mark::after {
  content: ''; position: absolute; inset: 3px;
  border-radius: 50%; background: var(--yellow);
  transform: scale(0); transition: transform 0.15s;
}
.reason-card.checked .reason-mark { border-color: var(--yellow); }
.reason-card.checked .reason-mark::after { transform: scale(1); }
.reason-input:focus-visible + .reason-mark { outline: 2px solid var(--yellow); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .tl-step.current .tl-dot { animation: none; }
}
