/* ========================================================================
   ARK Billing — Branded authentication shell
   Loaded only when the billing page is logged out, access-restricted, or
   unavailable. Deliberately isolated from the full application stylesheet.
   ======================================================================== */

body.ark-billing-auth-page {
  --ark-auth-admin-offset: var(--wp-admin--admin-bar--height, 0px);
  margin: 0;
  background: #f5f7fb;
}

.ark-auth-shell.ark-ui-v2 {
  --ark-auth-font: Inter, "Segoe UI Variable", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ark-auth-text: #101828;
  --ark-auth-text-soft: #344054;
  --ark-auth-muted: #667085;
  --ark-auth-muted-2: #98a2b3;
  --ark-auth-border: #e4e7ec;
  --ark-auth-border-strong: #d0d5dd;
  --ark-auth-primary: #175cd3;
  --ark-auth-primary-hover: #1849a9;
  --ark-auth-primary-soft: #eff6ff;
  --ark-auth-danger: #b42318;
  --ark-auth-danger-soft: #fef3f2;
  --ark-auth-warning: #b54708;
  --ark-auth-shadow: 0 28px 70px rgba(16, 24, 40, .14);
  position: relative;
  isolation: isolate;
  display: grid;
  width: 100vw;
  min-height: calc(100vh - var(--ark-auth-admin-offset));
  margin: 0 0 0 calc(50% - 50vw);
  padding: clamp(28px, 6vh, 72px) 20px;
  place-items: center;
  overflow: hidden;
  color: var(--ark-auth-text);
  background:
    radial-gradient(circle at 12% 12%, rgba(41, 112, 255, .11), transparent 28rem),
    radial-gradient(circle at 88% 86%, rgba(23, 92, 211, .08), transparent 30rem),
    linear-gradient(180deg, #fbfcff 0%, #f5f7fb 100%);
  font-family: var(--ark-auth-font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.ark-auth-shell.ark-ui-v2 *,
.ark-auth-shell.ark-ui-v2 *::before,
.ark-auth-shell.ark-ui-v2 *::after { box-sizing: border-box; }

.ark-auth-shell.ark-ui-v2 :where(button, input) { font: inherit; }
.ark-auth-shell.ark-ui-v2 :where(a, button, input):focus-visible {
  outline: 3px solid rgba(41, 112, 255, .22);
  outline-offset: 2px;
}

.ark-auth-atmosphere,
.ark-auth-grid,
.ark-auth-orb {
  position: absolute;
  pointer-events: none;
}

.ark-auth-atmosphere { inset: 0; z-index: -1; overflow: hidden; }
.ark-auth-grid {
  inset: 0;
  opacity: .24;
  background-image:
    linear-gradient(rgba(23, 92, 211, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 92, 211, .055) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, #000 12%, transparent 72%);
}
.ark-auth-orb {
  width: 260px;
  height: 260px;
  border: 1px solid rgba(23, 92, 211, .10);
  border-radius: 38% 62% 62% 38% / 52% 42% 58% 48%;
  background: rgba(255, 255, 255, .28);
  filter: blur(.1px);
}
.ark-auth-orb::before,
.ark-auth-orb::after {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(23, 92, 211, .08);
  border-radius: inherit;
}
.ark-auth-orb::after { inset: 54px; }
.ark-auth-orb-one { top: -84px; left: -74px; transform: rotate(18deg); }
.ark-auth-orb-two { right: -88px; bottom: -106px; transform: rotate(-21deg) scale(1.18); }

.ark-auth-card {
  width: min(456px, 100%);
  padding: 30px;
  border: 1px solid rgba(208, 213, 221, .88);
  border-radius: 22px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--ark-auth-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.ark-auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 24px;
  border-bottom: 1px solid #eef1f5;
}

.ark-auth-logo-wrap {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(23, 92, 211, .12);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(16, 24, 40, .07);
}
.ark-auth-logo-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ark-auth-brand-copy { min-width: 0; }
.ark-auth-brand-copy strong,
.ark-auth-brand-copy small { display: block; }
.ark-auth-brand-copy strong {
  color: var(--ark-auth-text);
  font-size: 15px;
  font-weight: 720;
  letter-spacing: -.015em;
}
.ark-auth-brand-copy small {
  margin-top: 1px;
  color: var(--ark-auth-muted);
  font-size: 11px;
  font-weight: 560;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.ark-auth-heading { padding: 26px 0 22px; }
.ark-auth-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  color: var(--ark-auth-primary);
  border: 1px solid #d7e6ff;
  border-radius: 999px;
  background: var(--ark-auth-primary-soft);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
}
.ark-auth-heading h1 {
  margin: 12px 0 8px;
  color: var(--ark-auth-text);
  font-size: clamp(26px, 4vw, 31px);
  font-weight: 760;
  letter-spacing: -.035em;
  line-height: 1.13;
}
.ark-auth-heading p {
  margin: 0;
  color: var(--ark-auth-muted);
  font-size: 13px;
  line-height: 1.6;
}

.ark-auth-alert {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  margin: -4px 0 18px;
  padding: 11px 12px;
  color: #912018;
  border: 1px solid #fecdca;
  border-radius: 11px;
  background: var(--ark-auth-danger-soft);
  font-size: 12px;
  font-weight: 560;
}
.ark-auth-alert-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: var(--ark-auth-danger);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.ark-auth-form { display: grid; gap: 17px; }
.ark-auth-field { display: grid; gap: 7px; }
.ark-auth-field > label,
.ark-auth-label-row label {
  color: var(--ark-auth-text-soft);
  font-size: 12px;
  font-weight: 670;
}
.ark-auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ark-auth-label-row a {
  color: var(--ark-auth-primary);
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
}
.ark-auth-label-row a:hover { text-decoration: underline; text-underline-offset: 2px; }

.ark-auth-control {
  position: relative;
  display: flex;
  min-height: 48px;
  align-items: center;
  border: 1px solid var(--ark-auth-border-strong);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .035);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.ark-auth-control:focus-within {
  border-color: #84adff;
  box-shadow: 0 0 0 4px rgba(41, 112, 255, .10), 0 1px 2px rgba(16, 24, 40, .035);
}
.ark-auth-control-icon {
  display: grid;
  width: 45px;
  height: 46px;
  flex: 0 0 45px;
  place-items: center;
  color: var(--ark-auth-muted-2);
}
.ark-auth-control-icon svg,
.ark-auth-password-toggle svg,
.ark-auth-submit svg,
.ark-auth-state-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ark-auth-control input {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 13px 0 0;
  color: var(--ark-auth-text);
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 13px;
  line-height: 46px;
}
.ark-auth-control input::placeholder { color: var(--ark-auth-muted-2); }
.ark-auth-password-control input { padding-right: 48px; }

.ark-auth-password-toggle {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  color: var(--ark-auth-muted);
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.ark-auth-password-toggle:hover { color: var(--ark-auth-primary); background: var(--ark-auth-primary-soft); }
.ark-auth-password-toggle .ark-eye-closed { display: none; }
.ark-auth-password-toggle[aria-pressed="true"] .ark-eye-open { display: none; }
.ark-auth-password-toggle[aria-pressed="true"] .ark-eye-closed { display: block; }

.ark-auth-remember {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 9px;
  color: var(--ark-auth-text-soft);
  font-size: 11.5px;
  font-weight: 560;
  cursor: pointer;
  user-select: none;
}
.ark-auth-remember input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.ark-auth-checkbox {
  position: relative;
  display: inline-grid;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  place-items: center;
  border: 1px solid var(--ark-auth-border-strong);
  border-radius: 5px;
  background: #fff;
  transition: border-color .14s ease, background .14s ease, box-shadow .14s ease;
}
.ark-auth-checkbox::after {
  content: "";
  width: 8px;
  height: 4px;
  margin-top: -2px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  opacity: 0;
  transform: rotate(-45deg);
}
.ark-auth-remember input:checked + .ark-auth-checkbox {
  border-color: var(--ark-auth-primary);
  background: var(--ark-auth-primary);
}
.ark-auth-remember input:checked + .ark-auth-checkbox::after { opacity: 1; }
.ark-auth-remember input:focus-visible + .ark-auth-checkbox { box-shadow: 0 0 0 4px rgba(41, 112, 255, .12); }

.ark-auth-submit {
  display: inline-flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 2px;
  padding: 10px 16px;
  color: #fff !important;
  border: 1px solid var(--ark-auth-primary);
  border-radius: 11px;
  background: linear-gradient(180deg, #2970ff 0%, #175cd3 100%);
  box-shadow: 0 7px 18px rgba(23, 92, 211, .20), inset 0 1px rgba(255,255,255,.18);
  font-size: 12.5px;
  font-weight: 720;
  line-height: 1.2;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}
.ark-auth-submit:hover {
  color: #fff !important;
  box-shadow: 0 9px 22px rgba(23, 92, 211, .26), inset 0 1px rgba(255,255,255,.18);
  filter: saturate(1.04);
  transform: translateY(-1px);
}
.ark-auth-submit:active { transform: translateY(0); }
.ark-auth-submit:disabled,
.ark-auth-submit.is-loading { opacity: .76; cursor: wait; transform: none; }
.ark-auth-submit svg { width: 17px; height: 17px; }
.ark-auth-submit.is-loading svg { animation: ark-auth-pulse 1s ease-in-out infinite; }
@keyframes ark-auth-pulse { 50% { transform: translateX(3px); opacity: .55; } }

.ark-auth-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  color: var(--ark-auth-muted-2);
  border-top: 1px solid #eef1f5;
  font-size: 9.5px;
  font-weight: 620;
  letter-spacing: .02em;
}
.ark-auth-secure { display: inline-flex; align-items: center; gap: 7px; }
.ark-auth-secure i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #12b76a;
  box-shadow: 0 0 0 3px rgba(18, 183, 106, .11);
}

/* Access denied / unavailable states ---------------------------------- */
.ark-auth-state-card { text-align: center; }
.ark-auth-state-card .ark-auth-brand { text-align: left; }
.ark-auth-state-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 27px auto 0;
  place-items: center;
  color: var(--ark-auth-danger);
  border: 1px solid #fecdca;
  border-radius: 16px;
  background: var(--ark-auth-danger-soft);
}
.ark-auth-state-icon svg { width: 25px; height: 25px; }
.ark-auth-state-unavailable .ark-auth-state-icon {
  color: var(--ark-auth-warning);
  border-color: #fedf89;
  background: #fffaeb;
}
.ark-auth-state-heading { padding-top: 18px; }
.ark-auth-state-heading h1 { font-size: 27px; }
.ark-auth-account {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: -2px 0 17px;
  padding: 11px 12px;
  border: 1px solid var(--ark-auth-border);
  border-radius: 12px;
  background: #f8fafc;
  text-align: left;
}
.ark-auth-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  color: var(--ark-auth-primary);
  border-radius: 10px;
  background: var(--ark-auth-primary-soft);
  font-size: 14px;
  font-weight: 800;
}
.ark-auth-account small,
.ark-auth-account strong { display: block; }
.ark-auth-account small { color: var(--ark-auth-muted); font-size: 9.5px; }
.ark-auth-account strong { margin-top: 1px; color: var(--ark-auth-text); font-size: 12px; }
.ark-auth-state-action { margin-top: 0; }
.ark-auth-state-note {
  margin: 12px 10px 0;
  color: var(--ark-auth-muted);
  font-size: 10.5px;
  line-height: 1.55;
}

@media (max-width: 782px) {
  body.admin-bar .ark-auth-shell.ark-ui-v2 { --ark-auth-admin-offset: 46px; }
}

@media (max-width: 560px) {
  .ark-auth-shell.ark-ui-v2 {
    min-height: calc(100svh - var(--ark-auth-admin-offset));
    padding: 16px;
    place-items: center;
    background:
      radial-gradient(circle at 8% 8%, rgba(41, 112, 255, .10), transparent 18rem),
      linear-gradient(180deg, #fbfcff 0%, #f5f7fb 100%);
  }
  .ark-auth-card {
    width: 100%;
    padding: 22px 20px;
    border-radius: 18px;
    box-shadow: 0 18px 46px rgba(16, 24, 40, .12);
  }
  .ark-auth-brand { padding-bottom: 19px; }
  .ark-auth-logo-wrap { width: 44px; height: 44px; flex-basis: 44px; border-radius: 12px; }
  .ark-auth-heading { padding: 21px 0 18px; }
  .ark-auth-heading h1 { font-size: 25px; }
  .ark-auth-heading p { font-size: 12px; }
  .ark-auth-control { min-height: 50px; }
  .ark-auth-control input { height: 48px; line-height: 48px; font-size: 16px; }
  .ark-auth-password-toggle { top: 5px; }
  .ark-auth-submit { min-height: 50px; }
  .ark-auth-footer { margin-top: 20px; }
  .ark-auth-orb { display: none; }
}

@media (max-width: 380px) {
  .ark-auth-shell.ark-ui-v2 { padding: 10px; }
  .ark-auth-card { padding: 19px 16px; }
  .ark-auth-brand-copy small { font-size: 9.5px; }
  .ark-auth-footer { align-items: flex-start; flex-direction: column; gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .ark-auth-shell.ark-ui-v2 *,
  .ark-auth-shell.ark-ui-v2 *::before,
  .ark-auth-shell.ark-ui-v2 *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
