html, body { min-height: 100%; }
body { min-height: 100dvh; display: flex; align-items: flex-start; justify-content: center; padding: clamp(12px, 4vw, 48px) clamp(10px, 3vw, 32px); background: #0B3C8C; }
.backdrop { position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1200px 600px at 110% -10%, rgba(132,189,0,.30), transparent 60%),
    radial-gradient(900px 700px at -10% 110%, rgba(0,163,224,.55), transparent 60%),
    linear-gradient(135deg, #00A3E0 0%, #0062C4 45%, #0033A0 100%); }
.backdrop::after { content: ''; position: absolute; inset: 0; opacity: .08;
  background-image: radial-gradient(#fff 1.2px, transparent 1.3px); background-size: 22px 22px; }

.card { width: min(980px, 100%); background: var(--surface); border-radius: 22px; box-shadow: 0 30px 80px rgba(0, 20, 70, .35);
  padding: clamp(18px, 3.4vw, 40px); display: flex; flex-direction: column; gap: 18px; position: relative; overflow: hidden; }
.card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, var(--aramco-green), var(--aramco-blue) 55%, var(--aramco-dark-blue)); }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand img { height: clamp(26px, 4vw, 38px); display: block; }
.top-right { display: flex; align-items: center; gap: 12px; }
.back-link { font-size: 14px; color: var(--ink-2); text-decoration: none; padding: 8px 10px; border-radius: 10px; }
.back-link:hover { background: var(--surface-2); }
.lang { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; color: var(--ink-2); min-width: 46px; }
.lang button[aria-pressed="true"] { background: var(--aramco-blue); color: #fff; }

h1.hd { font-size: clamp(26px, 3.6vw, 40px); line-height: 1.15; margin: 4px 0 6px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
p.sub { margin: 0; color: var(--ink-2); font-size: clamp(15px, 1.6vw, 18px); }
.event-tag { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; color: var(--aramco-dark-blue); background: #E8F4FC; padding: 5px 11px; border-radius: 999px; margin-bottom: 6px; }

/* ---------- questions ---------- */
.qlist { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.q { border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(14px, 2vw, 22px); transition: border-color .2s, box-shadow .2s; }
.q.missing { border-color: var(--r1); box-shadow: 0 0 0 3px rgba(210, 54, 30, .12); }
.q h2 { font-size: clamp(17px, 1.9vw, 21px); margin: 0 0 14px; font-weight: 600; display: flex; gap: 10px; }
.q h2 .qn { color: var(--accent); font-weight: 700; }
.req { color: var(--r1); }

.scale { display: grid; gap: 10px; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); }
.scale.n4 { --cols: 4; } .scale.n3 { --cols: 3; }
.opt { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 112px; padding: 14px 6px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface-2);
  transition: transform .12s, border-color .15s, background .15s, box-shadow .15s; -webkit-tap-highlight-color: transparent; }
.opt:hover { border-color: color-mix(in srgb, var(--c) 55%, var(--line)); background: #fff; }
.opt:active { transform: scale(.97); }
.opt .ico svg { width: clamp(38px, 5vw, 52px); height: clamp(38px, 5vw, 52px); display: block; }
.opt .lbl { font-size: clamp(12px, 1.3vw, 14px); color: var(--ink-2); text-align: center; line-height: 1.25; }
.opt .tick { position: absolute; top: 7px; inset-inline-end: 8px; width: 20px; height: 20px; border-radius: 50%; background: var(--c); color: #fff; font-size: 12px; display: grid; place-items: center; opacity: 0; transform: scale(.5); transition: .15s; }
.opt.selected { border-color: var(--c); background: color-mix(in srgb, var(--c) 9%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.opt.selected .lbl { color: var(--ink); font-weight: 600; }
.opt.selected .tick { opacity: 1; transform: scale(1); }
.scale.has-choice .opt:not(.selected) { opacity: .62; }
.scale.has-choice .opt:not(.selected):hover { opacity: 1; }

.dot { width: clamp(42px, 5vw, 54px); height: clamp(42px, 5vw, 54px); border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 20px;
  border: 3px solid var(--c); color: var(--c); background: #fff; transition: .15s; }
.opt.selected .dot { background: var(--c); color: #fff; }
.big-num { font-size: clamp(32px, 4.4vw, 46px); font-weight: 700; color: var(--c); line-height: 1; }
.opt.selected .big-num { transform: scale(1.08); }

.scale-stars { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.star-row { display: flex; gap: clamp(6px, 1.4vw, 16px); justify-content: center; direction: ltr; }
[dir="rtl"] .star-row { direction: rtl; }
.star { border: 0; background: transparent; padding: 4px; border-radius: 12px; }
.star svg { width: clamp(46px, 7vw, 70px); height: clamp(46px, 7vw, 70px); display: block; transition: transform .12s; }
.star:hover svg { transform: scale(1.08); }
.star-caption { min-height: 24px; font-weight: 600; color: var(--ink-2); }

/* ---------- comment & submit ---------- */
.comment label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 16px; }
textarea { width: 100%; min-height: 96px; border-radius: 12px; border: 1.5px solid var(--line); padding: 12px 14px; resize: vertical; background: var(--surface-2); font-size: 16px; }
textarea:focus { outline: none; border-color: var(--accent); background: #fff; }
.actions { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 4px; }
.btn-primary { appearance: none; border: 0; border-radius: 999px; padding: 16px 44px; font-size: 18px; font-weight: 700; color: #fff;
  background: linear-gradient(90deg, var(--aramco-dark-blue), var(--accent)); box-shadow: 0 10px 24px rgba(0, 51, 160, .25); min-width: 240px; transition: transform .12s, filter .15s; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary[aria-disabled="true"] { filter: grayscale(.4); opacity: .55; }
.hint { color: var(--r1); font-size: 14px; min-height: 18px; }

/* ---------- step layout ---------- */
.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--aramco-green), var(--accent)); transition: width .35s ease; }
.step { min-height: 300px; display: flex; flex-direction: column; justify-content: center; gap: 22px; animation: slideIn .35s ease; }
.step .qcount { font-weight: 600; color: var(--accent); font-size: 14px; letter-spacing: .04em; text-transform: uppercase; }
.step h2 { font-size: clamp(24px, 3.4vw, 36px); margin: 0; line-height: 1.2; }
.step .opt { min-height: 150px; }
.step-nav { display: flex; justify-content: space-between; align-items: center; }
.link-btn { border: 0; background: none; color: var(--ink-2); padding: 10px; font-size: 15px; }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
[dir="rtl"] .step { animation-name: slideInRtl; }
@keyframes slideInRtl { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }

/* ---------- thanks ---------- */
.thanks { min-height: 360px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; animation: slideIn .35s ease; }
.check { width: 108px; height: 108px; }
.check circle { stroke: var(--aramco-dark-green); stroke-width: 4; fill: #EAF6EF; stroke-dasharray: 320; stroke-dashoffset: 320; animation: draw .6s ease forwards; }
.check path { stroke: var(--aramco-dark-green); stroke-width: 6; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 80; stroke-dashoffset: 80; animation: draw .45s .45s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.thanks h1 { font-size: clamp(26px, 3.6vw, 38px); margin: 0; }
.thanks .count { color: var(--ink-3); font-size: 14px; }

/* ---------- picker ---------- */
.search { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); font-size: 16px; margin: 6px 0 2px; }
.events { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 10px; }
.ev { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; background: #fff; position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s; }
.ev::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--c, var(--aramco-blue)); }
[dir="rtl"] .ev::before { inset: 0 0 0 auto; }
.ev:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: transparent; }
.ev h3 { margin: 0; font-size: 18px; }
.ev .meta { color: var(--ink-2); font-size: 14px; }
.ev .go { margin-top: 8px; font-weight: 600; color: var(--aramco-dark-blue); font-size: 14px; }
.empty { text-align: center; color: var(--ink-2); padding: 40px 10px; }

/* ---------- footer / sync ---------- */
.bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13px; border-top: 1px solid var(--line); padding-top: 14px; flex-wrap: wrap; }
.sync-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; color: var(--ink-2); }
.sdot { width: 8px; height: 8px; border-radius: 50%; background: var(--aramco-dark-green); box-shadow: 0 0 0 3px rgba(0,132,61,.15); }
.sync-pill.offline .sdot { background: #E08A00; box-shadow: 0 0 0 3px rgba(224,138,0,.18); }
.sync-pill.busy .sdot { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- dialog ---------- */
.dlg { border: 0; border-radius: 18px; padding: 0; width: min(520px, calc(100% - 24px)); box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.dlg::backdrop { background: rgba(10, 25, 60, .45); }
.dlg-body { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.dlg h2 { margin: 0; font-size: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-2); }
.field input { border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 16px; color: var(--ink); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats div { background: var(--surface-2); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.stats b { font-size: 22px; }
.stats span { font-size: 12px; color: var(--ink-2); }
.dlg-actions { display: flex; flex-direction: column; gap: 8px; }
.btn { border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 11px 14px; font-weight: 600; text-align: center; font-size: 15px; }
.btn.primary { background: var(--aramco-dark-blue); border-color: var(--aramco-dark-blue); color: #fff; }
.btn.ghost { border-color: transparent; }
.btn.file { cursor: pointer; }
.muted { color: var(--ink-2); } .small { font-size: 13px; margin: 0; }
.msg { min-height: 18px; margin: 0; font-size: 14px; color: var(--aramco-dark-green); font-weight: 600; }
.dlg-foot { display: flex; justify-content: flex-end; }

@media (max-width: 640px) {
  body { padding: 0; background: #fff; }
  .card { border-radius: 0; min-height: 100dvh; box-shadow: none; }
  .scale:not(.scale-stars) { grid-template-columns: 1fr; gap: 8px; }
  .opt { flex-direction: row; justify-content: flex-start; min-height: 60px; padding: 10px 14px; gap: 14px; }
  .step .opt { min-height: 64px; }
  .opt .ico svg { width: 36px; height: 36px; }
  .dot { width: 38px; height: 38px; font-size: 17px; }
  .big-num { font-size: 28px; width: 38px; text-align: center; }
  .opt .lbl { font-size: 16px; text-align: start; }
  .opt .tick { top: 50%; margin-top: -10px; inset-inline-end: 14px; }
  .btn-primary { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.star svg, .star svg * { pointer-events: none; }
.star .star-shape { transition: fill .12s, stroke .12s; }
.star.on .star-shape { fill: #FFC846; stroke: #E0A800; }
