/* ============================================================
   Tnufa Camp Registration — Monday.com aesthetic, RTL Hebrew
   ============================================================ */

:root {
  --m-bg:       #f5f6f8;
  --m-white:    #ffffff;
  --m-text:     #323338;
  --m-label:    #323338;
  --m-hint:     #676879;
  --m-border:   #c3c6d4;
  --m-focus:    #0085ff;
  --m-req:      #f65f7c;
  --m-green:    #00c875;
  --m-shadow:   0 2px 8px rgba(50, 51, 56, 0.1);
  --m-radius:   8px;
  --m-font:     'Rubik', 'Segoe UI', 'Arial', sans-serif;
}

/* ── Reset / Base ──────────────────────────────────────────── */
.tnufa-wrap *,
.tnufa-wrap *::before,
.tnufa-wrap *::after {
  box-sizing: border-box;
}

.tnufa-wrap {
  direction: rtl !important;
  font-family: var(--m-font) !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: var(--m-text) !important;
  background: var(--m-bg) !important;
  min-height: 100vh !important;
  padding: 40px 16px 64px !important;
  /* Break out of theme content container */
  width: 100vw !important;
  position: relative !important;
  left: 50% !important;
  right: 50% !important;
  margin-left: -50vw !important;
  margin-right: -50vw !important;
  box-sizing: border-box !important;
}

.tnufa-container {
  max-width: 680px;
  margin: 0 auto;
}

/* ── Form Header ───────────────────────────────────────────── */
.tnufa-form-header {
  background: var(--m-white);
  border-radius: var(--m-radius);
  padding: 28px 32px;
  margin-bottom: 16px;
  box-shadow: var(--m-shadow);
  border-top: 4px solid var(--m-green);
}

.tnufa-form-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--m-text);
  margin: 0;
  line-height: 1.4;
  text-align: right;
}

/* ── Section Cards ─────────────────────────────────────────── */
.tnufa-section {
  background: var(--m-white);
  border-radius: var(--m-radius);
  padding: 24px 28px;
  margin-bottom: 16px;
  box-shadow: var(--m-shadow);
}

.tnufa-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--m-text);
  margin: 0 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #e6e9ef;
  text-align: right;
}

/* ── Field ─────────────────────────────────────────────────── */
.tnufa-field {
  margin-bottom: 18px;
}
.tnufa-field:last-child {
  margin-bottom: 0;
}

.tnufa-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--m-label);
  margin-bottom: 6px;
  text-align: right;
}

.tnufa-label small {
  font-weight: 400;
  color: var(--m-hint);
  font-size: 12px;
}

.req {
  color: var(--m-req);
  margin-right: 2px;
}

.tnufa-hint {
  font-size: 12px;
  color: var(--m-hint);
  margin-bottom: 6px;
  text-align: right;
  line-height: 1.4;
}

/* ── Inputs ────────────────────────────────────────────────── */
.tnufa-input,
.tnufa-select,
.tnufa-textarea {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--m-border);
  border-radius: 4px;
  font-family: var(--m-font);
  font-size: 14px;
  color: var(--m-text);
  background: var(--m-white);
  direction: rtl;
  text-align: right;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tnufa-input:focus,
.tnufa-select:focus,
.tnufa-textarea:focus {
  border-color: var(--m-focus);
  box-shadow: 0 0 0 2px rgba(0, 133, 255, 0.15);
}

.tnufa-input.has-error,
.tnufa-select.has-error {
  border-color: var(--m-req);
  box-shadow: 0 0 0 2px rgba(246, 95, 124, 0.15);
}

.tnufa-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Custom dropdown arrow (RTL — arrow on left) */
.tnufa-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23676879'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center; /* left side for RTL */
  padding-left: 32px;
  cursor: pointer;
}

/* ── Phone field ───────────────────────────────────────────── */
.tnufa-phone-wrap {
  display: flex;
  align-items: stretch;
  gap: 0;
  direction: ltr; /* numbers always LTR */
}

.tnufa-phone-prefix {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--m-border);
  border-right: none;
  border-radius: 4px 0 0 4px;
  background: #f8f9fb;
  font-size: 13px;
  color: var(--m-hint);
  white-space: nowrap;
  flex-shrink: 0;
}

.tnufa-phone-wrap .tnufa-input {
  border-radius: 0 4px 4px 0;
  direction: ltr;
  text-align: left;
  flex: 1;
}

/* ── Checkbox (extended hours) ─────────────────────────────── */
.tnufa-checkbox-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.tnufa-checkbox {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--m-border);
  border-radius: 3px;
  cursor: pointer;
  accent-color: var(--m-green);
  flex-shrink: 0;
  margin-top: 2px;
}

.tnufa-checkbox-label {
  font-size: 14px;
  color: var(--m-text);
  cursor: pointer;
  text-align: right;
}

.tnufa-price-hint {
  font-size: 12px;
  color: var(--m-hint);
}

/* ── Conditional divider ───────────────────────────────────── */
.tnufa-conditional-divider {
  font-size: 13px;
  font-weight: 600;
  color: var(--m-hint);
  text-align: right;
  padding: 12px 0 8px;
  border-top: 1px dashed #e0e2ea;
  margin: 8px 0 16px;
}

/* ── Child Cards ───────────────────────────────────────────── */
.child-card {
  background: var(--m-white);
  border-radius: var(--m-radius);
  box-shadow: var(--m-shadow);
  margin-bottom: 16px;
  overflow: hidden;
  animation: tnufa-slide-in 0.2s ease;
}

@keyframes tnufa-slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.child-card-header {
  background: #f8f9fb;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e6e9ef;
}

.child-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--m-text);
}

.child-card-remove {
  background: none;
  border: none;
  color: var(--m-hint);
  font-size: 13px;
  font-family: var(--m-font);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.child-card-remove:hover {
  background: #fee2e2;
  color: #dc2626;
}

.child-card-body {
  padding: 24px 28px;
}

/* Approvals sub-section styling */
.tnufa-approvals-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e6e9ef;
}

/* Per-child price display */
.child-price-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f0fdf8;
  border: 1px solid #d1fae5;
  border-radius: 6px;
  padding: 10px 16px;
  margin-top: 20px;
  direction: rtl;
}

.child-price-display .price-label {
  font-size: 13px;
  color: var(--m-hint);
}

.child-price-display .price-amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--m-green);
}

/* ── Add Child Button ──────────────────────────────────────── */
.tnufa-add-child-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: 2px dashed var(--m-border);
  border-radius: var(--m-radius);
  background: var(--m-white);
  color: var(--m-hint);
  font-family: var(--m-font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  margin-bottom: 16px;
}

.tnufa-add-child-btn:hover {
  border-color: var(--m-green);
  color: var(--m-green);
  background: #f0fdf8;
}

/* ── Total Price Box ───────────────────────────────────────── */
.tnufa-total-box {
  background: var(--m-white);
  border-radius: var(--m-radius);
  padding: 18px 24px;
  margin-bottom: 16px;
  box-shadow: var(--m-shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  direction: rtl;
}

.tnufa-total-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--m-text);
}

.tnufa-total-amount {
  font-size: 30px;
  font-weight: 700;
  color: var(--m-green);
  direction: ltr; /* keep ₪ on the left */
}

/* ── Sibling discount notice ───────────────────────────────── */
.tnufa-discount-notice {
  background: #f0fdf8;
  border: 1px solid #d1fae5;
  border-radius: var(--m-radius);
  padding: 12px 18px;
  margin-bottom: 16px;
  color: #047857;
  font-size: 14px;
  font-weight: 500;
  text-align: right;
  direction: rtl;
}

/* Per-child price with strike (full) + net + discount tag */
.tnufa-price-strike {
  text-decoration: line-through;
  color: var(--m-hint);
  font-size: 14px;
  font-weight: 500;
  margin-left: 6px;
  direction: ltr;
  display: inline-block;
}
.tnufa-price-net {
  color: var(--m-green);
  font-size: 20px;
  font-weight: 700;
  direction: ltr;
  display: inline-block;
}
.tnufa-price-discount-tag {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 500;
  color: #047857;
  background: #d1fae5;
  padding: 2px 8px;
  border-radius: 4px;
  text-align: center;
}

/* ── Coupon box ────────────────────────────────────────────── */
.tnufa-coupon-box {
  background: var(--m-white);
  border-radius: var(--m-radius);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--m-shadow);
  direction: rtl;
}
.tnufa-coupon-box .tnufa-label {
  margin-bottom: 6px;
}

/* ── Payment method options ────────────────────────────────── */
.tnufa-payment-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tnufa-payment-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border: 2px solid var(--m-border);
  border-radius: var(--m-radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  direction: rtl;
}
.tnufa-payment-option:hover {
  border-color: var(--m-focus);
  background: #f8fbff;
}
.tnufa-payment-option input[type="radio"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--m-green);
  flex-shrink: 0;
  cursor: pointer;
}
.tnufa-payment-option input[type="radio"]:checked + span strong {
  color: var(--m-green);
}
.tnufa-payment-option:has(input:checked) {
  border-color: var(--m-green);
  background: #f0fdf8;
}
.tnufa-payment-option > span {
  text-align: right;
  flex: 1;
}
.tnufa-payment-option strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--m-text);
  margin-bottom: 4px;
}
.tnufa-payment-option small {
  display: block;
  font-size: 12px;
  color: var(--m-hint);
  line-height: 1.5;
}

/* ── No-bus message (when track/hours don't end at 15:00) ──── */
.tnufa-no-bus-message {
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #78350f;
  text-align: right;
  direction: rtl;
}

/* ── Deposit-only box ──────────────────────────────────────── */
.tnufa-deposit-box {
  background: var(--m-white);
  border: 2px solid #fbbf24;
  border-radius: var(--m-radius);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--m-shadow);
  direction: rtl;
}
.tnufa-deposit-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.tnufa-deposit-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--m-green);
  flex-shrink: 0;
  cursor: pointer;
}
.tnufa-deposit-label > span {
  text-align: right;
  flex: 1;
}
.tnufa-deposit-label strong {
  display: block;
  font-size: 15px;
  color: var(--m-text);
  margin-bottom: 4px;
}
.tnufa-deposit-label small {
  display: block;
  font-size: 13px;
  color: var(--m-hint);
  line-height: 1.5;
}
.tnufa-deposit-balance {
  margin-top: 14px;
  padding: 12px 16px;
  background: #fef9e7;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: #78350f;
  text-align: right;
}
.tnufa-deposit-balance strong {
  color: #b45309;
}

/* ── Error Box ─────────────────────────────────────────────── */
.tnufa-error-box {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: var(--m-radius);
  padding: 14px 18px;
  margin-bottom: 16px;
  color: #b91c1c;
  font-size: 14px;
  text-align: right;
  direction: rtl;
  white-space: pre-line;
}

/* ── Submit Button ─────────────────────────────────────────── */
.tnufa-submit-btn {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--m-focus);
  color: #fff;
  border: none;
  border-radius: var(--m-radius);
  font-family: var(--m-font);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
  margin-bottom: 48px;
}

.tnufa-submit-btn:hover:not(:disabled) {
  background: #0073d8;
}

.tnufa-submit-btn:disabled {
  background: var(--m-border);
  cursor: not-allowed;
}

/* ── Link ──────────────────────────────────────────────────── */
.tnufa-link {
  color: var(--m-focus);
  text-decoration: underline;
}

/* ── Conditional visibility ────────────────────────────────── */
.tnufa-conditional {
  display: none;
}
.tnufa-conditional.is-visible {
  display: block;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 520px) {
  .tnufa-wrap          { padding: 16px 8px 48px; }
  .tnufa-form-header   { padding: 20px 18px; }
  .tnufa-section       { padding: 18px 16px; }
  .child-card-body     { padding: 18px 16px; }
  .tnufa-form-title    { font-size: 18px; }
  .tnufa-total-amount  { font-size: 24px; }
}
