/* ==========================================================================
   style.css — Workstager onboarding
   Design tokens + reusable components that Tailwind utilities can't express
   exactly. Every size is rem (1rem = 16px on the 1920px Figma frame).
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  --primary: #86bc24;
  --secondary: #000000;
  --white: #ffffff;
  --text: #111827;
  --gray: #6b7280;
  --radius: 1rem;

  /* Figma-exact palette */
  --brand: #043f29;
  --brand-lime: #86be41;
  --brand-mint: #f1fbf0;
  --ink-900: #0f172a;
  --ink-800: #1e293b;
  --ink-700: #334155;
  --ink-600: #475569;
  --ink-500: #64748b;
  --ink-400: #94a3b8;
  --ink-300: #cbd5e1;
  --ink-200: #e2e8f0;
  --ink-100: #f1f5f9;
  --ink-50: #f8fafc;
  --emerald-600: #059669;
  --emerald-500: #10b981;
  --green-700: #15803d;
  --page: #fafafa;
  --muted: #515151;
  --danger: #dc2626;

  --font-sans: "Inter", "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: 300ms ease;
}

/* ---------- 2. Base ---------- */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  font-family: var(--font-sans);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
}

.sr-only-focusable:focus {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--white);
  border-radius: 0.5rem;
}

:focus-visible {
  outline: 2px solid var(--brand-lime);
  outline-offset: 2px;
}

/* ---------- 3. Page shell ---------- */
.ws-page {
  overflow-x: clip;           /* no horizontal scroll at any width (keeps sticky working) */
  width: 100%;
  box-sizing: border-box;
}

.ws-shell {
  width: 100%;
  max-width: 100rem;          /* 1600px content width */
  margin: 0 auto;
}

.ws-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 8.0625rem;          /* 129px → divider */
  padding-top: 3rem;          /* logo top = 48px */
  padding-bottom: 2.75rem;
  border-bottom: 1px solid #d9d9d9;
  box-sizing: border-box;
}

.ws-logo img {
  display: block;
  width: 15rem;               /* 240px */
  height: 3.0168rem;          /* 48.27px */
  object-fit: cover;
}

.ws-help {
  font-size: 1.25rem;
  line-height: 2rem;
  font-weight: 500;
  color: var(--ink-500);
  text-decoration: none;
  transition: color var(--ease);
}

.ws-help:hover {
  color: var(--brand);
}

/* ---------- 4. Stepper ---------- */
.ws-stepper {
  width: 66rem;               /* 1056px */
  max-width: 100%;
  margin: 2.5rem auto 0;      /* labels at y=169 */
}

.ws-stepper__list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  column-gap: 1.0157rem;      /* 16.25px */
  margin: 0;
  padding: 0;
  list-style: none;
}

.ws-stepper__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4028rem;             /* bar top at y=211 */
  font-size: 1.25rem;
  line-height: 2.2223rem;     /* 35.556px */
  text-align: center;
  color: var(--muted);
  white-space: nowrap;
}

.ws-stepper__item::after {
  content: "";
  display: block;
  width: 100%;
  height: 0.25rem;
  border-radius: 1.6875rem;
  background: #d9d9d9;
  transition: background-color var(--ease);
}

.ws-stepper__item.is-done::after {
  background: var(--brand-lime);
}

/* Distinct from is-done (lime = actually completed and valid) — the
   current step is neither done nor untouched, so it gets its own color
   rather than looking indistinguishable from a completed one. */
.ws-stepper__item.is-current::after {
  background: var(--brand);
}

.ws-stepper__item.is-current {
  font-weight: 600;
  color: var(--secondary);
}

.ws-stepper__tab {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  line-height: inherit;
  color: inherit;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 0.25rem;
  transition: color var(--ease);
}

.ws-stepper__tab:hover {
  color: var(--brand);
}

.ws-stepper__item.is-current .ws-stepper__tab:hover {
  color: var(--secondary);
}

/* Tab panels */
.ws-panel[hidden] {
  display: none !important;
}

.ws-panel:focus {
  outline: none;
}

/* ---------- 5. Card with dark header band ---------- */
.ws-card {
  position: relative;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: 1.5rem;
  box-shadow: 0 0.25rem 1.25rem 0 rgba(0, 0, 0, 0.03);
  padding: 2.25rem 3.5rem;    /* 36px 56px */
  box-sizing: border-box;
}

.ws-card__band {
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 7.25rem;            /* 116px */
  overflow: hidden;
  background-color: var(--brand);
  background-image: url("../assets/svg/header-pattern.svg");
  background-repeat: no-repeat;
  background-position: left top;
  background-size: 66rem 7.25rem;
  pointer-events: none;
}

/* rotated brand-mark watermark inside the band (logo icon crop) */
.ws-card__watermark {
  position: absolute;
  top: -4.035rem;
  right: -2.909rem;
  width: 18.4233rem;
  height: 18.2053rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ws-card__watermark::before {
  content: "";
  width: 15.1077rem;          /* 241.72px */
  height: 14.7994rem;         /* 236.79px */
  opacity: 0.21;
  transform: rotate(-15deg);
  background-image: url("../images/logos/workstager-logo.png");
  background-repeat: no-repeat;
  background-size: 489.8% 100.56%;
  background-position: 0 0;
}

.ws-card__body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.ws-card__title {
  margin: 0;
  font-size: 2.25rem;
  line-height: normal;
  font-weight: 700;
  color: var(--white);
}

.ws-section-label {
  margin: 0;
  font-size: 1.25rem;
  line-height: normal;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--green-700);
}

.ws-divider {
  width: 100%;
  height: 0;
  border: 0;
  border-top: 1px solid var(--ink-200);
  margin: 0;
}

/* ---------- 6. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 1.25rem;
  line-height: normal;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--ease), color var(--ease), border-color var(--ease),
    box-shadow var(--ease), transform var(--ease), opacity var(--ease);
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand);
  color: var(--white);
  border-radius: 2.625rem;
}

.btn-primary:hover:not(:disabled) {
  background: #06573a;
}

.btn-primary:focus-visible {
  box-shadow: 0 0 0 0.25rem rgba(134, 190, 65, 0.45);
  outline: none;
}

.btn-outline {
  background: var(--white);
  color: var(--brand);
  border-color: var(--brand);
  border-radius: 2.5rem;
}

.btn-outline:hover:not(:disabled) {
  background: var(--brand-mint);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-700);
  font-weight: 600;
  border-radius: 0.5rem;
}

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

.btn-soft {
  background: var(--white);
  color: var(--ink-700);
  font-weight: 600;
  border-color: var(--ink-200);
  border-radius: 0.5rem;
}

.btn-soft:hover {
  background: var(--ink-50);
  border-color: var(--ink-300);
}

/* loading state: add .is-loading to any .btn */
.btn.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: var(--white);
  animation: ws-spin 0.8s linear infinite;
}

.btn-outline.is-loading::after,
.btn-soft.is-loading::after {
  border-color: rgba(4, 63, 41, 0.25);
  border-top-color: var(--brand);
}

/* ---------- 7. Form fields ---------- */
.form-label {
  font-size: 1.25rem;
  line-height: normal;
}

.form-input {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 1.25rem;
  line-height: normal;
  background: var(--white);
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  color: var(--ink-800);
  transition: border-color var(--ease), box-shadow var(--ease);
  appearance: none;
}

.form-input::placeholder {
  color: var(--ink-400);
}

.form-input:focus {
  outline: none;
  border-color: var(--brand-lime);
  box-shadow: 0 0 0 0.1875rem rgba(134, 190, 65, 0.2);
}

.form-input.is-invalid,
.field.is-invalid .form-input {
  border-color: var(--danger);
}

.field-error {
  display: none;
  font-size: 1rem;
  line-height: normal;
  color: var(--danger);
}

.field.is-invalid .field-error {
  display: block;
}

select.form-input {
  background-image: url("../assets/svg/chevron-down.svg");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  background-size: 1rem 1rem;
  padding-right: 2.75rem;
  cursor: pointer;
}

/* ---------- 8. Checkbox (Figma: 22px emerald square with white check) ---------- */
.ws-check {
  position: relative;
  flex: none;
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid var(--ink-300);
  border-radius: 0.25rem;
  background: var(--white) no-repeat center / 1.25rem 1.25rem;
  cursor: pointer;
  transition: background-color var(--ease), border-color var(--ease);
}

.ws-check--sm {
  width: 1rem;
  height: 1rem;
}

.ws-check:checked {
  width: 1.375rem;
  height: 1.375rem;
  border-color: transparent;
  background-color: var(--emerald-600);
  background-image: url("../assets/svg/check-white.svg");
}

.ws-check:focus-visible {
  outline: 2px solid var(--brand-lime);
  outline-offset: 2px;
}

/* .is-invalid alone did nothing here — unlike .form-input, .ws-check never
   had a rule reacting to it, so a required checkbox left unticked (e.g.
   #terms) showed no visible red border despite the class being applied. */
.ws-check.is-invalid {
  border-color: var(--danger);
}

/* static round tick used in lists */
.ws-tick {
  flex: none;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 1.75rem;
  background: var(--emerald-600) url("../assets/svg/check-white.svg") no-repeat center / 1.25rem 1.25rem;
}

/* ---------- 9. Module + capability tiles ---------- */
.module-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.0625rem;         /* 17px */
  border: 1px solid var(--ink-200);
  border-radius: 0.75rem;
  background: var(--white);
  cursor: pointer;
  transition: background-color var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.module-card:hover {
  border-color: var(--ink-300);
}

.module-card.is-selected {
  background: rgba(236, 253, 245, 0.4);
  border-color: var(--emerald-500);
}

.module-card__icon {
  display: flex;
  padding: 0.5rem;
  border-radius: 0.5rem;
  background: var(--ink-100);
  transition: background-color var(--ease);
}

.module-card.is-selected .module-card__icon {
  background: #d1fae5;
}

/* margin-top:auto pins the foot to the card's bottom edge — cards in a grid
   row stretch to equal height, but a card with fewer module chips would
   otherwise leave its price row higher than its neighbour's. */
.module-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.5625rem;
  border-top: 1px solid var(--ink-100);
}

.module-card.is-selected .module-card__foot {
  border-top-color: #d1fae5;
}

.module-card__meta {
  font-size: 1.25rem;
  line-height: 1.8182rem;
  font-weight: 500;
  color: var(--ink-400);
}

.module-card.is-selected .module-card__meta {
  font-weight: 600;
  color: #047857;
}

/* Try Demo already includes every module — every other bundle card shows
   muted/dimmed (not disabled: still clickable to switch out of Try Demo and
   pick that bundle individually instead, see register-customer-footer.blade.php). */
.module-card.is-muted {
  opacity: 0.6;
}

.module-card.is-muted:hover {
  opacity: 1;
}

.cap-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.9375rem;         /* 15px */
  border: 1px solid var(--ink-200);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background-color var(--ease), border-color var(--ease);
}

.cap-card:hover {
  border-color: var(--ink-300);
}

.cap-card.is-selected {
  background: rgba(236, 253, 245, 0.4);
  border-color: var(--emerald-500);
}

.cap-card--tailored {
  background: rgba(248, 250, 252, 0.5);
  cursor: default;
}

/* Tailored card: text only inside the box; the link sits below it */
.cap-card--tailored {
  justify-content: flex-start;
  gap: 0.0625rem;
  padding-bottom: 1.125rem;   /* 18px */
}

/* Tailored card alone (no purchasable add-ons): one full-width row —
   icon tile, text, round arrow — instead of one narrow grid cell. */
.grid-caps.is-single {
  grid-template-columns: minmax(0, 1fr) !important;
}

.cap-card--wide {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 1.5rem;
  padding: 1.5rem 2rem 1.5rem 1.5rem;
  background: var(--white, #fff);
  border-radius: 1rem;
  box-shadow: 0 0.25rem 1rem rgba(15, 23, 42, 0.04);
  cursor: default;
}

.cap-card__icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 0.75rem;
  background: #ecfdf5;
  color: var(--emerald-600);
}

.cap-card__icon svg {
  width: 2.25rem;
  height: 2.25rem;
}

.cap-card__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.cap-card__arrow {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  background: #ecfdf5;
  color: var(--emerald-600);
  transition: background-color var(--ease), color var(--ease);
}

.cap-card__arrow:hover,
.cap-card__arrow:focus-visible {
  background: var(--emerald-600);
  color: #fff;
}

.cap-card__arrow svg {
  width: 1.5rem;
  height: 1.5rem;
}

@media (max-width: 479px) {
  .cap-card--wide {
    gap: 1rem;
    padding: 1rem;
  }

  .cap-card__icon {
    width: 3.5rem;
    height: 3.5rem;
  }

  .cap-card__arrow {
    width: 2.75rem;
    height: 2.75rem;
  }
}

/* Summary total discount — struck original + "Save X%" pill above the
   new price, rupee saving below (see renderSummary() in
   register-customer-footer.blade.php). */
.price-original-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0 0 -0.25rem;
}

.price-original {
  font-size: 1.5rem;
  line-height: 1.75rem;
  font-weight: 500;
  color: var(--ink-400);
  text-decoration-thickness: 2px;
  text-decoration-color: var(--ink-400);
}

.price-save-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  background: #d1fae5;
  color: #047857;
  font-size: 1.125rem;
  line-height: 1.625rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.price-saving {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 500;
  color: #047857;
}

.price-saving b {
  font-weight: 700;
}

.price-saving__muted {
  font-weight: 400;
  color: var(--ink-500);
}

/* ---------- 10. Summary / plan panel ---------- */
.summary-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 2.25rem 2.5rem;
  background: var(--brand-mint);
  border: 1px solid var(--brand-lime);
  border-radius: 1rem;
  filter: drop-shadow(0 0.25rem 0.75rem rgba(0, 0, 0, 0.02));
  box-sizing: border-box;
}

.summary-card__heading {
  margin: 0;
  font-size: 1.25rem;
  line-height: normal;
  font-weight: 700;
  text-transform: uppercase;
  color: #252525;
}

.ws-toggle {
  display: flex;
  padding: 0.3125rem;
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: 0.75rem;
}

.ws-toggle__btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  padding: 0 1rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  font-family: inherit;
  font-size: 1.25rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: var(--ink-700);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--ease), color var(--ease);
}

.ws-toggle__btn.is-active {
  background: var(--brand);
  color: var(--white);
}

.ws-badge-save {
  margin-left: 0.375rem;
  padding: 0 0.4375rem;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  background: #d1fae5;
  font-size: 1.25rem;
  line-height: 2rem;
  font-weight: 700;
  color: #047857;
}

/* ---------- 11. Stepper (numeric) ---------- */
.qty {
  display: flex;
  align-items: center;
  width: 12.625rem;           /* 202px */
  padding: 0.25rem 1px 1px;
  background: var(--white);
  border: 1px solid var(--ink-300);
  border-radius: 0.5rem;
  overflow: hidden;
  box-sizing: border-box;
}

.qty__btn {
  width: 1.67rem;
  height: 2.25rem;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink-600);
  cursor: pointer;
  transition: color var(--ease);
}

.qty__btn:hover {
  color: var(--brand);
}

.qty__input {
  flex: 1 1 0;
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: center;
  font-family: inherit;
  font-size: 1.25rem;
  line-height: 1.7857rem;
  font-weight: 700;
  color: var(--ink-900);
  -moz-appearance: textfield;
}

.qty__input::-webkit-outer-spin-button,
.qty__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty__input:focus {
  outline: none;
}

/* ---------- 12. Footer ---------- */
.ws-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 5.25rem;            /* 84px */
  border-top: 1px solid #d9d9d9;
  box-sizing: border-box;
}

.ws-footer__copy {
  padding-left: 0.1875rem;
  font-size: 1.25rem;
  line-height: normal;
  color: var(--muted);
}

.ws-footer__powered {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  line-height: 2rem;
  font-weight: 600;
  color: #999999;
}

.ws-footer__powered img {
  display: block;
  width: 7.9375rem;           /* 127px */
  height: 2.25rem;            /* 36px */
  object-fit: cover;
  object-position: left top;
}

/* ---------- 13. Provisioning ---------- */
.prov-step {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
  border-radius: 0.75rem;
  transition: opacity var(--ease);
}

.prov-dot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin: 0.125rem;
  border-radius: 0.75rem;
  box-sizing: border-box;
}

.prov-dot--done {
  background: #dcfce7;
}

.prov-dot--active {
  background: var(--green-700);
}

.prov-dot--active img {
  animation: ws-spin 1.2s linear infinite;
}

.prov-dot--queued {
  border: 2px solid var(--ink-200);
}

.prov-badge {
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  font-size: 1.25rem;
  line-height: normal;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}

.prov-bar {
  height: 0.625rem;
  border-radius: 0.3125rem;
  background: var(--ink-100);
  overflow: hidden;
}

.prov-bar__fill {
  height: 100%;
  border-radius: 0.3125rem;
  background: var(--green-700);
  transition: width 300ms ease;
}

/* ---------- 14. Keyframes ---------- */
@keyframes ws-spin {
  to {
    transform: rotate(360deg);
  }
}
