/* ── Variables ──────────────────────────────────── */
:root {
  --white:      #ffffff;
  --black:      #0d0d0d;
  --gray-light: #f5f5f5;
  --gray:       #e5e5e5;
  --gray-text:  #888;
  --pink:       #ff3ea5;
  --pink-hover: #e0338e;
  --pink-light: #fff0f8;
  --pink-dim:   #ffe0f2;
  --radius:     12px;
  --shadow:     0 2px 16px rgba(0,0,0,.08);
}

/* ── Reset ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Montserrat', sans-serif;
  background: transparent;
  color: var(--black);
  min-height: 100vh;
  font-size: 16px;
}
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, select { font: inherit; font-size: 16px; }
a { color: var(--pink); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Splash screen ──────────────────────────────── */
#splash-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: url('/static/poster.jpg') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease;
}
#splash-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.10);
}
#splash-screen.splash-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease;
}

/* ── Video background ───────────────────────────── */
#bg-video {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -2;
}
.bg-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.32);
  z-index: -1;
}

/* ── App wrap ───────────────────────────────────── */
.app-wrap {
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.7s ease;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Header ─────────────────────────────────────── */
.header {
  background: transparent;
  padding: 0 20px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
}
.header-title {
  font-size: 22px; font-weight: 800;
  color: var(--white);
  letter-spacing: -0.4px;
  text-shadow: 0 1px 10px rgba(0,0,0,0.6);
}
.header-sub {
  font-size: 14px; color: rgba(255,255,255,0.75);
  font-weight: 500;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}
.btn-admin {
  font-size: 14px; color: rgba(255,255,255,0.7); text-decoration: none;
  padding: 8px 14px; border-radius: 8px;
  transition: background .15s;
}
.btn-admin:hover { background: rgba(255,255,255,0.15); color: var(--white); text-decoration: none; }

/* ── Step screens ───────────────────────────────── */
.step-screen { display: none; padding: 0 0 80px; }
.step-screen.active { display: block; }

.step-back {
  padding: 14px 20px 0;
  color: rgba(255,255,255,0.85); font-size: 17px; font-weight: 600;
  cursor: pointer;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}
.step-title {
  padding: 12px 20px 16px;
  font-size: 26px; font-weight: 800;
  color: var(--white);
  letter-spacing: -0.5px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

/* ── Шаг 1: Place grid ──────────────────────────── */
.place-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px;
}
.place-card {
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: left;
  border: 1.5px solid rgba(255,255,255,0.2);
  transition: all .25s ease;
  min-height: 120px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
}
.place-card::before {
  content: '';
  display: block;
  height: 3px;
  background: var(--pink);
  border-radius: 2px;
  margin-bottom: 6px;
  width: 32px;
}
.place-card:active { transform: scale(.97); }
.place-card:hover  {
  border-color: var(--pink);
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.3);
  background: rgba(255,255,255,0.2);
}
.place-name { font-size: 15px; font-weight: 700; line-height: 1.4; color: var(--white); letter-spacing: -0.2px; }
.place-price { font-size: 15px; color: var(--pink); font-weight: 700; }

/* ── Шаг 2: Calendar ────────────────────────────── */
.calendar-wrap {
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  margin: 0 16px;
  padding: 16px;
}
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.cal-month { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; color: var(--white); }
.cal-nav {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.15); font-size: 20px; color: var(--white);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.cal-nav:hover { background: rgba(255,255,255,0.25); }

.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; gap: 4px; margin-bottom: 8px;
}
.cal-weekdays span { font-size: 13px; color: rgba(255,255,255,0.65); font-weight: 600; padding: 4px 0; }

.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}
.cal-day {
  aspect-ratio: 1;
  border-radius: 50%;
  font-size: 16px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
  min-height: 40px;
  color: var(--white);
}
.cal-day.empty-cell { background: none; }
.cal-day.past { color: rgba(255,255,255,0.28); cursor: default; }
.cal-day.available { color: var(--white); }
.cal-day.available:hover { background: rgba(255,255,255,0.18); color: var(--pink); }
.cal-day.today { border: 2px solid var(--pink); color: var(--pink); }
.cal-day.selected { background: var(--pink); color: var(--white); }

/* ── Шаг 3: Time slots ──────────────────────────── */
.slots-wrap { padding: 0 16px; }
.time-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.time-slot {
  padding: 14px 6px;
  border-radius: 10px;
  font-size: 17px; font-weight: 600;
  text-align: center;
  transition: all .12s;
  min-height: 54px;
}
.time-slot.free {
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255,255,255,0.2);
  color: var(--white);
}
.time-slot.free:active { transform: scale(.95); }
.time-slot.free:hover  { background: rgba(255,255,255,0.22); border-color: var(--pink); color: var(--pink); }
.time-slot.busy {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.28);
  text-decoration: line-through;
  cursor: default;
}

/* ── Шаг 4: Form ────────────────────────────────── */
.booking-card-header {
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: var(--radius) var(--radius) 0 0;
  color: var(--white);
  padding: 10px 16px;
  margin: 0 16px;
  margin-bottom: 0;
  border-bottom: none;
}
.form-ws-name { font-size: 16px; font-weight: 700; margin-bottom: 2px; letter-spacing: -0.2px; }
.form-datetime { font-size: 13px; opacity: .75; font-weight: 500; }

.form-wrap {
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255,255,255,0.2);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 12px 16px;
  margin: 0 16px;
}

.dur-label {
  font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,0.65); text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: 8px;
}
.dur-row { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.dur-btn {
  flex: 1; min-width: 44px;
  padding: 8px 0;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,0.25);
  font-size: 12px; font-weight: 700;
  color: rgba(255,255,255,0.8);
  transition: all .12s;
  min-height: 36px;
}
.dur-btn:hover   { border-color: var(--pink); color: var(--pink); }
.dur-btn.active  { border-color: var(--pink); background: var(--pink); color: var(--white); }

.price-display {
  font-size: 24px; font-weight: 800;
  color: var(--pink);
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.field { margin-bottom: 8px; }
.field label {
  display: block; font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,0.65); margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: .5px;
}
.field input, .field select {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid rgba(255,255,255,0.25); border-radius: 8px;
  font-size: 16px; outline: none;
  transition: border-color .15s;
  -webkit-appearance: none;
  background: rgba(255,255,255,0.1);
  color: var(--white);
}
.field input::placeholder { color: rgba(255,255,255,0.4); }
.field input:focus, .field select:focus { border-color: var(--pink); }

.form-actions {
  padding-top: 8px;
  position: sticky; bottom: 0;
  background: transparent;
  padding-bottom: env(safe-area-inset-bottom, 12px);
}
.btn-book {
  width: 100%; padding: 14px;
  border-radius: 10px;
  background: var(--pink); color: var(--white);
  font-size: 17px; font-weight: 800;
  transition: background .15s;
  min-height: 50px;
  letter-spacing: -0.2px;
}
.btn-book:hover { background: var(--pink-hover); }
.btn-book:disabled { opacity: .6; cursor: not-allowed; }

.book-err {
  color: #e00; font-size: 15px; text-align: center; padding: 10px 0;
}

.success-price {
  display: inline-block;
  font-size: 20px; font-weight: 800;
  color: var(--pink); margin-top: 6px;
}

/* ── Success overlay ────────────────────────────── */
.success-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.5);
  align-items: center; justify-content: center;
}
.success-overlay.open { display: flex; }
.success-box {
  background: var(--white); border-radius: 20px;
  padding: 36px 28px; max-width: 380px; width: 90%;
  text-align: center; animation: popIn .22s ease;
}
@keyframes popIn {
  from { transform: scale(.85); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.success-icon {
  width: 72px; height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--pink-light);
  display: flex; align-items: center; justify-content: center;
}
.success-icon::before {
  content: '✓';
  font-size: 36px; font-weight: 800;
  color: var(--pink); line-height: 1;
}
.success-title { font-size: 26px; font-weight: 800; margin-bottom: 10px; letter-spacing: -0.4px; }
.success-detail { font-size: 16px; color: var(--gray-text); line-height: 1.7; margin-bottom: 20px; }
.success-tip {
  font-size: 14px; color: #111;
  background: var(--gray-light); border-radius: 10px;
  padding: 14px; margin-bottom: 20px; text-align: left;
}
.success-tip a { color: var(--pink); font-weight: 600; }
.success-tip a:hover { text-decoration: underline; }
.btn-close {
  width: 100%; padding: 16px;
  background: var(--pink); color: var(--white);
  border-radius: 12px; font-size: 18px; font-weight: 700;
}

/* ── Admin page ─────────────────────────────────── */
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 20px 16px; }

.login-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 40px 32px;
  max-width: 380px; margin: 80px auto;
}
.login-card h2 { font-size: 22px; font-weight: 700; margin-bottom: 24px; text-align: center; }

.admin-tabs { display: flex; gap: 4px; margin-bottom: 20px; flex-wrap: wrap; }
.tab-btn {
  padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600;
  color: var(--gray-text); transition: all .12s;
  min-height: 44px;
}
.tab-btn.active { background: var(--black); color: var(--white); }
.tab-btn:not(.active):hover { background: var(--gray); color: var(--black); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Week toolbar ───────────────────────────────── */
.week-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 16px; margin-bottom: 16px;
}
.week-select {
  padding: 10px 12px; border: 1.5px solid var(--gray); border-radius: 8px;
  font-size: 14px; outline: none; flex: 1; min-width: 160px;
  -webkit-appearance: none; background: var(--white);
}
.week-select:focus { border-color: var(--pink); }
.week-nav { display: flex; align-items: center; gap: 6px; }
.week-nav-btn {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--gray-light); font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.week-nav-btn:hover { background: var(--gray); }
.week-label { font-size: 14px; font-weight: 700; min-width: 160px; text-align: center; }

.btn-primary {
  padding: 10px 20px; border-radius: 8px;
  background: var(--pink); color: var(--white);
  font-size: 14px; font-weight: 700; transition: background .15s;
  min-height: 44px;
}
.btn-primary:hover { background: var(--pink-hover); }
.btn-export {
  padding: 10px 20px; border-radius: 8px;
  background: var(--gray-light); color: var(--black);
  font-size: 14px; font-weight: 600;
  min-height: 44px;
}

/* ── Week table ─────────────────────────────────── */
.week-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--white);
}
.week-table {
  border-collapse: collapse;
  min-width: 600px;
  width: 100%;
}
.week-table th, .week-table td {
  border: 1px solid var(--gray);
  padding: 0;
}
.week-table thead th {
  background: var(--black); color: var(--white);
  font-size: 13px; font-weight: 700;
  padding: 10px 8px; text-align: center;
}
.wt-today { background: var(--pink) !important; }
.wt-day-num { font-size: 18px; font-weight: 800; display: block; }
.wt-time-col { width: 60px; }
.wt-day-col  { min-width: 100px; }

.wt-time {
  font-size: 12px; color: var(--gray-text); font-weight: 600;
  padding: 4px 8px; text-align: right;
  white-space: nowrap; background: var(--gray-light);
  vertical-align: top;
}
.wt-cell {
  height: 28px; vertical-align: top; padding: 2px;
  cursor: default;
}
.wt-busy      { background: var(--pink-light); }
.wt-cancelled { background: var(--gray-light); opacity: .5; }

.wt-booking {
  background: var(--pink); color: var(--white);
  border-radius: 4px; padding: 3px 6px;
  font-size: 11px; line-height: 1.3;
  cursor: pointer; transition: opacity .12s;
  overflow: hidden;
}
.wt-booking:hover { opacity: .85; }
.wt-bk-name { font-weight: 700; display: block; }
.wt-bk-ws   { display: block; opacity: .8; font-size: 10px; }

/* ── Booking popup ──────────────────────────────── */
.bk-popup {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.5);
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.bk-popup[style*="flex"] { display: flex !important; }
.bk-popup-inner {
  background: var(--white); border-radius: var(--radius);
  padding: 24px; max-width: 360px; width: 100%;
  box-shadow: var(--shadow);
}
.bk-popup-title { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.bk-popup-info  { font-size: 14px; color: var(--gray-text); line-height: 1.7; }
.btn-cancel-bk {
  padding: 10px 16px; border-radius: 8px;
  border: 1.5px solid var(--gray); font-size: 13px; font-weight: 600;
  color: var(--gray-text); transition: all .12s; min-height: 44px;
}
.btn-cancel-bk:hover { border-color: #e00; color: #e00; background: #fff5f5; }

/* ── Settings card ──────────────────────────────── */
.settings-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px;
}
.settings-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }

.empty { text-align: center; color: var(--gray-text); padding: 48px 0; font-size: 15px; }

/* ── Cancelled toggle ───────────────────────────── */
.cancelled-toggle {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--gray-text);
  margin: 8px 0 4px; cursor: pointer; user-select: none;
}
.cancelled-toggle input { width: 16px; height: 16px; accent-color: var(--pink); cursor: pointer; }
.wt-cancelled { background: #f5f5f5; }
.wt-cancelled .wt-booking { opacity: .55; }
.wt-cancelled .wt-bk-name { text-decoration: line-through; }

/* ── Finance tab ────────────────────────────────── */
.fin-period-bar {
  display: flex; gap: 8px; margin-bottom: 12px;
}
.fin-period-btn {
  flex: 1; padding: 10px; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  background: var(--gray); color: var(--gray-text);
  transition: background .15s, color .15s;
}
.fin-period-btn.active {
  background: var(--pink); color: var(--white);
}
.fin-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-bottom: 16px;
}
.fin-date-label {
  font-size: 15px; font-weight: 600; min-width: 160px; text-align: center;
}
.fin-kpi-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px;
}
.fin-kpi-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 10px; text-align: center;
}
.fin-kpi-value {
  font-size: 20px; font-weight: 800; color: var(--pink); line-height: 1.2;
}
.fin-kpi-label {
  font-size: 12px; color: var(--gray-text); margin-top: 4px;
}
.fin-table {
  width: 100%; border-collapse: collapse;
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.fin-table th {
  background: var(--gray-light); font-size: 13px; font-weight: 700;
  padding: 10px 12px; text-align: left; color: var(--gray-text);
}
.fin-table td {
  padding: 12px; font-size: 14px; border-top: 1px solid var(--gray);
}
.fin-table td:not(:first-child) { text-align: center; }
.fin-table th:not(:first-child) { text-align: center; }
.fin-total-row td {
  font-weight: 700; background: var(--pink-light); color: var(--pink);
}

/* ── Instagram секция ───────────────────────────── */
.insta-section {
  margin-top: 110px;
  padding-bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.insta-label {
  font-size: 17px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
  letter-spacing: 0.03em;
}
.insta-row {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: center;
}
.insta-btn {
  display: block;
  width: 80px !important;
  height: 80px !important;
  min-width: 80px;
  min-height: 80px;
  max-width: 80px;
  max-height: 80px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
  overflow: hidden;
}
.insta-btn:hover {
  transform: scale(1.07);
  box-shadow: 0 6px 22px rgba(0,0,0,0.45);
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 400px) {
  .place-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .place-card { padding: 20px 10px; min-height: 100px; }
  .place-name { font-size: 13px; }
  .time-grid  { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .time-slot  { font-size: 15px; padding: 12px 4px; }
  .cal-day    { font-size: 14px; min-height: 36px; }
  .week-label { min-width: 120px; font-size: 13px; }
  .step-title { font-size: 22px; }
}

@media (min-width: 600px) {
  .place-grid { grid-template-columns: repeat(3, 1fr); }
  .time-grid  { grid-template-columns: repeat(6, 1fr); }
  .step-title { font-size: 30px; }
  .form-wrap, .booking-card-header { max-width: 560px; margin: 0 16px; }
  .form-wrap { margin-left: auto; margin-right: auto; }
  .booking-card-header { margin-left: auto; margin-right: auto; }
  .calendar-wrap { max-width: 460px; margin: 0 auto; }
  .slots-wrap { max-width: 560px; margin: 0 auto; }
  .step-back { max-width: 560px; margin: 0 auto; }
}
