/* Digital Plus support site - light first, manual dark mode (data-theme="dark"). */
:root {
  --p: #5b1ee6; --p2: #702dff; --p3: #a77fff; --bg: #f6f2ff; --card: #ffffff; --ink: #090040;
  --muted: #6b6290; --line: #ece4ff; --soft: #f6f2ff; --yellow: #ffd84d; --ok: #1f8a4c; --bad: #c62828;
  --shadow: 0 10px 30px rgba(91, 30, 230, .10); --radius: 20px;
}
[data-theme="dark"] {
  --bg: #0d0a22; --card: #17123a; --ink: #f1edff; --muted: #a9a2cc; --line: #2a2356; --soft: #201a4a;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.75 "IBM Plex Sans Arabic", Tahoma, Arial, sans-serif;
  min-height: 100vh; transition: background .25s, color .25s;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--p2); }
.wrap { max-width: 640px; margin: 0 auto; padding: 18px 16px 48px; }

/* header */
.top { max-width: 640px; margin: 0 auto; padding: 16px 16px 4px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; background: linear-gradient(135deg, var(--p), var(--p3)); display: grid; place-items: center; box-shadow: var(--shadow); }
.brand-mark img { width: 26px; height: auto; }
.brand small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); line-height: 1.3; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); cursor: pointer; display: grid; place-items: center; }
.link-btn { border: 0; background: none; color: var(--p2); font-weight: 600; cursor: pointer; padding: 6px 4px; text-decoration: none; font-size: 15px; }

/* cards & text */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 20px; margin-top: 16px; border: 1px solid var(--line); }
h1 { font-size: 24px; line-height: 1.5; margin: 6px 0 6px; }
h2 { font-size: 19px; line-height: 1.5; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.step-title { display: flex; align-items: center; gap: 10px; font-weight: 700; margin: 0 0 12px; }
.step-num { width: 26px; height: 26px; border-radius: 9px; background: linear-gradient(135deg, var(--p), var(--p3)); color: #fff; font-size: 13px; display: grid; place-items: center; flex: none; }
.hours { display: inline-flex; gap: 8px; align-items: center; background: var(--soft); border-radius: 12px; padding: 8px 12px; font-size: 14px; color: var(--muted); }
.hours b { color: var(--ink); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 14px 20px; font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .12s, opacity .2s, box-shadow .2s; min-height: 50px; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--p), var(--p2)); color: #fff; box-shadow: 0 8px 20px rgba(91, 30, 230, .28); }
.btn-ghost { background: var(--soft); color: var(--p2); }
.btn-wa { background: #25d366; color: #fff; }
.btn-block { width: 100%; }
.big-actions { display: grid; gap: 12px; margin-top: 18px; }
.big-btn { display: flex; align-items: center; gap: 14px; text-align: right; padding: 18px; border-radius: 18px; border: 2px solid var(--line); background: var(--card); cursor: pointer; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: border-color .2s, transform .12s; width: 100%; }
.big-btn:hover { border-color: var(--p3); }
.big-btn:active { transform: scale(.99); }
.big-btn .ic { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; flex: none; background: var(--soft); color: var(--p2); }
.big-btn.primary .ic { background: linear-gradient(135deg, var(--p), var(--p3)); color: #fff; }
.big-btn b { display: block; font-size: 17px; }
.big-btn span { font-size: 14px; color: var(--muted); }

/* forms */
label.lbl { display: block; font-weight: 600; margin: 0 0 6px; font-size: 15px; }
.input, textarea.input, select.input { width: 100%; border: 2px solid var(--line); background: var(--card); border-radius: 14px; padding: 12px 14px; outline: none; transition: border-color .2s, box-shadow .2s; min-height: 50px; }
.input:focus { border-color: var(--p3); box-shadow: 0 0 0 4px rgba(167, 127, 255, .18); }
textarea.input { min-height: 120px; resize: vertical; }
.input.code { text-align: center; letter-spacing: 10px; font-size: 24px; font-weight: 700; direction: ltr; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.field { margin-bottom: 16px; }
.req { color: var(--bad); }
.err { background: #ffebee; color: var(--bad); border-radius: 12px; padding: 10px 14px; font-weight: 600; font-size: 15px; margin-top: 12px; }
[data-theme="dark"] .err { background: rgba(198, 40, 40, .15); }
.ok-box { background: #e9f8ef; color: var(--ok); border-radius: 12px; padding: 10px 14px; font-weight: 600; font-size: 15px; margin-top: 12px; }
[data-theme="dark"] .ok-box { background: rgba(31, 138, 76, .15); }
.note { background: #fff8db; color: #7a5a00; border-radius: 12px; padding: 12px 14px; font-size: 15px; margin-top: 12px; }
[data-theme="dark"] .note { background: rgba(255, 216, 77, .12); color: var(--yellow); }

/* choice cards */
.choices { display: grid; gap: 10px; }
.choices.two { grid-template-columns: 1fr 1fr; }
.choice { display: flex; align-items: center; gap: 12px; padding: 12px; border: 2px solid var(--line); border-radius: 16px; background: var(--card); cursor: pointer; text-align: right; width: 100%; transition: border-color .15s, background .15s; }
.choice.on { border-color: var(--p2); background: var(--soft); }
.choice img, .choice .ph { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; flex: none; background: var(--soft); }
.choice .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--soft); color: var(--p2); display: grid; place-items: center; flex: none; }
.choice .tick { margin-inline-start: auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.choice.on .tick { border-color: var(--p2); background: var(--p2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/14px no-repeat; }

/* order entry with Vorti */
.ask { display: flex; align-items: flex-end; gap: 12px; }
.ask .grow { flex: 1; min-width: 0; }
.bubble { background: var(--soft); border-radius: 16px 16px 4px 16px; padding: 8px 12px; font-size: 14px; font-weight: 600; display: inline-block; margin-bottom: 8px; }

.vorti { position: relative; width: 84px; height: 99px; flex: none; transform-origin: 50% 100%; animation: v-sway 6s ease-in-out infinite; }
.vorti img { position: absolute; inset: 0; width: 100%; height: 100%; }
.vorti .eyes { transform-origin: 50% 35%; animation: v-blink 4.5s infinite; }
.vorti .arm { transform-origin: 68% 58%; animation: v-wave 6s ease-in-out infinite; }
.vorti.lg { width: 120px; height: 141px; margin: 0 auto 6px; }
@keyframes v-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes v-sway { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-2deg); } }
@keyframes v-wave { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(-14deg); } 86% { transform: rotate(6deg); } 93% { transform: rotate(-8deg); } }
@media (prefers-reduced-motion: reduce) { .vorti, .vorti .eyes, .vorti .arm { animation: none !important; } }

/* images */
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumb { position: relative; width: 72px; height: 72px; border-radius: 12px; overflow: hidden; background: var(--soft); border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.thumb .x { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(9, 0, 64, .7); color: #fff; cursor: pointer; font-size: 13px; line-height: 22px; padding: 0; }
.thumb.busy::after { content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, .6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='%235b1ee6' stroke-width='3' stroke-dasharray='40 20'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='0.9s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") center/28px no-repeat; }
.add-img { width: 72px; height: 72px; border-radius: 12px; border: 2px dashed var(--p3); background: transparent; color: var(--p2); cursor: pointer; font-size: 26px; }
.lightbox { position: fixed; inset: 0; background: rgba(9, 0, 64, .85); display: grid; place-items: center; z-index: 50; padding: 16px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 12px; }

/* ticket */
.t-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.t-num { font-size: 20px; font-weight: 700; direction: ltr; }
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.s-new { background: #ede5ff; color: var(--p); }
.s-in_progress { background: #e3f2fd; color: #1565c0; }
.s-awaiting_customer { background: #fff3c4; color: #7a5a00; }
.s-resolved { background: #e3f6ea; color: var(--ok); }
.s-closed { background: #eceaf3; color: #5c5878; }
[data-theme="dark"] .badge { filter: saturate(1.2) brightness(.95); }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14px; margin-top: 12px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; font-weight: 600; }
.await-bar { background: linear-gradient(135deg, #fff6cf, #fff0b3); color: #6b4d00; border-radius: 14px; padding: 12px 14px; font-weight: 600; margin-top: 14px; display: flex; gap: 10px; align-items: center; }
[data-theme="dark"] .await-bar { background: rgba(255, 216, 77, .14); color: var(--yellow); }
.chat { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.msg { max-width: 86%; padding: 12px 14px; border-radius: 18px; white-space: pre-wrap; word-wrap: break-word; }
.msg.me { align-self: flex-start; background: linear-gradient(135deg, var(--p), var(--p2)); color: #fff; border-bottom-right-radius: 6px; }
.msg.staff { align-self: flex-end; background: var(--soft); border-bottom-left-radius: 6px; }
.msg.system { align-self: center; background: transparent; color: var(--muted); font-size: 13px; padding: 4px; }
.msg .who { font-size: 12px; font-weight: 700; opacity: .85; margin-bottom: 2px; }
.msg .when { font-size: 11.5px; opacity: .75; margin-top: 6px; }
.msg .thumbs { margin-top: 8px; }
.reply { position: sticky; bottom: 0; background: var(--card); border-top: 1px solid var(--line); padding-top: 12px; margin-top: 16px; }

/* lists */
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); margin-bottom: 10px; background: var(--card); }
.empty { text-align: center; padding: 18px 6px; }
.faq { background: var(--soft); border-radius: 14px; padding: 14px 16px; line-height: 1.9; }
.faq img { max-width: 100%; border-radius: 10px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .8s linear infinite; }
.spinner.dark { border-color: var(--line); border-top-color: var(--p2); }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 40px; }
.fade { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 420px) { h1 { font-size: 21px; } .card { padding: 18px 16px; } .choices.two { grid-template-columns: 1fr; } }
