/* the `hidden` attribute must always win (e.g. service-only rows inside .course-summary, whose divs are display:flex) */
[hidden]{display:none !important}

/* ═══════════════════════════════════════════
   /takanon, Course enrollment contract styles
   Hebrew, RTL, elegant, print-friendly
   ═══════════════════════════════════════════ */

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Assistant", "Rubik", "Heebo", Arial, sans-serif;
  background: #f6f3ef;
  color: #1e1b2c;
  line-height: 1.75;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}
a { color: #6c1a8a; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ─── Hero ─────────────────────────────── */
.hero {
  text-align: center;
  margin-bottom: 48px;
}
.hero h1 {
  font-size: 34px;
  font-weight: 600;
  color: #3d1259;
  margin: 0 0 12px;
  letter-spacing: -0.5px;
}
.hero .lead {
  font-size: 17px;
  color: #4a4560;
  max-width: 640px;
  margin: 0 auto;
}

/* ─── Course grid ──────────────────────── */
.family-title {
  font-size: 22px;
  font-weight: 600;
  color: #3d1259;
  margin: 32px 0 16px;
  border-right: 3px solid #c966e8;
  padding-right: 12px;
}
.family-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.card {
  display: block;
  background: #fff;
  border: 1px solid #e9e2d8;
  border-radius: 14px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  position: relative;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(60, 15, 90, 0.10);
  border-color: #c966e8;
}
.card-badge {
  display: inline-block;
  background: rgba(133, 4, 162, 0.08);
  color: #6c1a8a;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
}
.card-badge.badge-started {
  background: #fef3c7;
  color: #92400e;
}
.card-badge.badge-service {
  background: #d1fae5;
  color: #065f46;
}
.card-title {
  font-size: 19px;
  font-weight: 600;
  color: #1e1b2c;
  margin: 0 0 16px;
}
.card-meta {
  border-top: 1px solid #f0eae1;
  padding-top: 12px;
}
.meta-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 14px;
}
.meta-k { color: #645f76; }
.meta-v { color: #1e1b2c; font-weight: 500; text-align: left; }
.meta-row.price {
  border-top: 1px dashed #ded4c4;
  margin-top: 8px;
  padding-top: 10px;
  font-size: 15px;
}
.meta-row.price .meta-v { color: #6c1a8a; font-weight: 600; }
.card-cta {
  display: block;
  margin-top: 16px;
  color: #6c1a8a;
  font-size: 14px;
  font-weight: 500;
}

.footer {
  text-align: center;
  margin-top: 60px;
  color: #645f76;
  font-size: 14px;
}

/* ═══════════════════════════════════════════
   Contract page
   ═══════════════════════════════════════════ */

.contract-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}
.contract-card {
  background: #fff;
  border: 1px solid #e9e2d8;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 4px 24px rgba(60, 15, 90, 0.04);
}
.contract-header {
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid #f0eae1;
}
.contract-header h1 {
  font-size: 26px;
  color: #3d1259;
  margin: 0 0 8px;
  font-weight: 600;
}
.contract-header .sub {
  color: #645f76;
  font-size: 15px;
  margin: 0;
}

/* Course summary strip */
.course-summary {
  background: linear-gradient(135deg, #faf5ff, #f3e8ff);
  border: 1px solid #e9d5ff;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 32px;
}
.course-summary h2 {
  font-size: 17px;
  color: #3d1259;
  margin: 0 0 12px;
}
.course-summary dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 24px;
  margin: 0;
}
.course-summary div { display: flex; gap: 6px; }
.course-summary dt { color: #645f76; font-size: 14px; }
.course-summary dd { margin: 0; font-weight: 500; font-size: 14px; }

/* Sections */
.contract h2 {
  font-size: 18px;
  color: #3d1259;
  margin: 28px 0 10px;
  padding-right: 12px;
  border-right: 3px solid #c966e8;
}
.contract p, .contract li {
  font-size: 15.5px;
  color: #2e2a40;
  line-height: 1.9;
}
.contract ol, .contract ul {
  padding-right: 24px;
}
.contract .highlight {
  background: #fef3c7;
  padding: 12px 16px;
  border-radius: 8px;
  border-right: 3px solid #f59e0b;
  margin: 12px 0;
  font-weight: 500;
}

/* Personal info form */
.form-section {
  background: #f9f6f0;
  border: 1px solid #ded4c4;
  border-radius: 12px;
  padding: 24px;
  margin-top: 32px;
}
.form-section h2 {
  margin-top: 0;
  border: none;
  padding: 0;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 12px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 14px;
  color: #4a4560;
  font-weight: 500;
}
.field label .req { color: #b91c1c; margin-right: 3px; }
.field input, .field textarea {
  font-family: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid #cfc4b0;
  border-radius: 8px;
  background: #fff;
  color: #1e1b2c;
  direction: rtl;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: #c966e8;
  box-shadow: 0 0 0 3px rgba(201, 102, 232, 0.15);
}
.field .hint { font-size: 12px; color: #645f76; }

/* Agreements */
.agreements { margin: 20px 0; }
.agreements label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  font-size: 15px;
  cursor: pointer;
}
.agreements input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: #6c1a8a;
  flex-shrink: 0;
}

/* Signature */
.signature-block {
  margin-top: 20px;
}
.signature-block h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: #3d1259;
}
.signature-canvas-wrap {
  position: relative;
  background: #fff;
  border: 2px dashed #cfc4b0;
  border-radius: 10px;
  overflow: hidden;
}
.signature-canvas-wrap.filled { border-color: #6c1a8a; border-style: solid; }
.signature-canvas {
  width: 100%;
  height: 180px;
  display: block;
  touch-action: none;
  cursor: crosshair;
}
.signature-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a89f8c;
  font-size: 15px;
  pointer-events: none;
}
.signature-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 13px;
  color: #645f76;
}
.signature-toolbar button {
  background: none;
  border: 1px solid #cfc4b0;
  color: #4a4560;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
}
.signature-toolbar button:hover { background: #f0eae1; }

/* Submit */
.submit-row {
  margin-top: 32px;
  text-align: center;
}
.submit-btn {
  background: linear-gradient(135deg, #6c1a8a, #c966e8);
  color: #fff;
  border: none;
  padding: 16px 48px;
  border-radius: 999px;
  font-size: 17px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(108, 26, 138, 0.25);
  transition: transform .1s, box-shadow .1s;
}
.submit-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 32px rgba(108, 26, 138, 0.35); }
.submit-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Status */
.status { margin-top: 20px; text-align: center; font-size: 15px; }
.status.error { color: #b91c1c; }
.status.success {
  background: #d1fae5;
  color: #065f46;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid #6ee7b7;
  font-size: 16px;
  text-align: center;
}

/* Shira info block (shown in the contract) */
.parties {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 16px 0 24px;
}
.party {
  background: #f9f6f0;
  border: 1px solid #ded4c4;
  border-radius: 10px;
  padding: 16px 20px;
}
.party h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: #6c1a8a;
  font-weight: 600;
}
.party dl { margin: 0; font-size: 14px; }
.party div { display: flex; gap: 6px; padding: 2px 0; }
.party dt { color: #645f76; min-width: 100px; }
.party dd { margin: 0; color: #1e1b2c; }

.warn-todo {
  background: #fef3c7;
  color: #92400e;
  padding: 12px 16px;
  border-radius: 8px;
  border-right: 3px solid #f59e0b;
  margin-bottom: 16px;
  font-size: 14px;
}

/* Print */
@media print {
  body { background: #fff; }
  .form-section, .signature-toolbar, .submit-btn, .warn-todo { display: none !important; }
  .contract-card { border: none; box-shadow: none; padding: 0; }
}

/* ═══════════════════════════════════════════
   Admin CRM page
   ═══════════════════════════════════════════ */

.admin-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.admin-header h1 { margin: 0; font-size: 24px; color: #3d1259; }
.admin-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.admin-toolbar input, .admin-toolbar select {
  padding: 8px 12px;
  border: 1px solid #cfc4b0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: #fff;
  border: 1px solid #e9e2d8;
  border-radius: 10px;
  padding: 16px;
}
.stat-card .stat-label { font-size: 13px; color: #645f76; }
.stat-card .stat-value { font-size: 24px; font-weight: 600; color: #3d1259; margin-top: 4px; }

.contract-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e9e2d8;
  border-radius: 10px;
  overflow: hidden;
}
.contract-table th, .contract-table td {
  padding: 12px 14px;
  text-align: right;
  border-bottom: 1px solid #f0eae1;
  font-size: 14px;
}
.contract-table th {
  background: #f9f6f0;
  font-weight: 600;
  color: #4a4560;
  font-size: 13px;
}
.contract-table tr:last-child td { border-bottom: none; }
.contract-table tr:hover { background: #faf5ff; }
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.pill-ok { background: #d1fae5; color: #065f46; }
.pill-warn { background: #fef3c7; color: #92400e; }
.pill-err { background: #fee2e2; color: #991b1b; }
.table-actions button {
  background: none;
  border: 1px solid #cfc4b0;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  margin-inline-start: 4px;
}
.table-actions button:hover { background: #f0eae1; }

.login-shell {
  max-width: 420px;
  margin: 100px auto;
  background: #fff;
  border: 1px solid #e9e2d8;
  border-radius: 14px;
  padding: 40px;
  text-align: center;
}
.login-shell h1 { color: #3d1259; margin: 0 0 24px; font-size: 22px; }
.login-shell input {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  border: 1px solid #cfc4b0;
  border-radius: 8px;
  margin-bottom: 12px;
  font-family: inherit;
  direction: ltr;
  text-align: center;
}
.login-shell button {
  background: linear-gradient(135deg, #6c1a8a, #c966e8);
  color: #fff;
  border: none;
  padding: 12px 32px;
  border-radius: 999px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  font-weight: 600;
}

/* Modal for viewing a signed contract */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 27, 44, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  background: #fff;
  border-radius: 14px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
}
.modal-close {
  float: left;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #645f76;
}
