* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0b1120;
  --bg-soft: #101a33;
  --card: #131f3d;
  --border: #23345e;
  --text: #e8edf7;
  --muted: #93a3c6;
  --accent: #4f8cff;
  --accent-2: #22d3ee;
  --green: #34d399;
  --radius: 18px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Tajawal', system-ui, sans-serif;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(79, 140, 255, .18), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(34, 211, 238, .12), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
}

.page { display: flex; flex-direction: column; min-height: 100vh; }

.main { flex: 1; width: min(1040px, 92%); margin: 0 auto; padding: 44px 0 70px; }

/* ---------- Hero ---------- */
.hero { text-align: center; margin-bottom: 34px; }
.hero-badge {
  display: inline-block;
  background: rgba(79, 140, 255, .12);
  border: 1px solid rgba(79, 140, 255, .35);
  color: var(--accent-2);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .3px;
  margin-bottom: 18px;
}
.hero-title {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 12px;
}
.hero-title span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub { color: var(--muted); max-width: 720px; margin: 0 auto; font-size: 1.02rem; }

/* ---------- Card ---------- */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px;
  box-shadow: 0 20px 60px rgba(2, 6, 23, .55);
}

/* ---------- Fields ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-bottom: 26px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

.field { margin-bottom: 24px; }
.field:last-of-type { margin-bottom: 0; }
.field-label {
  display: block;
  font-weight: 700;
  margin-bottom: 11px;
  font-size: .98rem;
}
.field-label b { color: var(--accent-2); font-weight: 800; }

.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: rgba(8, 13, 27, .6);
  border: 1px solid var(--border);
  padding: 6px;
  border-radius: 14px;
}
.seg-btn {
  flex: 1 1 auto;
  min-width: 72px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all .18s ease;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active {
  background: linear-gradient(135deg, var(--accent), #3b6fe0);
  color: #fff;
  box-shadow: 0 6px 18px rgba(79, 140, 255, .35);
}

.hint { margin-top: 9px; font-size: .8rem; color: var(--muted); }

input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.4);
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  cursor: pointer;
}
.range-labels { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-top: 6px; }

.size-input { margin-top: 12px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.size-input-label { font-size: .88rem; color: var(--muted); font-weight: 500; }
.size-input-row { display: flex; align-items: center; gap: 8px; }
.text-input {
  width: 160px;
  background: rgba(8, 13, 27, .6);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  padding: 9px 14px;
  outline: none;
}
.text-input:focus { border-color: var(--accent); }
#size-unit { font-size: .85rem; color: var(--muted); }

.size-dim-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.size-dim-group { display: flex; flex-direction: column; gap: 6px; }
.size-dim-x {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--muted);
  padding-bottom: 8px;
  user-select: none;
}

/* ---------- Dropzone ---------- */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 40px 20px;
  text-align: center;
  background: rgba(8, 13, 27, .45);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .2s ease;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: rgba(79, 140, 255, .07);
}
.dz-icon { color: var(--accent); }
.dz-title { font-weight: 700; font-size: 1.02rem; }
.dz-sub { color: var(--muted); font-size: .82rem; }

.file-list { list-style: none; margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(8, 13, 27, .5);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: .88rem;
}
.file-list .f-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list .f-size { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.file-list .f-remove {
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 1.05rem; line-height: 1;
}
.file-list .f-remove:hover { color: #f87171; }

/* ---------- Buttons ---------- */
.actions { margin-top: 26px; text-align: center; }
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #3b6fe0);
  border: none;
  color: #fff;
  font-family: inherit;
  font-weight: 800;
  font-size: 1.06rem;
  padding: 15px 26px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(79, 140, 255, .35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(79, 140, 255, .45); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: inherit;
  font-weight: 700;
  padding: 13px 26px;
  border-radius: 14px;
  cursor: pointer;
  margin-top: 10px;
}
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }

/* ---------- Result / progress ---------- */
.result.hidden, .progress.hidden, .hidden { display: none !important; }
.result-ok {
  margin-top: 26px;
  text-align: center;
  padding: 26px;
  background: rgba(52, 211, 153, .07);
  border: 1px solid rgba(52, 211, 153, .35);
  border-radius: var(--radius);
}
.result-ok svg { color: var(--green); }
.result-title { font-weight: 800; font-size: 1.2rem; margin: 6px 0 4px; }
.result-sub { color: var(--muted); font-size: .9rem; margin-bottom: 18px; }

.progress { margin-top: 24px; }
.progress-stats { display: flex; justify-content: space-between; font-size: .88rem; color: var(--muted); margin-bottom: 8px; }
.progress-bar { height: 10px; background: rgba(8, 13, 27, .7); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width .3s ease;
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid rgba(35, 52, 94, .6); padding: 20px 24px; text-align: center; }
.footer-inner { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.footer-text { color: var(--muted); font-size: .95rem; }
.footer-text strong {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 800;
}
.footer-sep { color: var(--accent); font-size: .8rem; }
.footer-tel {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--text);
  text-decoration: none;
  background: rgba(79, 140, 255, .12);
  border: 1px solid rgba(79, 140, 255, .35);
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 700;
  direction: ltr;
  font-size: .92rem;
  transition: all .15s ease;
}
.footer-tel:hover { background: rgba(79, 140, 255, .22); }