/* MOMENT PARFUM — مصمم العطور الشخصي (ثيم مونوكروم) */
:root {
  --bg: #f6f4f0;
  --card: #ffffff;
  --ink: #101010;
  --muted: #6f6a62;
  --accent: #101010;
  --accent-soft: #2b2b2b;
  --line: #e6e2da;
  --soft: #f0ede7;
  --ok: #2e7d32;
  --warn: #b3261e;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(20, 18, 14, .07);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Tajawal', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.7;
}

.wrap { max-width: 560px; margin: 0 auto; padding: 18px 16px 90px; }

/* ===== الهيدر ===== */
header.brand {
  text-align: center;
  padding: 22px 0 8px;
}
.brand .mark {
  height: 170px;
  display: block;
  margin: 0 auto 2px;
}
.brand .tag {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 1px;
  margin-top: 2px;
}
.brand .rule {
  width: 64px; height: 2px; background: var(--ink);
  margin: 14px auto 0; border-radius: 2px;
}

/* ===== شاشة البداية ===== */
.hero {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 24px;
  text-align: center;
  margin-top: 18px;
}
.hero h1 { font-size: 24px; margin-bottom: 10px; font-weight: 800; }
.hero p { color: var(--muted); font-size: 15px; }
.hero .bottle { font-size: 48px; margin-bottom: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #fff; border: none; cursor: pointer;
  font-family: inherit; font-size: 17px; font-weight: 700;
  padding: 14px 34px; border-radius: 50px;
  box-shadow: 0 6px 18px rgba(16, 16, 16, .25);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s;
  text-decoration: none;
  position: relative;
}
.btn:active { transform: scale(.97); }
.btn.ghost {
  background: transparent; color: var(--ink);
  border: 2px solid var(--ink); box-shadow: none;
}
.btn.small { font-size: 14px; padding: 10px 20px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn .soon {
  position: absolute; top: -9px; left: 14px;
  background: #fff; color: var(--ink);
  border: 1.5px solid var(--ink);
  font-size: 10.5px; font-weight: 800; letter-spacing: 1px;
  padding: 1px 9px; border-radius: 20px;
}

/* ===== شريط التقدم ===== */
.progress {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  padding: 10px 0 8px;
}
.progress .bar {
  height: 6px; background: var(--line); border-radius: 6px; overflow: hidden;
}
.progress .bar i {
  display: block; height: 100%; width: 0;
  background: var(--ink);
  border-radius: 6px; transition: width .35s ease;
}
.progress .num { font-size: 12px; color: var(--muted); margin-top: 4px; text-align: left; }

/* ===== بطاقة السؤال ===== */
.qcard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px;
  margin-top: 14px;
  animation: rise .35s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.qcard h2 { font-size: 20px; margin-bottom: 4px; font-weight: 800; }
.qcard .hint { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; }

.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fdfcfa;
  padding: 13px 14px;
  cursor: pointer; user-select: none;
  font-size: 15.5px; font-weight: 500;
  transition: border-color .15s, background .15s, transform .1s;
}
.opt:active { transform: scale(.985); }
.opt .ico { font-size: 22px; width: 30px; text-align: center; flex-shrink: 0; }
.opt small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; line-height: 1.45; }
.opt.sel {
  border-color: var(--ink);
  background: var(--soft);
  box-shadow: 0 0 0 3px rgba(16, 16, 16, .1);
}

textarea.txt, input.txt {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fdfcfa;
  padding: 13px 14px;
  font-family: inherit; font-size: 15.5px;
  color: var(--ink);
  resize: vertical;
  outline: none;
}
textarea.txt:focus, input.txt:focus { border-color: var(--ink); }
textarea.txt { min-height: 96px; }

.colorpick {
  display: flex; align-items: center; gap: 10px; margin-top: 12px;
  background: var(--soft); border-radius: 14px; padding: 12px;
}
.colorpick input[type="color"] {
  width: 52px; height: 52px; border: none; border-radius: 12px;
  background: none; cursor: pointer; padding: 0;
}
.colorpick input.txt { flex: 1; }

.nav { display: flex; gap: 10px; margin-top: 18px; }
.nav .btn { flex: 1; }

/* ===== شاشة التحليل ===== */
.loading { text-align: center; padding: 70px 20px; }
.loading .flask { font-size: 58px; animation: swirl 1.6s ease-in-out infinite; display: inline-block; }
@keyframes swirl { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg) translateY(-6px); } }
.loading p { color: var(--muted); margin-top: 14px; font-size: 15px; }

/* ===== النتيجة ===== */
.result-head {
  text-align: center;
  background: linear-gradient(165deg, #0c0c0c, #262421 70%, #3a362f);
  color: #f5f2ec;
  border-radius: var(--radius);
  padding: 30px 20px 26px;
  margin-top: 14px;
  box-shadow: var(--shadow);
}
.result-head .mark-light { height: 76px; opacity: .95; margin-bottom: 8px; filter: invert(1); }
.result-head .lbl { font-size: 12.5px; color: #b9b2a4; letter-spacing: 4px; }
.result-head .pname {
  font-size: 36px; line-height: 1.3; margin: 6px 0 2px; font-weight: 800;
}
.result-head .pname-en { font-size: 13.5px; letter-spacing: 4px; color: #cfc8b8; }
.result-head .meaning { font-size: 14px; color: #e3ddd0; margin-top: 8px; }
.result-head .famline { margin-top: 12px; font-size: 14px; color: #b9b2a4; }

.sec {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-top: 14px;
}
.sec h3 {
  font-size: 16.5px; display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px; color: var(--ink); font-weight: 800;
}
.sec h3::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.pyr { display: grid; gap: 10px; }
.pyr .layer {
  border-right: 4px solid var(--ink);
  background: var(--soft);
  border-radius: 10px;
  padding: 10px 14px;
}
.pyr .layer b { font-size: 14px; color: var(--ink); }
.pyr .layer p { font-size: 14.5px; margin-top: 2px; color: #3c3833; }

.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv .cell {
  background: var(--soft); border-radius: 12px; padding: 10px 12px;
  border: 1px solid var(--line);
}
.kv .cell b { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.kv .cell span { font-size: 15.5px; font-weight: 700; }
.kv .cell .dot {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%;
  vertical-align: -2px; margin-left: 6px; border: 1px solid rgba(0,0,0,.18);
}

.names .alt { display: flex; align-items: baseline; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.names .alt:last-child { border-bottom: none; }
.names .alt b { font-size: 17px; }
.names .alt small { color: var(--muted); font-size: 13px; }

/* ===== أزرار النتيجة ===== */
.actions { display: grid; gap: 10px; margin-top: 16px; }
.btn.wa { background: linear-gradient(135deg, #25d366, #128c7e); box-shadow: 0 6px 18px rgba(18, 140, 126, .3); }
.toast {
  position: fixed; bottom: 24px; right: 50%; transform: translateX(50%);
  background: var(--ink); color: #fff; font-size: 14px;
  padding: 10px 22px; border-radius: 40px; opacity: 0;
  transition: opacity .3s; pointer-events: none; z-index: 99;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; }

footer {
  text-align: center; color: var(--muted); font-size: 12.5px;
  margin-top: 30px; padding-bottom: 10px;
}
footer a { color: var(--ink); text-decoration: none; font-weight: 700; }

.hidden { display: none !important; }

/* admin */
table.adm { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
table.adm th, table.adm td { border: 1px solid var(--line); padding: 7px 9px; text-align: right; vertical-align: top; }
table.adm th { background: var(--soft); }
