/* =====================================================================
   Shared stylesheet – appointment booking service
   Direction: RTL / Hebrew
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;500;600;700&display=swap');

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

/* ------------------------------------------------------------------ Base */
html { font-size: 16px; }

body {
  font-family: 'Heebo', Arial, sans-serif;
  direction: rtl;
  background: #f0f4f8;
  color: #1e2a3a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: #1a5bb5; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ Header */
.site-header {
  background: linear-gradient(135deg, #0d2f6e 0%, #1a5bb5 100%);
  color: #fff;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.header-inner {
  max-width: 900px;
  margin: auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-logo {
  width: 56px;
  height: 56px;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.header-text h1 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.header-text p {
  font-size: 0.88rem;
  opacity: .85;
  margin-top: 3px;
}

/* ------------------------------------------------------------------ Language switcher */
.lang-switch {
  margin-inline-start: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-self: center;
}

.lang-btn {
  background: rgba(255,255,255,.12);
  color: #dce8fa;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}

.lang-btn:hover { background: rgba(255,255,255,.22); color: #fff; }

.lang-btn.active {
  background: #fff;
  color: #0d2f6e;
  border-color: #fff;
}

/* ------------------------------------------------------------------ Nav */
.site-nav {
  background: #0d2f6e;
}

.nav-inner {
  max-width: 900px;
  margin: auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
}

.nav-inner a {
  color: #c7d8f5;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 10px 16px;
  display: inline-block;
  border-bottom: 3px solid transparent;
  transition: color .2s, border-color .2s;
}

.nav-inner a:hover,
.nav-inner a.active {
  color: #fff;
  border-bottom-color: #5da0f0;
  text-decoration: none;
}

/* ------------------------------------------------------------------ Main */
main {
  flex: 1;
  max-width: 900px;
  margin: 36px auto;
  width: 100%;
  padding: 0 16px;
}

/* ------------------------------------------------------------------ Notice banners */
.notice {
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 18px;
  font-size: 0.9rem;
  line-height: 1.6;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.notice-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }

.notice--info {
  background: #e8f1fc;
  border-right: 4px solid #1a5bb5;
  color: #0d2f6e;
}

.notice--warning {
  background: #fff8e1;
  border-right: 4px solid #f5a623;
  color: #7a4f00;
}

.notice--disclaimer {
  background: #f3f3f3;
  border-right: 4px solid #aaa;
  color: #555;
}

/* ------------------------------------------------------------------ Card */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,.08);
  padding: 36px 40px;
  margin-bottom: 28px;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0d2f6e;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-subtitle {
  font-size: 0.88rem;
  color: #6b7a90;
  margin-bottom: 28px;
}

/* ------------------------------------------------------------------ Form */
.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

.form-grid .full-width { grid-column: 1 / -1; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #2d3e55;
}

label .required-star {
  color: #d0021b;
  margin-right: 3px;
}

input[type="text"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #c9d4e0;
  border-radius: 7px;
  font-family: inherit;
  font-size: 0.95rem;
  color: #1e2a3a;
  background: #fafbfc;
  transition: border-color .2s, box-shadow .2s;
  direction: rtl;
}

input[type="text"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #1a5bb5;
  box-shadow: 0 0 0 3px rgba(26,91,181,.12);
  background: #fff;
}

input.error,
select.error,
textarea.error {
  border-color: #d0021b;
  box-shadow: 0 0 0 3px rgba(208,2,27,.1);
}

textarea { resize: vertical; min-height: 130px; }

select { cursor: pointer; }

.field-hint {
  display: block;
  font-size: 0.76rem;
  font-weight: 400;
  color: #8a9ab0;
  margin-top: 3px;
}

/* ------------------------------------------------------------------ Pricing notice */
.pricing-list {
  margin: 8px 0 10px;
  padding-right: 18px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.pricing-list li { margin-bottom: 2px; }

.pricing-list li.pricing-active {
  color: #0d2f6e;
  font-weight: 600;
}

.pricing-note {
  font-size: 0.82rem;
  font-weight: 400;
  color: #6b7c93;
}

.pricing-selected {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: #0d2f6e;
}

/* ------------------------------------------------------------------ Checkboxes & urgency */
.form-checks {
  gap: 12px;
  padding: 14px 16px;
  background: #f7f9fc;
  border: 1.5px solid #e2e8f0;
  border-radius: 7px;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 400;
  color: #2d3e55;
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: #1a5bb5;
  cursor: pointer;
}

.urgency-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.urgency-option {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid #c9d4e0;
  border-radius: 7px;
  background: #fafbfc;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}

.urgency-option:has(input:checked) {
  border-color: #1a5bb5;
  background: #eef4fc;
}

.urgency-option input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: #1a5bb5;
  cursor: pointer;
}

.urgency-option-text {
  display: flex;
  flex: 1;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}

.urgency-price {
  font-weight: 700;
  color: #0d2f6e;
  white-space: nowrap;
}

.urgency-hint {
  flex-basis: 100%;
  margin-top: 2px;
  margin-right: 28px;
}

/* ------------------------------------------------------------------ Location picker */
.loc-picker {
  border: 1.5px solid #c9d4e0;
  border-radius: 7px;
  background: #fafbfc;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}

.loc-picker:focus-within {
  border-color: #1a5bb5;
  box-shadow: 0 0 0 3px rgba(26,91,181,.12);
  background: #fff;
}

.loc-picker.error {
  border-color: #d0021b;
  box-shadow: 0 0 0 3px rgba(208,2,27,.1);
}

/* Selected pills row */
.loc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid #e8edf3;
}

.loc-tags:empty { display: none; }

.loc-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #1a5bb5;
  color: #fff;
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 20px;
  max-width: 280px;
}

.loc-tag-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loc-tag-remove {
  background: none;
  border: none;
  color: rgba(255,255,255,.75);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  margin-top: -1px;
}

.loc-tag-remove:hover { color: #fff; }

/* Search row */
.loc-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #e8edf3;
  background: #fff;
}

.loc-search-icon { font-size: 0.9rem; flex-shrink: 0; }

.loc-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.92rem;
  direction: rtl;
  color: #1e2a3a;
  outline: none;
  padding: 0;
}

.loc-search-input::placeholder { color: #aab5c4; }

/* Scrollable checkbox list */
.loc-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 4px 0;
}

.loc-group-header {
  padding: 8px 14px 3px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #8a9ab0;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.loc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.4;
  transition: background .1s;
  user-select: none;
}

.loc-item:hover   { background: #f0f4f8; }
.loc-item.selected { background: #e8f1fc; }

.loc-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: #1a5bb5;
  cursor: pointer;
  margin: 0;
}

.loc-item-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.loc-name-primary {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Grayed-out canonical Hebrew shown beneath the translated name */
.loc-name-secondary {
  font-size: 0.74rem;
  color: #9aa7b8;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loc-no-results {
  padding: 18px 14px;
  color: #8a9ab0;
  font-size: 0.88rem;
  text-align: center;
}

/* free-text for "אחר" */
.other-input-wrapper {
  margin-top: 10px;
  display: none;
}
.other-input-wrapper.visible { display: block; }

/* Honeypot – completely invisible */
.hp-field { display: none !important; }

/* ------------------------------------------------------------------ Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 32px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .1s, box-shadow .2s;
}

.btn-primary {
  background: linear-gradient(135deg, #1a5bb5, #0d2f6e);
  color: #fff;
  box-shadow: 0 4px 14px rgba(13,47,110,.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1e6acc, #1a5bb5);
  box-shadow: 0 6px 18px rgba(13,47,110,.35);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

/* ------------------------------------------------------------------ Feedback */
.form-feedback {
  display: none;
  border-radius: 8px;
  padding: 14px 18px;
  margin-top: 18px;
  font-size: 0.93rem;
  font-weight: 500;
}

.form-feedback.success {
  display: block;
  background: #e6f9ee;
  border-right: 4px solid #27ae60;
  color: #1a6e3d;
}

.form-feedback.error {
  display: block;
  background: #fdecea;
  border-right: 4px solid #d0021b;
  color: #8a0010;
}

.form-feedback.loading {
  display: block;
  background: #fff8e1;
  border-right: 4px solid #f5a623;
  color: #7a4f00;
}

/* ------------------------------------------------------------------ Spinner */
@keyframes spin { to { transform: rotate(360deg); } }

.btn-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
  margin-left: 6px;
  flex-shrink: 0;
}

/* ------------------------------------------------------------------ Footer */
.site-footer {
  background: #0d2f6e;
  color: #a8bcd9;
  text-align: center;
  font-size: 0.8rem;
  padding: 18px 16px;
  line-height: 1.6;
}

.site-footer a { color: #7fb3f5; }

/* ------------------------------------------------------------------ LTR overrides (en / ru) */
html[dir="ltr"] body { direction: ltr; }

html[dir="ltr"] input[type="text"],
html[dir="ltr"] input[type="tel"],
html[dir="ltr"] select,
html[dir="ltr"] textarea,
html[dir="ltr"] .loc-search-input {
  direction: ltr;
}

html[dir="ltr"] .notice { flex-direction: row; }

html[dir="ltr"] .notice--info {
  border-right: none;
  border-left: 4px solid #1a5bb5;
}

html[dir="ltr"] .notice--warning {
  border-right: none;
  border-left: 4px solid #f5a623;
}

html[dir="ltr"] .notice--disclaimer {
  border-right: none;
  border-left: 4px solid #aaa;
}

html[dir="ltr"] .form-feedback.success {
  border-right: none;
  border-left: 4px solid #27ae60;
}

html[dir="ltr"] .form-feedback.error {
  border-right: none;
  border-left: 4px solid #d0021b;
}

html[dir="ltr"] .form-feedback.loading {
  border-right: none;
  border-left: 4px solid #f5a623;
}

html[dir="ltr"] .pricing-list {
  padding-right: 0;
  padding-left: 18px;
}

html[dir="ltr"] label .required-star {
  margin-right: 0;
  margin-left: 3px;
}

html[dir="ltr"] .urgency-hint {
  margin-right: 0;
  margin-left: 28px;
}

html[dir="ltr"] .btn-spinner {
  margin-left: 0;
  margin-right: 6px;
}

html[dir="ltr"] #charCount { text-align: right; }

/* ------------------------------------------------------------------ Responsive */
@media (max-width: 640px) {
  .card { padding: 24px 18px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .header-inner { padding: 16px; }
  .card-title { font-size: 1.1rem; }
  .lang-switch { margin-inline-start: 0; width: 100%; }
}
