:root {
  --ink: #12161d;
  --muted: #6b7280;
  --line: #d8dbe1;
  --paper: #ffffff;
  --soft: #f4f5f7;
  --green: #08a41f;
  --red: #e84d3d;
  --cyan: #14aed1;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

[data-bs-theme="dark"] body,
body.dark-mode {
  --paper: #171a21;
  --soft: #0f1115;
  --ink: #f3f4f6;
  --muted: #a1a1aa;
  --line: #30343c;
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  background: var(--paper);
  animation: loaderFade .45s ease forwards;
}
@keyframes loaderFade { to { opacity: 0; visibility: hidden; } }

.auth-strip {
  background: #101116;
  min-height: 76px;
  display: flex;
  align-items: center;
}
.nav-auth-wrap { display: flex; }
.auth-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, max-content));
  gap: 10px;
  justify-content: end;
}
.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 30px;
  border: 1px solid #20232b;
  border-radius: 7px;
  background: #1d1f27;
  color: #f8fafc;
  font-size: 26px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: inset 0 1px rgba(255,255,255,.04);
}
.auth-btn-wide { grid-column: 1 / -1; justify-self: end; }
.auth-btn:hover { color: #fff; background: #272a34; }

.brand-navbar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.brand-row {
  min-height: 92px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 26px;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  color: #111827;
  text-decoration: none;
  min-width: 0;
}
.brand-mark i {
  font-size: 74px;
  line-height: 1;
  -webkit-text-stroke: 2px currentColor;
}
.brand-mark span {
  color: var(--ink);
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 0;
}
.search-bar {
  justify-self: end;
  display: flex;
  align-items: center;
  width: min(360px, 100%);
}
.search-bar input {
  width: 100%;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 7px 0 0 7px;
  padding: 14px 16px;
  background: var(--paper);
  color: var(--ink);
}
.search-bar button,
.menu-btn {
  width: 76px;
  height: 76px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: 46px;
}
.search-bar button {
  border-radius: 0 7px 7px 0;
  font-size: 42px;
}

.home-band,
.form-band,
.payment-band {
  padding: 34px 0 56px;
}
.home-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}
.home-toolbar h1,
.form-head h1,
.payment-panel h1 {
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 900;
  margin: 0;
}
.home-toolbar p,
.form-head p,
.payment-panel p { color: var(--muted); margin: 6px 0 0; }

.ad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(430px, 1fr));
  gap: 22px;
}
.profile-card {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid #cfd2d8;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,.22);
}
.premium-ribbon {
  position: absolute;
  top: 16px;
  right: -45px;
  z-index: 2;
  width: 172px;
  transform: rotate(45deg);
  background: #14a600;
  color: #111;
  text-align: center;
  font-weight: 900;
  letter-spacing: 0;
  padding: 8px 0;
}
.profile-card-title {
  padding: 18px 18px 12px;
  font-size: 27px;
  font-weight: 700;
  border-bottom: 1px solid #e2e4e8;
}
.profile-card-body {
  display: grid;
  grid-template-columns: 48% 52%;
  min-height: 315px;
}
.photo-wrap {
  position: relative;
  border-right: 1px solid #dcdfe5;
  background: #e8eaef;
}
.photo-wrap img {
  width: 100%;
  height: 100%;
  min-height: 315px;
  object-fit: cover;
  display: block;
}
.photo-count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 4px 12px;
  border-radius: 14px;
  background: #747982;
  color: #fff;
  font-weight: 700;
}
.profile-info {
  padding: 10px 12px 8px;
  font-size: 20px;
  line-height: 1.35;
}
.phone-line {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 5px;
}
.phone-line i { color: var(--red); }
.info-row {
  display: grid;
  grid-template-columns: 18px minmax(90px, 1fr) auto;
  align-items: baseline;
  gap: 8px;
}
.info-row i { color: var(--red); font-size: 17px; }
.info-row strong { font-weight: 900; }
.info-row.ok i { color: #159447; font-size: 21px; }
.info-row.no i { color: #111827; font-size: 18px; }
.address-line {
  display: flex;
  gap: 8px;
  color: #3e8ed0;
  font-weight: 700;
  margin-top: 2px;
}
.address-line i { color: var(--red); }
.profile-card-footer {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #dcdfe5;
  background: #f4f5f7;
  padding: 0 12px;
}
.profile-card-footer span {
  color: #555b66;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.profile-card-footer i { font-size: 30px; }
.details-btn {
  min-width: 158px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--green);
  color: #fff;
  text-decoration: none;
  font-size: 20px;
  font-weight: 700;
}

.round-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 34px;
}
.round-pagination a,
.round-pagination span {
  width: 62px;
  height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #5b5e66;
  color: #fff;
  text-decoration: none;
  font-size: 22px;
  font-weight: 700;
}
.round-pagination .active { background: var(--cyan); }

.empty-state,
.ad-form,
.payment-panel,
.login-panel {
  max-width: 980px;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 10px 28px rgba(17,24,39,.08);
}
.login-panel { max-width: 420px; }
.login-panel input {
  width: 100%;
  display: block;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}
.stepper {
  display: flex;
  gap: 12px;
  margin: 22px 0;
}
.step-dot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #63666f;
  color: #fff;
  font-weight: 800;
}
.step-dot.active { background: var(--cyan); }
.form-step { display: none; }
.form-step.active { display: block; }
.form-step h2 { font-size: 22px; font-weight: 900; margin-bottom: 18px; }
.errorlist {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  color: #dc2626;
  font-weight: 700;
}
.duration-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 20px;
}
.duration-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  background: var(--soft);
}
.duration-card:has(input:checked) {
  outline: 3px solid var(--cyan);
  background: #e7f8fc;
}
.price-panel {
  margin-top: 18px;
  padding: 16px;
  border-radius: 8px;
  background: #101116;
  color: #fff;
  font-size: 22px;
}
.camera-box {
  width: min(560px, 100%);
  aspect-ratio: 4 / 3;
  background: #111827;
  border-radius: 8px;
  overflow: hidden;
}
.camera-box video,
.camera-box img,
.camera-box canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.camera-actions,
.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 22px;
}
.payment-panel { text-align: center; }
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  color: #8a5a00;
  background: #fff3cd;
  font-weight: 800;
}
.payment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 24px 0;
}
.payment-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.payment-grid span { display: block; color: var(--muted); }
.payment-grid strong { font-size: 22px; }
.telegram-pay {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 28px;
  border-radius: 7px;
  background: #229ed9;
  color: #fff;
  text-decoration: none;
  font-size: 22px;
  font-weight: 900;
}
.toast-stack {
  position: fixed;
  right: 16px;
  top: 16px;
  z-index: 2100;
  display: grid;
  gap: 10px;
}

@media (max-width: 780px) {
  .auth-strip { min-height: 62px; }
  .auth-actions {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }
  .auth-btn {
    min-height: 44px;
    padding: 0 12px;
    font-size: 16px;
    white-space: normal;
    text-align: center;
  }
  .brand-row {
    min-height: 72px;
    grid-template-columns: 1fr auto;
    gap: 12px;
  }
  .brand-mark { gap: 14px; }
  .brand-mark i { font-size: 52px; }
  .brand-mark span { font-size: 28px; letter-spacing: 0; }
  .search-bar {
    grid-column: 1 / -1;
    order: 3;
    width: 100%;
    justify-self: stretch;
    margin-bottom: 12px;
  }
  .search-bar button,
  .menu-btn {
    width: 58px;
    height: 58px;
    font-size: 34px;
  }
  .ad-grid { grid-template-columns: 1fr; }
  .profile-card-body { grid-template-columns: 1fr; }
  .photo-wrap { border-right: 0; border-bottom: 1px solid var(--line); }
  .photo-wrap img { min-height: 360px; }
  .profile-info { font-size: 18px; }
  .phone-line { font-size: 21px; }
  .home-toolbar,
  .form-actions,
  .camera-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .duration-picker,
  .payment-grid {
    grid-template-columns: 1fr;
  }
}
