:root {
  --brand: #094a41;
  /* أخضر داكن */
  --accent: #bca97c;
  /* ذهبي/بيج */
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #0f1f1c;
  --muted: #5d6a68;
  --ring: rgba(9, 74, 65, 0.18);
  --border: #e9ecef;
  --error: #d94848;
  --shadow: 0 10px 26px rgba(0, 0, 0, 0.07);
  --radius: 16px;
  --trans: 200ms cubic-bezier(0.2, 0.6, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Noto Kufi Arabic", sans-serif;
  color: var(--text);
  background: var(--bg);
  align-items: center;
  min-height: 100vh;
  padding: 24px;
}

.wrap {
  width: 100%;
  max-width: 840px;
  margin-inline: auto;
}

.hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.hero-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(188, 169, 124, 0.65);
  box-shadow: var(--shadow);
  background: #fff;
  flex: 0 0 56px;
  display: grid;
  place-items: center;
}

.hero-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero h1 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--brand);
}

.hero p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.header {
  display: flex;
  justify-content: flex-end;
  /* kept space for controls if needed */
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(188, 169, 124, 0.12), transparent);
}

.badge {
  background: #fff;
  color: #1e1e1e;
  border: 1px solid rgba(188, 169, 124, 0.7);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
}

.progress {
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--brand));
  width: 0%;
  transition: width 1.2s ease;
}

.body {
  padding: 18px;
}

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }

  .grid .span-2 {
    grid-column: span 2;
  }
}

.field {
  position: relative;
}

.input,
.textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: 14px 12px;
  font-size: 1rem;
  transition: border var(--trans), box-shadow var(--trans),
    background var(--trans);
}

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

.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 6px var(--ring);
}

.label {
  position: absolute;
  right: 12px;
  top: 10px;
  padding: 0 6px;
  background: #fff;
  color: #6b7572;
  transform: translateY(0);
  transition: transform var(--trans), color var(--trans), font-size var(--trans);
  pointer-events: none;
}

.input:focus + .label,
.textarea:focus + .label,
.input:not(:placeholder-shown) + .label,
.textarea:not(:placeholder-shown) + .label {
  transform: translateY(-135%);
  font-size: 0.82rem;
  color: var(--brand);
}

.counter {
  text-align: left;
  color: #6b7572;
  font-size: 0.85rem;
  margin-top: 6px;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* الحقل العام */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #edf1f3;
  /* فallback */
  /* متغير يحدد نسبة التعبئة */
  --val: 50%;
}

/* WebKit/Chromium: نلوّن المسار بالمتغير --val */
.range::-webkit-slider-runnable-track {
  height: 12px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(
    to left,
    rgba(188, 169, 124, 0.95) 0%,
    rgba(188, 169, 124, 0.95) var(--val),
    #edf1f3 var(--val),
    #edf1f3 100%
  );
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  margin-top: -7px;
  cursor: pointer;
}

/* Firefox: نفصل التراك عن التقدم */
.range::-moz-range-track {
  height: 12px;
  background: #edf1f3;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.range::-moz-range-progress {
  height: 12px;
  background: rgba(188, 169, 124, 0.95);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.range::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

/* فallback عام للألوان في المتصفحات التي تدعم accent-color فقط */
.range {
  accent-color: var(--brand);
}

.chip {
  min-width: 58px;
  text-align: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: #f0f5f4;
  color: #0b2320;
  border: 1px solid var(--border);
  font-weight: 800;
}

.drop {
  border: 2px dashed rgba(188, 169, 124, 0.9);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  background: #fff;
  transition: background var(--trans), border-color var(--trans);
}

.drop.dragover {
  background: rgba(188, 169, 124, 0.12);
  border-color: var(--brand);
}

.drop small {
  color: #6b7572;
  display: block;
  margin-top: 6px;
}

.preview {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.preview img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.actions {
  margin-top: 4px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.2px;
  width: 100%;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 18px rgba(9, 74, 65, 0.16);
  transition: transform 80ms ease, box-shadow var(--trans), filter var(--trans),
    background var(--trans);
}

.btn:hover {
  filter: brightness(1.04);
  box-shadow: 0 12px 20px rgba(9, 74, 65, 0.22);
}

.btn:active {
  transform: translateY(1px);
}

.btn[disabled] {
  opacity: 0.8;
  cursor: progress;
}

.subnote {
  text-align: center;
  color: #6b7572;
  margin-top: 8px;
  font-weight: 600;
}

.toast {
  position: fixed;
  inset-inline: 0;
  bottom: 18px;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.toast[hidden] {
  display: none !important;
}

/* إصلاح ظهورها افتراضياً */
.toast .msg {
  pointer-events: auto;
  background: #fff;
  color: #0f312b;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  min-width: 260px;
}

.clear-btn {
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: #0b2320;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.clear-btn:hover {
  background: #f6f8f9;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.clear-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* footer */
.card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: linear-gradient(0deg, rgba(188, 169, 124, 0.04), transparent);
  display: flex;
  justify-content: center;
  align-items: center;
}
