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

:root {
  --green-dark: #0b4a3c;
  --green: #10704f;
  --green-light: #e8f3ed;
  --gold: #c9a227;
  --gold-light: #f6ecc9;
  --ink: #1f2a24;
  --muted: #6b7a72;
  --border: #dfe7e2;
  --bg: #f7f8f4;
  --card: #ffffff;
  --danger: #c0392b;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(15, 60, 45, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Cairo', sans-serif;
  direction: rtl;
}

body {
  background-image: radial-gradient(circle at 15% 0%, var(--green-light) 0%, transparent 45%),
                     radial-gradient(circle at 100% 10%, var(--gold-light) 0%, transparent 40%);
  background-attachment: fixed;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

/* Header */
.hero {
  text-align: center;
  padding: 36px 20px 28px;
  color: #fff;
  background: linear-gradient(160deg, var(--green-dark), var(--green));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0 12px, transparent 12px 24px);
  pointer-events: none;
}

.hero .leaf { font-size: 30px; display: block; margin-bottom: 6px; }
.hero h1 { margin: 0 0 8px; font-size: 26px; font-weight: 800; }
.hero p { margin: 0; opacity: 0.92; font-size: 15px; line-height: 1.9; }
.hero .badge {
  display: inline-block;
  margin-top: 14px;
  background: var(--gold);
  color: #3a2c00;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 999px;
}

/* Sections */
.section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  margin-top: 20px;
}

.section h2 {
  font-size: 17px;
  color: var(--green-dark);
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section h2 .num {
  background: var(--green);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.section .hint {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 18px 34px;
}

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

.field label.q {
  display: block;
  font-weight: 700;
  font-size: 14.5px;
  margin-bottom: 8px;
  color: var(--ink);
}

.field label.q .req { color: var(--danger); margin-right: 4px; }

input[type=text], input[type=number], input[type=tel], select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  background: #fcfdfc;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(16,112,79,0.12);
}

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

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }

/* Choice chips / checkboxes */
.choices { display: flex; flex-wrap: wrap; gap: 10px; }

.choice {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
  transition: all .15s;
  background: #fcfdfc;
}

.choice input { display: none; }

.choice:has(input:checked) {
  border-color: var(--green);
  background: var(--green-light);
  color: var(--green-dark);
  font-weight: 700;
}

.choice.radio { min-width: 90px; text-align: center; }

/* Yes/No row */
.yn { display: flex; gap: 10px; }
.yn .choice { flex: 1; text-align: center; }

/* File upload */
.upload-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 22px 18px;
  text-align: center;
  cursor: pointer;
  background: #fcfdfc;
  width: 100%;
  transition: border-color .15s, background .15s;
}
.upload-box:hover { border-color: var(--green); background: var(--green-light); }
.upload-box input { display: none; }
.upload-box .icon { font-size: 26px; line-height: 1; margin-bottom: 8px; }
.upload-box .txt { color: var(--muted); font-size: 13.5px; max-width: 240px; }

.preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.preview-thumb {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.preview-thumb img { width: 100%; height: 100%; object-fit: cover; }
.preview-thumb .rm {
  position: absolute;
  top: 2px;
  left: 2px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
}

/* Audio recorder */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab-btn {
  flex: 1;
  padding: 9px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #fcfdfc;
  font-family: inherit;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  color: var(--muted);
}
.tab-btn.active { background: var(--green); border-color: var(--green); color: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.verse-box {
  background: var(--gold-light);
  border: 1px solid #ecdca0;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  margin-bottom: 14px;
}
.verse-box .ar { font-size: 19px; font-weight: 700; color: #6a4e00; line-height: 2; }
.verse-box .ref { font-size: 12.5px; color: #8a7530; margin-top: 4px; }

.recorder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.rec-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: var(--danger);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(192,57,43,0.35);
}
.rec-btn.recording { animation: pulse 1.2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(192,57,43,0.5); }
  70% { box-shadow: 0 0 0 16px rgba(192,57,43,0); }
  100% { box-shadow: 0 0 0 0 rgba(192,57,43,0); }
}
.rec-status { font-size: 13px; color: var(--muted); }
.rec-time { font-size: 20px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
audio { width: 100%; margin-top: 8px; }

/* Traditional checkbox for the agreement field */
.agree-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  padding: 4px 2px;
}
.agree-check input[type=checkbox] {
  appearance: auto;
  -webkit-appearance: checkbox;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--green);
  cursor: pointer;
  margin-top: 2px;
}
.field.invalid .agree-check { color: var(--danger); }
.field.invalid .agree-check input[type=checkbox] { outline: 2px solid var(--danger); outline-offset: 2px; border-radius: 4px; }

/* Agreement box */
.agree-box {
  background: #fff7ec;
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13.5px;
  color: #6a4e00;
  line-height: 1.9;
  margin-bottom: 12px;
}

/* Submit */
.submit-bar { margin-top: 24px; }
.submit-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--green), var(--green-dark));
  color: #fff;
  font-family: inherit;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(16,112,79,0.28);
  transition: transform .1s;
}
.submit-btn:active { transform: scale(0.98); }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.error-msg {
  color: var(--danger);
  font-size: 12.5px;
  margin-top: 6px;
  display: none;
}
.field.invalid .error-msg { display: block; }
.field.invalid input, .field.invalid select, .field.invalid textarea {
  border-color: var(--danger);
}

/* Success screen */
.success-screen {
  display: none;
  text-align: center;
  padding: 60px 20px;
}
.success-screen .icon { font-size: 60px; }
.success-screen h2 { color: var(--green-dark); margin: 12px 0 6px; }
.success-screen p { color: var(--muted); }

.foot-note {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 26px;
}
