/* Packman Website — base tokens, reset, RTL.
 * Palette pulled from dashboard tailwind config:
 *   --brand (#d2f801) and --brand-secondary (#2c2a59).
 * Background gradient is Packman-branded (lime bloom on soft cream),
 * intentionally echoing the nas.com get-started feel without copying its gold.
 */

:root {
  --brand: #d2f801;
  --brand-deep: #b8db00;
  --brand-secondary: #2c2a59;
  --brand-secondary-dark: #1e1c37;
  --ink: #0f172a;
  --ink-muted: #475569;
  --ink-placeholder: #94a3b8;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-solid: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --ring: rgba(44, 42, 89, 0.2);
  --card-radius: 20px;
  --card-glow: 0 20px 80px rgba(210, 248, 1, 0.35), 0 8px 24px rgba(44, 42, 89, 0.08);
  --card-shadow: 0 12px 40px rgba(44, 42, 89, 0.1);
  --bg-gradient:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(210, 248, 1, 0.35) 0%, rgba(210, 248, 1, 0) 60%),
    radial-gradient(ellipse 60% 50% at 50% 110%, rgba(44, 42, 89, 0.08) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, #fffef5 0%, #ffffff 100%);
  --font-en: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ar: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --transition: 160ms cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-en);
  color: var(--ink);
  background: var(--bg-gradient);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

[dir="rtl"] body {
  font-family: var(--font-ar);
}

button {
  font: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

input,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Arrow icons flip horizontally in RTL */
[dir="rtl"] .flip-rtl {
  transform: scaleX(-1);
}

/* Top bar: logo left in LTR, right in RTL (automatic via flex start/end) */
.top-bar {
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  inset-inline-end: 0;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 10;
}

.top-bar .brand-mark {
  color: var(--brand-secondary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.top-bar .brand-mark svg {
  height: 24px;
  width: auto;
}

.lang-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

.lang-switch button {
  border: 0;
  background: transparent;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
  transition: all var(--transition);
}

.lang-switch button[aria-pressed="true"] {
  background: var(--brand-secondary);
  color: #fff;
}

.lang-switch button:hover:not([aria-pressed="true"]) {
  color: var(--brand-secondary);
}

.help-bubble {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  color: var(--ink-muted);
  box-shadow: var(--card-shadow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    bottom 220ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 20;
}

.help-bubble:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(44, 42, 89, 0.18);
}

.help-bubble.is-active {
  color: var(--brand-secondary);
  border-color: rgba(210, 248, 1, 0.7);
  box-shadow:
    0 16px 40px rgba(44, 42, 89, 0.18),
    0 0 0 5px rgba(210, 248, 1, 0.12);
}

.help-panel {
  position: fixed;
  inset-inline-end: 24px;
  bottom: 78px;
  width: min(320px, calc(100vw - 32px));
  z-index: 21;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.help-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.help-panel-card {
  padding: 18px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 250, 254, 0.98) 100%);
  border: 1px solid rgba(44, 42, 89, 0.1);
  box-shadow:
    0 24px 60px rgba(44, 42, 89, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.help-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.help-panel-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  color: var(--ink);
}

.help-panel-close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(44, 42, 89, 0.08);
  background: rgba(44, 42, 89, 0.04);
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background var(--transition),
    color var(--transition),
    transform var(--transition);
}

.help-panel-close:hover {
  background: rgba(210, 248, 1, 0.24);
  color: var(--brand-secondary);
  transform: rotate(90deg);
}

.help-panel-copy {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-muted);
}

.help-panel-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.help-link {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(44, 42, 89, 0.12);
  background: #fff;
  color: var(--brand-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition),
    background var(--transition);
}

.help-link:hover {
  transform: translateY(-1px);
  border-color: rgba(44, 42, 89, 0.18);
  box-shadow: 0 10px 24px rgba(44, 42, 89, 0.08);
  text-decoration: none;
}

.help-link.primary {
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-deep) 100%);
  border-color: transparent;
  color: var(--brand-secondary);
  box-shadow:
    0 10px 24px rgba(210, 248, 1, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

@media (max-width: 640px) {
  .help-panel {
    inset-inline-end: 16px;
    bottom: 72px;
    width: min(320px, calc(100vw - 24px));
  }
}

/* Shared primary "pill" CTA */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 28px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: var(--brand-secondary);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  box-shadow:
    0 10px 30px rgba(210, 248, 1, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    opacity var(--transition);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 14px 36px rgba(210, 248, 1, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.55;
  box-shadow: none;
}

.btn-primary .arrow {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

/* Ghost/secondary text button */
.btn-ghost {
  background: transparent;
  border: 0;
  color: var(--ink-muted);
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  transition: color var(--transition);
}

.btn-ghost:hover {
  color: var(--brand-secondary);
}

/* Card — the centered glassy tile nas uses */
.card {
  width: 100%;
  max-width: 560px;
  padding: 24px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-glow);
}

@media (max-width: 640px) {
  .card {
    padding: 20px;
  }
  .top-bar {
    padding: 16px 20px;
  }
}
