/* PTOC RADAR institutional pages: one design system, dark and light, Arabic and English. */
@import url('/preview/fonts/fonts.css');

:root, :root[data-theme="dark"] {
  --bg: #07111d; --bg-2: #0b1a2a; --surface: rgba(14, 30, 46, .72); --surface-solid: #0e1e2e;
  --line: rgba(142, 178, 196, .22); --text: #e8f1f5; --muted: #9bb2bd; --accent: #54e1bd; --accent-ink: #04231b;
  --warn: #f0b24a; --danger: #ef675f; --glow: rgba(84, 225, 189, .16); --globe-land: #54e1bd; --focus: #54e1bd;
}
:root[data-theme="light"] {
  --bg: #edf3f7; --bg-2: #e2ebf1; --surface: rgba(255, 255, 255, .82); --surface-solid: #ffffff;
  --line: rgba(20, 52, 72, .2); --text: #0d2230; --muted: #4a6372; --accent: #0b7d65; --accent-ink: #ffffff;
  --warn: #8a5a00; --danger: #b3261e; --glow: rgba(11, 125, 101, .12); --globe-land: #0b7d65; --focus: #0b7d65;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.site {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 16px/1.65 'RB-Regular', system-ui, 'Segoe UI', Tahoma, sans-serif;
  background-image: radial-gradient(1100px 600px at 80% -10%, var(--glow), transparent 60%);
}
.site h1, .site h2, .site h3, .site b, .site strong { font-family: 'RB-Bold', 'RB-Regular', system-ui, sans-serif; font-weight: 700; }
.site a:not(.btn):not(.chip):not(.brand) { color: var(--accent); }
.site a.btn { color: var(--accent-ink); }
.site a.btn.ghost { color: var(--accent); }
.site a.chip { color: var(--text); }
.site :focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; inset-inline-start: 12px; top: -48px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; z-index: 20; }
.skip:focus { top: 12px; }

html[lang="ar"] [data-lang="en"], html[lang="en"] [data-lang="ar"] { display: none !important; }

.topbar { flex-wrap: wrap; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px clamp(16px, 4vw, 40px); position: relative; z-index: 5; }
.brand { white-space: nowrap; font-family: 'RB-Bold', sans-serif; letter-spacing: .14em; font-size: 15px; color: var(--text); text-decoration: none; display: inline-flex; gap: 8px; align-items: center; }
.brand b { color: var(--accent); }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--glow); }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { font: inherit; font-size: 13px; min-height: 40px; min-width: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.chip:hover { border-color: var(--accent); }
.chip .sym { display: none; font-size: 16px; }

.btn { font: inherit; font-family: 'RB-Bold', sans-serif; min-height: 48px; padding: 0 24px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-size: 16px; transition: transform .15s ease, box-shadow .15s ease; }
.btn:hover { box-shadow: 0 6px 22px var(--glow); transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: clamp(20px, 3vw, 32px); backdrop-filter: blur(10px); }
.muted { color: var(--muted); }

/* Landing */
.hero { position: relative; min-height: min(86vh, 820px); display: grid; align-items: center; padding: 0 clamp(16px, 4vw, 40px); overflow: hidden; }
.scene { position: absolute; inset: 0; z-index: 0; }
.scene canvas { width: 100%; height: 100%; display: block; }
.scene-fallback { position: absolute; inset: 0; background: radial-gradient(circle at 70% 50%, var(--glow), transparent 55%); }
.hero-copy { position: relative; z-index: 2; max-width: 620px; padding: 32px 0; }
.eyebrow { font-size: 13px; letter-spacing: .08em; color: var(--accent); margin: 0 0 14px; }
.hero h1 { font-size: clamp(34px, 6vw, 60px); line-height: 1.12; margin: 0 0 18px; }
.hero p.lead { font-size: clamp(16px, 2vw, 19px); color: var(--muted); margin: 0 0 28px; max-width: 54ch; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.request-link { display: inline-block; margin-top: 18px; font-size: 15px; }
.scope-line { position: relative; z-index: 2; font-size: 13px; color: var(--muted); padding-bottom: 28px; }

.band { padding: clamp(40px, 7vw, 84px) clamp(16px, 4vw, 40px); border-top: 1px solid var(--line); }
.band-inner { max-width: 1120px; margin: 0 auto; }
.band h2 { font-size: clamp(22px, 3vw, 30px); margin: 0 0 8px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); margin-top: 24px; }
.grid .card h3 { margin: 0 0 6px; font-size: 18px; }
.grid .card p { margin: 0; color: var(--muted); font-size: 15px; }

.footer { padding: 28px clamp(16px, 4vw, 40px) 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.footer-inner { max-width: 1120px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }

/* Request form */
.request { max-width: 560px; margin: 0 auto; }
.field { display: grid; gap: 6px; margin-bottom: 16px; font-size: 15px; }
.field input, .field textarea { font: inherit; color: var(--text); background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; min-height: 48px; width: 100%; }
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--glow); }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); margin: 0 0 16px; font-size: 15px; }
.notice.ok { border-color: var(--accent); }
.notice.err { border-color: var(--danger); color: var(--danger); }
.notice:empty { display: none; }

/* Login */
.auth { min-height: calc(100vh - 80px); display: grid; place-items: center; padding: 24px clamp(16px, 4vw, 40px); }
.auth .card { width: min(440px, 100%); }
.auth h1 { font-size: 26px; margin: 0 0 6px; }
.auth .links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 18px; font-size: 14px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }

@media (max-width: 900px) {
  .hero { min-height: auto; padding-top: 12px; }
  .hero-copy { padding-top: 300px; }
}
@media (max-width: 720px) {
  .chip.hide-sm { display: none; }
  .chip .full { display: none; }
  .chip .sym { display: inline; }
  .hero-copy { padding-top: 250px; }
  .cta .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }
.btn.block { width: 100%; }

/* ---- Interaction layer ---- */
.scroll-progress { position: fixed; inset-block-start: 0; inset-inline: 0; height: 2px; z-index: 30; background: var(--accent); transform-origin: left center; transform: scaleX(0); pointer-events: none; }
html[dir="rtl"] .scroll-progress { transform-origin: right center; }
.topbar { position: sticky; top: 0; transition: background .25s ease, border-color .25s ease, backdrop-filter .25s ease; border-bottom: 1px solid transparent; }
.topbar.scrolled { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom-color: var(--line); }
.chip { transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.chip:active { transform: scale(.97); }
.btn { position: relative; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
.btn:active { transform: translateY(0) scale(.98); }

/* Reveal: the hidden start state exists only once the script has run */
.js-reveal [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .6s ease var(--reveal-delay, 0ms), transform .6s cubic-bezier(.2, .7, .2, 1) var(--reveal-delay, 0ms); }
.js-reveal [data-reveal].in { opacity: 1; transform: none; }

/* Hero: the globe is draggable, so the copy lets pointers through except on its controls */
.hero-copy { pointer-events: none; }
.hero-copy a, .hero-copy button { pointer-events: auto; }
.scene canvas { cursor: grab; touch-action: pan-y; }
.scene.dragging canvas { cursor: grabbing; }
.hero-foot { position: relative; z-index: 2; display: grid; gap: 10px; padding-bottom: 28px; }
.hero-foot .scope-line { padding-bottom: 0; margin: 0; }
.places { display: grid; gap: 8px; max-width: 720px; }
.places-row { display: flex; flex-wrap: wrap; gap: 8px; }
.place-chip { font: inherit; font-size: 13px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; transition: border-color .2s ease, background .2s ease, color .2s ease, transform .2s ease; }
.place-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.place-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.place-note { margin: 0; font-size: 14px; color: var(--muted); min-height: 1.6em; }
.scene-hint { margin: 0; font-size: 12px; color: var(--muted); opacity: .85; transition: opacity .4s ease; }
.scene-hint.done, .scene.touched ~ .hero-copy ~ .hero-foot .scene-hint { opacity: 0; }

/* Place tags on the globe: a dot at the place and a label placed to one side, so close places never overlap */
.scene-tags { position: absolute; inset: 0; pointer-events: none; overflow: hidden; direction: ltr; }
.scene-tag { position: absolute; left: 0; top: 0; width: 0; height: 0; margin: 0; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 12px; cursor: pointer; pointer-events: auto; will-change: transform; transition: opacity .25s ease; }
.scene-tag i { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface-solid); border: 2px solid var(--accent); transition: transform .2s ease, background .2s ease; }
.scene-tag span { position: absolute; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: var(--surface-solid); border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(0, 0, 0, .18); transition: border-color .2s ease; }
.scene-tag[data-side="r"] span { left: 14px; top: -13px; }
.scene-tag[data-side="l"] span { right: 14px; top: -13px; }
.scene-tag[data-side="t"] span { left: 0; bottom: 14px; transform: translateX(-50%); }
.scene-tag[data-side="b"] span { left: 0; top: 14px; transform: translateX(-50%); }
.scene-tag:hover i, .scene-tag:focus-visible i, .scene-tag.on i { transform: scale(1.3); background: var(--accent); }
.scene-tag:hover span, .scene-tag.on span { border-color: var(--accent); }
.scene-tag.on { z-index: 2; }
.scene-tag.away { opacity: 0; pointer-events: none; }
html[lang="ar"] .scene-tag [data-lang="en"], html[lang="en"] .scene-tag [data-lang="ar"] { display: none !important; }

/* Cards: spotlight and lift */
.card[data-spot] { position: relative; overflow: hidden; transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease; }
.card[data-spot]::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s ease; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--glow), transparent 70%); }
.card[data-spot]:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); transform: translateY(-3px); box-shadow: 0 14px 34px rgba(0, 0, 0, .16); }
.card[data-spot]:hover::before { opacity: 1; }
.card[data-spot] > * { position: relative; }

/* Steps */
.steps { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); counter-reset: step; }
.steps li { position: relative; padding: 20px 20px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); transition: border-color .25s ease, transform .25s ease; }
.steps li:hover { border-color: var(--accent); transform: translateY(-3px); }
.steps h3 { margin: 12px 0 4px; font-size: 18px; }
.steps p { margin: 0; color: var(--muted); font-size: 15px; }
.step-no { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--accent); color: var(--accent); font-family: 'RB-Bold', sans-serif; font-size: 15px; }

/* Licence tabs */
.tabs { margin-top: 24px; }
.tablist { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tablist [role="tab"] { font: inherit; font-size: 15px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; transition: background .2s ease, border-color .2s ease, color .2s ease; }
.tablist [role="tab"]:hover { border-color: var(--accent); }
.tablist [role="tab"][aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tabpanel[hidden] { display: none; }
.tabpanel p { margin: 0 0 10px; }
.tabpanel ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.tabpanel li { position: relative; padding-inline-start: 22px; }
.tabpanel li::before { content: ""; position: absolute; inset-inline-start: 0; top: .7em; width: 10px; height: 2px; background: var(--accent); }

/* Form states */
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); }
.count { justify-self: end; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.notice { transition: opacity .3s ease; }
.notice.ok { animation: notice-in .4s ease; }
@keyframes notice-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

@media (max-width: 720px) {
  .scene-tag:not(.on):not([data-place="bab"]) { display: none; }
  .place-chip { min-height: 40px; }
  .hero-foot { padding-bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .js-reveal [data-reveal], .card[data-spot], .steps li, .place-chip, .chip, .topbar { transition: none; }
  .card[data-spot]:hover, .steps li:hover { transform: none; }
  .notice.ok { animation: none; }
}

@media (max-width: 900px) {
  .hero-copy { background: linear-gradient(180deg, transparent 0, color-mix(in srgb, var(--bg) 86%, transparent) 150px); margin-inline: calc(clamp(16px, 4vw, 40px) * -1); padding-inline: clamp(16px, 4vw, 40px); }
}

/* Page-wide animated background (field.js). It sits behind everything and never takes input. */
.site-field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 1.2s ease; }
.site-field[data-ready] { opacity: 1; }
.site .band { position: relative; }
.site .band::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 55%, transparent), transparent 22%, transparent 78%, color-mix(in srgb, var(--bg) 55%, transparent)); }
@media (prefers-reduced-motion: reduce) { .site-field { transition: none; } }

/* Sign-in and invitation cards: rise in, with a slowly travelling light on the border. */
@property --edge { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.auth .card { position: relative; animation: auth-rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.auth .card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--edge), transparent 0 70%, var(--accent) 86%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); mask-composite: exclude;
  opacity: .75; animation: auth-edge 7s linear infinite;
}
.auth .card:focus-within::before { opacity: 1; animation-duration: 3.5s; }
.auth .btn { position: relative; overflow: hidden; }
.auth .btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%); transform: translateX(-120%); transition: transform .6s ease; }
.auth .btn:hover::after, .auth .btn:focus-visible::after { transform: translateX(120%); }
@keyframes auth-rise { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes auth-edge { to { --edge: 360deg; } }
@media (prefers-reduced-motion: reduce) { .auth .card, .auth .card::before { animation: none; } .auth .btn::after { transition: none; } }
