/*
 * Support wizard styles, scoped to .sw. Mobile first, no framework.
 *
 * The look is esimnest.com's (static-site/src/styles/global.css is the brand reference): Inter body, Bricolage Grotesque
 * headings, sand/teal/coral palette, cards with --radius-xl and --shadow-card, pill buttons (.btn-accent / .btn-ghost),
 * the .field/.select control kit and a 3px coral focus ring. The defaults below are those tokens' light values, so the
 * wizard looks the same on the WebHost theme pages, which do not load the site's CSS.
 *
 * Hosts can map any of these on .sw or an ancestor (esimnest.com maps all of them to its tokens, so the site's dark mode
 * applies; see static-site/src/components/SupportWizard.astro):
 *   --sw-fg --sw-muted --sw-bg --sw-surface --sw-soft --sw-border --sw-border-strong
 *   --sw-brand --sw-brand-strong --sw-brand-soft --sw-accent --sw-accent-strong --sw-accent-fg --sw-focus
 *   --sw-danger --sw-success --sw-radius --sw-radius-control --sw-shadow --sw-font --sw-font-display --sw-gap --sw-chevron
 * Without a host mapping the wizard is light; the option colorScheme: 'dark' | 'auto' (data-sw-scheme) switches the
 * built-in dark values on. The renderer sets lang and dir on .sw, so RTL works without <html dir>.
 */
.sw {
  --_fg: var(--sw-fg, #10201f);
  --_muted: var(--sw-muted, #55706d);
  --_bg: var(--sw-bg, transparent);
  --_surface: var(--sw-surface, #ffffff);
  --_soft: var(--sw-soft, #f8f1e3);
  --_border: var(--sw-border, #e4ecea);
  --_border-strong: var(--sw-border-strong, #9fb3b0);
  --_brand: var(--sw-brand, #147f7a);
  --_brand-strong: var(--sw-brand-strong, #0c5350);
  --_brand-soft: var(--sw-brand-soft, #e9f6f5);
  --_accent: var(--sw-accent, #f1623f);
  --_accent-strong: var(--sw-accent-strong, #d64c2b);
  --_accent-fg: var(--sw-accent-fg, #ffffff);
  --_focus: var(--sw-focus, var(--_accent));
  --_danger: var(--sw-danger, #b42318);
  --_success: var(--sw-success, #1f9d55);
  --_radius: var(--sw-radius, 1.25rem);
  --_radius-control: var(--sw-radius-control, .875rem);
  --_shadow: var(--sw-shadow, 0 1px 2px rgb(16 32 31 / .06), 0 12px 32px -16px rgb(16 32 31 / .25));
  --_font: var(--sw-font, "Inter Variable", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic Variable", "Noto Sans Arabic", sans-serif);
  --_font-display: var(--sw-font-display, "Bricolage Grotesque Variable", "Bricolage Grotesque", "Inter Variable", Inter, ui-sans-serif, system-ui, sans-serif);
  --_gap: var(--sw-gap, 1rem);
  --_chevron: var(--sw-chevron, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2355706d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"));
  color: var(--_fg);
  background: var(--_bg);
  font-family: var(--_font);
  font-size: 1rem;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  line-height: 1.55;
  text-align: start;
  max-width: 40rem;
}
/* Built-in dark values (esimnest.com's dark tokens), only when asked for: the WebHost pages are light-only. */
.sw[data-sw-scheme="dark"] {
  --_fg: var(--sw-fg, #ecf3f2); --_muted: var(--sw-muted, #9fb3b0); --_surface: var(--sw-surface, #12211f); --_soft: var(--sw-soft, #182c2a);
  --_border: var(--sw-border, #23403d); --_border-strong: var(--sw-border-strong, #55706d); --_brand: var(--sw-brand, #5bb9b1);
  --_brand-strong: var(--sw-brand-strong, #93d3cd); --_brand-soft: var(--sw-brand-soft, #113835); --_accent: var(--sw-accent, #ff8a70);
  --_accent-strong: var(--sw-accent-strong, #ff9d86); --_accent-fg: var(--sw-accent-fg, #1a0d09); --_danger: var(--sw-danger, #ff8a80);
  --_success: var(--sw-success, #4cc38a);
  --_chevron: var(--sw-chevron, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239fb3b0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"));
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  .sw[data-sw-scheme="auto"] {
    --_fg: var(--sw-fg, #ecf3f2); --_muted: var(--sw-muted, #9fb3b0); --_surface: var(--sw-surface, #12211f); --_soft: var(--sw-soft, #182c2a);
    --_border: var(--sw-border, #23403d); --_border-strong: var(--sw-border-strong, #55706d); --_brand: var(--sw-brand, #5bb9b1);
    --_brand-strong: var(--sw-brand-strong, #93d3cd); --_brand-soft: var(--sw-brand-soft, #113835); --_accent: var(--sw-accent, #ff8a70);
    --_accent-strong: var(--sw-accent-strong, #ff9d86); --_accent-fg: var(--sw-accent-fg, #1a0d09); --_danger: var(--sw-danger, #ff8a80);
    --_success: var(--sw-success, #4cc38a);
    --_chevron: var(--sw-chevron, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239fb3b0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"));
    color-scheme: dark;
  }
}
/* Same script rules as the site: Arabic font first, no negative tracking for CJK/Thai, room for Thai marks. */
.sw:lang(ar) { font-family: "Noto Sans Arabic Variable", "Noto Sans Arabic", var(--_font); }
.sw:lang(th) { line-height: 1.75; }
.sw *, .sw *::before, .sw *::after { box-sizing: border-box; }
/* Host CSS (Bootstrap on the WebHost themes) must not leak in. */
.sw :where(h2, p, ol, ul, dl, dd, figure, fieldset) { margin: 0; }
.sw :where(legend) { float: none; width: auto; padding: 0; font-size: inherit; line-height: inherit; }
.sw :where(label) { margin: 0; }
.sw :where(button, input, select, textarea) { font: inherit; letter-spacing: inherit; text-transform: none; }
.sw-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Panel = the site's .card */
.sw-panel {
  display: grid; gap: var(--_gap); background: var(--_surface); border: 1px solid var(--_border);
  border-radius: var(--_radius); box-shadow: var(--_shadow); padding: 1.5rem;
}
@media (min-width: 640px) { .sw-panel { padding: 2rem; } }
.sw-title { font-family: var(--_font-display); font-size: 1.5rem; line-height: 1.15; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
@media (min-width: 640px) { .sw-title { font-size: 1.75rem; } }
.sw:is(:lang(ja), :lang(ko), :lang(zh)) .sw-title { letter-spacing: 0; line-height: 1.3; }
.sw:lang(th) .sw-title { letter-spacing: 0; line-height: 1.45; }
.sw:lang(ja) .sw-title { word-break: auto-phrase; text-wrap: balance; }
.sw:lang(ko) :is(.sw-title, p) { word-break: keep-all; }
.sw-title:focus { outline: none; }
.sw-title:focus-visible { outline: 3px solid var(--_focus); outline-offset: 4px; border-radius: 4px; }
.sw-lead, .sw-hint, .sw-count { color: var(--_muted); }
.sw-hint, .sw-count { font-size: .875rem; }
/* Progress = the site's .eyebrow */
.sw-progress { order: -1; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--_brand); }
.sw:is(:lang(ar), :lang(he), :lang(ja), :lang(ko), :lang(zh), :lang(th)) :is(.sw-progress, .sw-path-label) { letter-spacing: 0; }
.sw-back {
  order: -2; justify-self: start; display: inline-flex; align-items: center; gap: .375rem; background: none; border: 0;
  padding: .25rem 0; color: var(--_muted); font-size: .9rem; font-weight: 600; cursor: pointer; border-radius: 4px;
}
.sw-back:hover { color: var(--_brand-strong); }
.sw-back-icon { display: inline-block; font-size: 1.15em; line-height: 1; }
.sw[dir="rtl"] .sw-back-icon { transform: scaleX(-1); }

/* Fields = the site's .field / .select */
.sw-form { display: grid; gap: var(--_gap); }
.sw-field { display: grid; gap: .375rem; }
.sw-field label, .sw legend { font-weight: 600; font-size: .9rem; }
.sw input:not([type=radio]):not([type=file]), .sw select, .sw textarea {
  width: 100%; min-height: 2.75rem; font-size: 1rem; color: var(--_fg); background-color: var(--_surface);
  border: 1px solid var(--_border); border-radius: var(--_radius-control); padding: .5rem .875rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.sw :is(input, textarea)::placeholder { color: var(--_muted); opacity: 1; }
.sw input:not([type=radio]):not([type=file]):hover, .sw select:hover, .sw textarea:hover { border-color: var(--_border-strong); }
.sw input:not([type=radio]):not([type=file]):focus, .sw select:focus, .sw textarea:focus {
  outline: none; border-color: var(--_brand); box-shadow: 0 0 0 3px var(--_brand-soft);
}
.sw select {
  appearance: none; -webkit-appearance: none; cursor: pointer; background-image: var(--_chevron); background-repeat: no-repeat;
  background-size: 1rem; background-position: right .75rem center; padding-inline-end: 2.25rem;
}
.sw[dir="rtl"] select { background-position: left .75rem center; }
.sw select option { background-color: var(--_surface); color: var(--_fg); }
.sw textarea { min-height: 8rem; resize: vertical; line-height: 1.5; }
.sw :focus-visible { outline: 3px solid var(--_focus); outline-offset: 3px; }
.sw input:not([type=radio]):not([type=file]):focus-visible, .sw select:focus-visible, .sw textarea:focus-visible { outline-offset: 2px; }

/* Buttons = the site's .btn .btn-accent / .btn-ghost */
.sw-actions { display: flex; flex-wrap: wrap; gap: .625rem; }
.sw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.75rem; padding: .625rem 1.125rem;
  font-size: .95rem; font-weight: 600; line-height: 1.3; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  text-decoration: none; text-align: center; transition: transform .12s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.sw-btn:active { transform: translateY(1px); }
.sw-btn-primary, .sw-btn-primary:visited { background: var(--_accent); color: var(--_accent-fg); box-shadow: 0 8px 20px -10px var(--_accent); }
.sw-btn-primary:hover { background: var(--_accent-strong); color: var(--_accent-fg); }
.sw-btn-secondary, .sw-btn-secondary:visited { background: transparent; color: var(--_fg); border-color: var(--_border); }
.sw-btn-secondary:hover { background: var(--_soft); color: var(--_fg); }
.sw-btn-link { background: none; border: 0; padding: 0; min-height: 0; color: var(--_muted); text-decoration: underline; text-underline-offset: .15em; font-weight: 500; box-shadow: none; }
.sw-btn-link:hover { color: var(--_brand-strong); }
.sw-btn[disabled] { opacity: .6; cursor: progress; transform: none; }
@media (max-width: 479px) { .sw-actions .sw-btn:not(.sw-btn-link) { flex: 1 1 100%; } }

/* Choice tiles (phone platform) */
.sw-choices { border: 0; padding: 0; display: grid; gap: .5rem; min-width: 0; }
.sw-choices legend { margin-bottom: .5rem; }
@media (min-width: 480px) { .sw-platforms { grid-template-columns: 1fr 1fr; } }
.sw-choice {
  display: flex; align-items: center; gap: .625rem; min-height: 2.75rem; padding: .625rem .875rem; background: var(--_surface);
  border: 1px solid var(--_border); border-radius: var(--_radius-control); cursor: pointer; font-weight: 500;
  transition: border-color .15s ease, background-color .15s ease;
}
.sw-choice:hover { border-color: var(--_border-strong); }
.sw-choice:has(input:checked) { border-color: var(--_brand); background: var(--_brand-soft); box-shadow: inset 0 0 0 1px var(--_brand); }
.sw-choice input { accent-color: var(--_brand); width: 1.1rem; height: 1.1rem; margin: 0; flex: none; }

/* Problem list */
.sw-issues { list-style: none; padding: 0; display: grid; gap: .5rem; }
.sw-issue {
  width: 100%; display: grid; grid-template-columns: 1fr auto; column-gap: .75rem; row-gap: .125rem; align-items: center;
  text-align: start; color: var(--_fg); cursor: pointer; background: var(--_surface); border: 1px solid var(--_border);
  border-radius: var(--_radius-control); padding: .875rem 1rem; transition: border-color .15s ease, background-color .15s ease;
}
.sw-issue::after { content: "›"; grid-column: 2; grid-row: 1 / span 2; font-size: 1.4rem; line-height: 1; color: var(--_muted); }
.sw[dir="rtl"] .sw-issue::after { content: "‹"; }
.sw-issue:hover { border-color: var(--_brand); background: var(--_brand-soft); }
.sw-issue:hover::after { color: var(--_brand-strong); }
.sw-issue-label { font-weight: 600; grid-column: 1; }
.sw-issue-hint { color: var(--_muted); font-size: .875rem; grid-column: 1; }

/* Step content */
.sw-pathbox { display: grid; gap: .375rem; }
.sw-path-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--_muted); }
.sw-path { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .375rem; align-items: center; font-weight: 600; font-size: .9rem; }
/* Menu path = the site's .chip-brand, joined by chevrons */
.sw-path li { display: inline-flex; align-items: center; gap: .375rem; background: var(--_brand-soft); color: var(--_brand-strong); border-radius: 999px; padding: .25rem .75rem; }
.sw-path li + li { position: relative; margin-inline-start: .875rem; }
.sw-path li + li::before { content: "›"; position: absolute; inset-inline-start: -.9rem; color: var(--_muted); font-weight: 400; }
.sw[dir="rtl"] .sw-path li + li::before { content: "‹"; }
.sw-figure { justify-self: center; }
/* 1.5× the first size, so the menu text in the illustration is readable on a phone */
.sw-figure img { display: block; width: 270px; max-width: 100%; height: auto; border-radius: var(--_radius-control); border: 1px solid var(--_border); box-shadow: var(--_shadow); }
.sw-body p { margin: 0 0 .75rem; }
.sw-body p:last-child { margin-bottom: 0; }
.sw-body a { color: var(--_brand-strong); text-decoration: underline; text-underline-offset: .15em; }
.sw-body code, .sw-codes code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; word-break: break-all; direction: ltr; unicode-bidi: isolate; }
.sw-tip { padding: .75rem 1rem; border-radius: var(--_radius-control); background: var(--_soft); font-size: .925rem; }
.sw-tip strong { color: var(--_brand-strong); }
.sw-ask { display: grid; gap: .75rem; border-top: 1px solid var(--_border); padding-top: var(--_gap); }
.sw-question { font-weight: 700; font-size: 1.05rem; }
.sw-verdict { padding: 1rem 1.125rem; border-radius: var(--_radius-control); border-inline-start: 4px solid var(--_brand); background: var(--_brand-soft); }
.sw-verdict p { margin: 0 0 .5rem; }
.sw-verdict p:last-child { margin: 0; }

.sw-manual { display: grid; gap: .5rem; }
.sw-codes { display: grid; gap: .625rem; }
.sw-code dt { font-size: .875rem; color: var(--_muted); }
.sw-code dd { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.sw-code dd code { padding: .375rem .625rem; border-radius: .5rem; background: var(--_soft); }
.sw-copy { min-height: 2.25rem; padding: .375rem .875rem; font-size: .875rem; }
.sw-copied { font-size: .875rem; font-weight: 600; color: color-mix(in srgb, var(--_success) 80%, var(--_fg)); }

/* Screenshots */
.sw-shots { list-style: none; padding: 0; display: grid; gap: var(--_gap); }
.sw-shot { display: grid; gap: .5rem; padding: 1rem; border: 1px dashed var(--_border-strong); border-radius: var(--_radius-control); background: color-mix(in srgb, var(--_soft) 45%, transparent); }
.sw-shot-label { font-weight: 600; }
.sw-sample { justify-self: start; }
.sw-sample img { width: 225px; box-shadow: none; }
.sw-sample figcaption { font-size: .75rem; color: var(--_muted); margin-top: .25rem; }
.sw-file { font-size: .9rem; max-width: 100%; color: var(--_muted); }
.sw-file::file-selector-button {
  margin-inline-end: .75rem; min-height: 2.25rem; padding: .375rem .875rem; border-radius: 999px; border: 1px solid var(--_border);
  background: var(--_surface); color: var(--_fg); font: inherit; font-weight: 600; cursor: pointer;
}
.sw-file::file-selector-button:hover { background: var(--_soft); }
.sw-thumbs { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .625rem; }
.sw-thumbs:empty { display: none; }
.sw-thumb { position: relative; display: grid; gap: .25rem; width: 88px; font-size: .7rem; color: var(--_muted); }
.sw-thumb img { width: 88px; height: 120px; object-fit: cover; border-radius: .625rem; border: 1px solid var(--_border); }
.sw-thumb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-remove {
  position: absolute; top: -8px; inset-inline-end: -8px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--_border);
  background: var(--_surface); color: var(--_fg); font-size: 1rem; line-height: 1; cursor: pointer; box-shadow: var(--_shadow);
}
.sw-remove:hover { background: var(--_soft); }

/* Rating */
.sw-rating { border: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; min-width: 0; }
.sw-rating legend { width: 100%; margin-bottom: .5rem; }
.sw-star { position: relative; }
.sw-star input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sw-star span[aria-hidden] {
  display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 1px solid var(--_border);
  background: var(--_surface); font-weight: 700; transition: border-color .15s ease, background-color .15s ease;
}
.sw-star:hover span[aria-hidden] { border-color: var(--_border-strong); }
.sw-star input:checked + span { background: var(--_accent); color: var(--_accent-fg); border-color: var(--_accent); }
.sw-star input:focus-visible + span { outline: 3px solid var(--_focus); outline-offset: 3px; }

/* Status lines */
.sw-status:empty, .sw-error:empty { display: none; }
.sw-error { color: var(--_danger); font-weight: 500; }
.sw-loading { padding: 1.5rem; color: var(--_muted); }
.sw-ref { font-family: var(--_font-display); font-size: 1.75rem; letter-spacing: .03em; color: var(--_brand-strong); direction: ltr; unicode-bidi: isolate; }
.sw[dir="rtl"] .sw-ref { text-align: end; }
.sw-turnstile:empty { display: none; }
.sw-guide p { white-space: pre-line; }

@media (prefers-reduced-motion: reduce) {
  .sw *, .sw *::before, .sw *::after { transition: none !important; }
  .sw-btn:active { transform: none; }
}

/* Signed in: choose the eSIM from the account; signed out: sign in or use My eSIMs */
.sw-account { display: grid; gap: .625rem; padding: 1rem 1.125rem; border-radius: var(--_radius-control); background: var(--_brand-soft); }
.sw-account .sw-actions { margin: 0; }
.sw-or { font-size: .875rem; color: var(--_muted); }
.sw-dialog {
  width: min(34rem, calc(100vw - 2rem)); max-height: min(40rem, calc(100dvh - 2rem)); padding: 0; overflow: hidden;
  border: 1px solid var(--_border); border-radius: var(--_radius); background: var(--_surface); color: var(--_fg);
  box-shadow: 0 24px 64px rgb(0 0 0 / .28); font-family: var(--_font);
}
.sw-dialog[open] { display: flex; flex-direction: column; }
.sw-dialog::backdrop { background: rgb(15 23 42 / .55); }
.sw-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--_border); }
.sw-dialog-title { margin: 0; font-family: var(--_font-display); font-size: 1.2rem; font-weight: 800; }
.sw-dialog-close { width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 1px solid var(--_border); background: var(--_surface); color: var(--_fg); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.sw-dialog-close:hover { background: var(--_soft); }
.sw-dialog-close:focus-visible, .sw-pick:focus-visible { outline: 3px solid var(--_focus); outline-offset: 2px; }
.sw-dialog-body { overflow-y: auto; padding: 1rem 1.25rem 1.25rem; display: grid; gap: 1.125rem; }
.sw-order { display: grid; gap: .5rem; }
.sw-order-title { margin: 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; font-size: .95rem; font-weight: 700; }
.sw-order-date { font-weight: 400; color: var(--_muted); }
.sw-order-esims { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.sw-pick .sw-issue-hint { word-break: break-all; }
.sw-account-slot:empty { display: none; }
.sw-model-note:empty { display: none; }
.sw-model-warn { color: color-mix(in srgb, var(--_accent-strong, var(--_brand-strong)) 85%, var(--_fg)); font-weight: 600; }
