/* ===== CLIENT PAGE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #ede9fe;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --radius: 14px;
  --shadow: 0 4px 24px rgba(0,0,0,.08);
}

html, body { min-height: 100%; font-family: 'Segoe UI', Tahoma, Arial, sans-serif; }
body { background: var(--bg); color: var(--text); direction: rtl; }

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff; padding: 1.25rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.site-logo { display: flex; align-items: center; gap: .75rem; }
.site-logo .icon {
  width: 42px; height: 42px;
  background: rgba(255,255,255,.15); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.header-logo-img {
  width: 42px; height: 42px;
  object-fit: contain; border-radius: 10px;
}
.site-logo h1 { font-size: 1.25rem; font-weight: 700; }
.site-logo p { font-size: .78rem; opacity: .8; }
.header-links { display: flex; gap: .75rem; flex-wrap: wrap; }
.header-link {
  background: rgba(255,255,255,.15);
  color: #fff; padding: .4rem .875rem;
  border-radius: 999px; font-size: .8rem;
  text-decoration: none; transition: background .2s;
  white-space: nowrap;
}
.header-link:hover { background: rgba(255,255,255,.25); }

/* ── Main container ─────────────────────────────────────────── */
.container {
  max-width: 560px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* ── Step card ──────────────────────────────────────────────── */
.step-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.step-indicator {
  display: flex; align-items: center; gap: .5rem;
  margin-bottom: 1.5rem;
}
.step-dot {
  width: 28px; height: 28px;
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: .75rem; font-weight: 700;
  background: var(--border); color: var(--text-muted);
  transition: all .3s; flex-shrink: 0;
}
.step-dot.active { background: var(--primary); color: #fff; }
.step-dot.done { background: var(--success); color: #fff; }
.step-line {
  flex: 1; height: 2px; background: var(--border);
  border-radius: 1px; transition: background .3s;
}
.step-line.done { background: var(--success); }

.step-content { display: none; }
.step-content.active { display: block; }

.step-title {
  font-size: 1.2rem; font-weight: 700;
  margin-bottom: .4rem;
}
.step-desc {
  font-size: .875rem; color: var(--text-muted);
  margin-bottom: 1.5rem; line-height: 1.6;
}

/* ── Form ───────────────────────────────────────────────────── */
.field { margin-bottom: 1.1rem; }
.field label {
  display: block; font-size: .85rem;
  font-weight: 600; margin-bottom: .4rem;
}
.field input, .field select {
  width: 100%; padding: .75rem 1rem;
  border: 2px solid var(--border); border-radius: 10px;
  font-size: .95rem; background: #f8fafc;
  transition: border-color .2s; color: var(--text);
  direction: ltr; text-align: right;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--primary); background: #fff;
}
.field-hint { font-size: .75rem; color: var(--text-muted); margin-top: .3rem; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-main {
  width: 100%; padding: .875rem;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff; border: none; border-radius: 10px;
  font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: opacity .2s;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
}
.btn-main:hover { opacity: .92; }
.btn-main:disabled { opacity: .6; cursor: not-allowed; }

.btn-back {
  background: none; border: 1.5px solid var(--border);
  color: var(--text-muted); border-radius: 10px;
  padding: .65rem 1.25rem; font-size: .875rem;
  cursor: pointer; transition: all .2s;
}
.btn-back:hover { border-color: var(--text); color: var(--text); }

.btn-row { display: flex; gap: .75rem; margin-top: .75rem; }
.btn-row .btn-main { flex: 1; }

/* ── Service selector ───────────────────────────────────────── */
.service-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: .75rem; margin-bottom: 1.25rem;
}
.service-btn {
  border: 2px solid var(--border); border-radius: 12px;
  padding: 1.25rem .75rem; text-align: center;
  cursor: pointer; transition: all .2s; background: #f8fafc;
}
.service-btn:hover { border-color: var(--primary); background: var(--primary-light); }
.service-btn.selected { border-color: var(--primary); background: var(--primary-light); }
.service-btn .svc-icon { font-size: 2rem; margin-bottom: .4rem; }
.service-btn .svc-name { font-size: .9rem; font-weight: 600; }
.service-btn .svc-desc { font-size: .75rem; color: var(--text-muted); margin-top: .2rem; }

/* ── Instruction box ────────────────────────────────────────── */
.instruction-box {
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.instruction-box .inst-title {
  font-size: .875rem; font-weight: 700;
  color: #9a3412; margin-bottom: .5rem;
  display: flex; align-items: center; gap: .4rem;
}
.instruction-box ol {
  padding-right: 1.25rem;
  font-size: .85rem; color: #7c2d12; line-height: 1.8;
}

/* ── Timer ───────────────────────────────────────────────────── */
.timer-bar {
  background: var(--border); border-radius: 999px;
  height: 6px; overflow: hidden; margin-bottom: 1rem;
}
.timer-fill {
  height: 100%; background: var(--primary);
  border-radius: 999px; transition: width 1s linear;
}
.timer-text {
  font-size: .8rem; color: var(--text-muted);
  text-align: center; margin-bottom: 1rem;
}
.timer-text.urgent { color: var(--danger); font-weight: 700; }

/* ── Result ──────────────────────────────────────────────────── */
.result-box { text-align: center; padding: .5rem 0; }
.result-icon { font-size: 4rem; margin-bottom: .75rem; }
.result-title { font-size: 1.25rem; font-weight: 700; margin-bottom: .5rem; }
.result-subtitle { font-size: .875rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.code-display {
  background: #f1f5f9;
  border: 2px dashed var(--border);
  border-radius: 12px; padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.code-display .code-label {
  font-size: .75rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: .5rem;
}
.code-display .code-value {
  font-size: 2.25rem; font-weight: 800;
  letter-spacing: .15em; color: var(--primary);
  direction: ltr; font-family: 'Courier New', monospace;
}
.btn-copy {
  background: var(--primary-light); color: var(--primary);
  border: none; border-radius: 8px;
  padding: .5rem 1.25rem; font-size: .875rem;
  font-weight: 600; cursor: pointer;
  transition: background .2s; margin-bottom: 1rem;
}
.btn-copy:hover { background: #ddd6fe; }
.btn-new {
  background: none; border: 1.5px solid var(--border);
  border-radius: 10px; padding: .625rem 1.25rem;
  font-size: .875rem; cursor: pointer;
  color: var(--text-muted); transition: all .2s;
}
.btn-new:hover { border-color: var(--primary); color: var(--primary); }

/* ── Error box ───────────────────────────────────────────────── */
.error-box {
  background: #fee2e2; border: 1.5px solid #fecaca;
  border-radius: 10px; padding: .875rem 1rem;
  color: #991b1b; font-size: .875rem;
  margin-bottom: 1rem; display: none;
}
.error-box.show { display: block; }

/* ── Loading overlay ─────────────────────────────────────────── */
.loading-overlay {
  text-align: center; padding: 2rem 0;
}
.spinner {
  display: inline-block; width: 40px; height: 40px;
  border: 3px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { margin-top: .75rem; color: var(--text-muted); font-size: .9rem; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  text-align: center; padding: 2rem 1rem;
  color: var(--text-muted); font-size: .8rem;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  .step-card { padding: 1.5rem 1.25rem; }
  .service-grid { grid-template-columns: 1fr; }
  .code-display .code-value { font-size: 1.75rem; }
  .site-header { flex-direction: column; gap: .75rem; text-align: center; }
  .header-links { justify-content: center; }
}
