/* ===== VARIABLES ===== */
:root {
  --primary:        #F28C39;
  --primary-light:  #FFF3E8;
  --btn-dark:       #45403E;
  --btn-medium:     #625B58;
  --text:           #2D2926;
  --text-sec:       #7A7370;
  --bg:             #FBF5EF;
  --surface:        #FFFFFF;
  --border:         #E8E2DB;
  --danger:         #E94444;
  --success:        #27AE60;
  --r:    12px;
  --r-lg: 20px;
  --r-btn:30px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --font-title: 'Baloo 2', cursive;
  --font-body:  'Roboto', sans-serif;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  min-height: 100%;
}
button { cursor: pointer; font-family: inherit; }
input, textarea { font-family: inherit; }
img { display: block; max-width: 100%; }

/* ===== LOADER ===== */
.loader-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
}
.loader-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== LAYOUT ===== */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.screen-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}
.screen-body--centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-align: center;
  padding: 32px 24px;
}
.screen-footer {
  padding: 12px 16px 24px;
  background: transparent;
}

/* ===== HEADER ===== */
.header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: transparent;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-title {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
}
.header-action {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.back-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--text);
}
.role-switch-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(242,140,57,0.3);
  transition: transform 0.15s;
}
.role-switch-btn:active { transform: scale(0.92); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 24px;
  border-radius: var(--r-btn);
  border: none;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: opacity 0.15s, transform 0.1s;
  text-decoration: none;
  line-height: 1;
}
.btn:active { opacity: 0.75; transform: scale(0.98); }
.btn-primary { background: var(--btn-dark); color: #EFEEEA; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1.5px solid var(--border); }
.btn-danger { background: var(--surface); color: var(--danger); border: 1.5px solid var(--border); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-full { width: 100%; }
.btn-sm { padding: 10px 16px; font-size: 13px; }

/* ===== INPUTS ===== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 14px; font-weight: 500; color: var(--text); }
.input {
  padding: 13px 15px;
  border-radius: var(--r);
  border: none;
  font-size: 16px;
  background: var(--surface);
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
  color: var(--text);
  font-family: var(--font-body);
}
.input:focus { box-shadow: 0 0 0 2px var(--primary); }
textarea.input { resize: none; min-height: 120px; }

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 10px; }

/* ===== --- Welcome --- ===== */
.welcome-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.welcome-icon {
  width: 100px; height: 100px;
  background: var(--primary-light);
  border-radius: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: 52px;
}
.welcome-title {
  font-size: 36px;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-title);
  letter-spacing: -0.5px;
}
.welcome-sub {
  font-size: 15px;
  color: var(--text-sec);
  max-width: 260px;
  line-height: 1.5;
}
.welcome-illustration {
  width: 200px;
  height: 200px;
  object-fit: contain;
}

/* ===== --- Page Title (design) --- ===== */
.page-title {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
  padding: 0 16px;
}
.page-subtitle {
  font-size: 14px;
  color: var(--text);
  padding: 4px 16px 0;
  line-height: 1.5;
}
.page-hint {
  font-size: 13px;
  color: var(--text-sec);
  padding: 4px 16px 0;
  line-height: 1.5;
}
.page-example {
  font-size: 13px;
  color: var(--text-sec);
  padding: 8px 16px 0;
  font-style: italic;
}

/* ===== --- Role Select --- ===== */
.role-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}
.role-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.15s, transform 0.1s;
  text-align: left;
}
.role-card:active { transform: scale(0.98); border-color: var(--primary); }
.role-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}
.role-icon--parent { background: #FFF3E8; }
.role-icon--nanny  { background: #E8F5E9; }
.role-name { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.role-desc { font-size: 13px; color: var(--text-sec); line-height: 1.4; }

.chip {
  background: var(--bg);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text-sec);
  font-weight: 500;
}
.chip--orange { background: var(--primary-light); color: var(--primary); }
.request-card-about {
  font-size: 13px;
  color: var(--text-sec);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== --- Request Card (new style) --- ===== */
.req-card {
  background: var(--surface);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.1s;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.req-card:active { transform: scale(0.98); }
.req-card + .req-card { margin-top: 10px; }
.req-card-img {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--bg);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.req-card-img img { width: 100%; height: 100%; object-fit: cover; }
.req-card-body { flex: 1; min-width: 0; }
.req-card-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
}
.req-card-title strong { font-weight: 800; }
.req-card-rows { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.req-card-row { font-size: 13px; color: var(--text); line-height: 1.4; }
.req-card-row span { font-weight: 700; }
.req-card-more {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: right;
  display: block;
  margin-left: auto;
}

/* ===== --- Nanny Type Selector --- ===== */
.nanny-type-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nanny-type-item {
  background: #F0EBE5;
  border-radius: var(--r);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.1s;
}
.nanny-type-item:active { transform: scale(0.98); }
.nanny-type-item.selected { border-color: var(--primary); }
.nanny-type-item img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}
.nanny-type-item-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

/* ===== --- Welcome illustration --- ===== */
.welcome-illustration {
  width: 160px;
  height: 160px;
  object-fit: contain;
}

/* === request card ===*/
.request-card {
  background: var(--surface);
  border-radius: var(--r);
  padding: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.1s;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.request-card:active { transform: scale(0.98); }
.request-card + .request-card { margin-top: 10px; }
.request-card-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  background: var(--bg);
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.request-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.request-card-content {
  flex: 1;
  min-width: 0;
}
.request-card-type { font-size: 11px; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 2px; }
.request-card-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.request-card-price { font-size: 13px; font-weight: 600; color: var(--text-sec); margin-top: 4px; }
.request-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}
.chip {
  background: var(--bg);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--text-sec);
  font-weight: 500;
}
.chip--orange { background: var(--primary-light); color: var(--primary); }
.request-card-about {
  font-size: 12px;
  color: var(--text-sec);
  line-height: 1.3;
}


/* ===== --- Empty State --- ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 24px;
  text-align: center;
  flex: 1;
}
.empty-icon { font-size: 56px; }
.empty-title {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.empty-desc { font-size: 14px; color: var(--text-sec); max-width: 240px; line-height: 1.5; }

/* ===== --- Multi-step Form --- ===== */
.step-progress {
  padding: 12px 16px 4px;
}
.step-progress-bar-track {
  background: var(--border);
  height: 4px;
  border-radius: 4px;
  overflow: hidden;
}
.step-progress-bar-fill {
  background: var(--primary);
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}
.step-counter {
  font-size: 12px;
  color: var(--text-sec);
  margin-top: 6px;
}
.step-body {
  flex: 1;
  padding: 24px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.step-title {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}
.step-hint { font-size: 14px; color: var(--text-sec); line-height: 1.5; }
.step-nav {
  display: flex;
  gap: 10px;
  padding: 12px 16px 24px;
}

/* Выбор типа няни (deprecated grid) */

/* ===== --- Detail View --- ===== */
.detail-section { margin-bottom: 16px; }
.detail-label { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.detail-value { font-size: 15px; color: var(--text); line-height: 1.5; }
.detail-divider { height: 1px; background: var(--border); margin: 4px 0 16px; }

/* ===== --- Status Badge --- ===== */
.status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.status--active   { background: #E8F5E9; color: #27AE60; }
.status--archived { background: #F5F5F5; color: #999; }
.status--draft    { background: #FFF8E1; color: #F9A825; }

/* ===== --- Profile Card --- ===== */
.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 24px;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  margin-bottom: 12px;
}
.profile-name  { font-size: 20px; font-weight: 700; }
.profile-city  { font-size: 14px; color: var(--text-sec); margin-top: 2px; }

/* ===== --- Toast --- ===== */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: #1A1A1A;
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; }

/* ===== --- Utils --- ===== */
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.gap-10 { display: flex; flex-direction: column; gap: 10px; }
.row    { display: flex; align-items: center; gap: 8px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.text-sec { color: var(--text-sec); }
.text-sm  { font-size: 13px; }
.bold { font-weight: 700; }
