/**
 * Login / access — quiet brand gate.
 * Night: ink field + bright lime wireframe.
 * Day: light Premium bg + deeper lime wireframe (canvas adapts via theme).
 * Marketing explains the product; login only authenticates.
 *
 * Colours live once as --mkt-* tokens. Alphas use color-mix against those
 * tokens so a theme pack cannot retint the gate through --dx-*.
 */

:root {
  --mkt-ink: #080a0b;
  --mkt-surface: #111516;
  --mkt-lime-bright: #c8f04a;
  --mkt-lime-top: #d6fa72;
  --mkt-lime-bottom: #b6df38;
  --mkt-lime-deep: #7aab12;
  --mkt-lime: var(--mkt-lime-bright);
  --mkt-muted: #8e9898;
  --mkt-muted-day: #56565b;
  --mkt-paper: #f5f5f7;
  --mkt-on-lime: #10140d;
  --mkt-input: #0c1012;
  --mkt-input-text: #fff;
  --mkt-chip: #f0f5ef;
  --mkt-lang: #7a8480;
  --mkt-lang-top: #d4f86a;
  --mkt-link-hover: #e6ff91;
  --mkt-day: #f5f5f7;
  --mkt-day-ink: #1d1d1f;
  --mkt-day-chip: #1d1d1f;
  --mkt-day-lang-top: #8bc41a;
  --mkt-fog: #f5f5f7;
  --mkt-glass: #0a0e0e;
  --mkt-chip-bg: #080c0c;
  --mkt-cta: linear-gradient(180deg, var(--mkt-lime-top) 0%, var(--mkt-lime-bright) 48%, var(--mkt-lime-bottom) 100%);
  --mkt-home: linear-gradient(180deg, var(--mkt-lime-top), var(--mkt-lime-bright));
  --mkt-lang-active: linear-gradient(180deg, var(--mkt-lang-top), var(--mkt-lime-bright));
  --mkt-day-lang-active: linear-gradient(180deg, var(--mkt-day-lang-top), var(--mkt-lime-deep));
}

/* Same zero-specificity ink as AuthGateFrame, with the exact gate colours. */
:where(html),
:where(body) {
  background: var(--mkt-ink);
  color: var(--mkt-paper);
}

.dx-scope-access.dx-access-premium,
html[data-app-theme='dentixa-premium'] .dx-scope-access.dx-access-premium,
html[data-public-theme] .dentixa-public .dx-scope-access.dx-access-premium,
html[data-app-theme] .dx-scope-access.dx-access-premium {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 0 !important;
  overflow: hidden;
  background: var(--mkt-ink) !important;
  color: var(--mkt-paper);
  color-scheme: dark;
  font-family: var(--font-num), var(--font-cairo), system-ui, sans-serif;
}

/* Explicit light only. A missing dark class used to match every document,
   including the dark public gate, and then painted --dx-bg which other packs
   can force to ink while text goes dark. */
html.light .dx-scope-access.dx-access-premium,
html[data-public-theme='light'] .dx-scope-access.dx-access-premium,
html[data-public-theme='light'] .dentixa-public .dx-scope-access.dx-access-premium {
  --mkt-lime: var(--mkt-lime-deep);
  background-color: var(--mkt-day) !important;
  background-image: radial-gradient(
    ellipse 70% 52% at 50% -8%,
    color-mix(in srgb, var(--mkt-lime-deep) 16%, transparent),
    transparent 58%
  ) !important;
  background-repeat: no-repeat !important;
  color: var(--mkt-day-ink);
  color-scheme: light;
}

.dx-access-noise {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)' opacity='.36'/%3E%3C/svg%3E");
}

/* Out of flow and viewport-bounded. A canvas in normal flow that copies
   clientHeight onto its CSS height grows without limit and hides the form.
   Inline canvas width/height lose to these declarations. */
.dx-access-globe,
.dx-access-globe-canvas,
.dx-access-globe-vignette,
.dx-scope-access .dx-access-globe,
.dx-scope-access .dx-access-globe-canvas,
.dx-scope-access .dx-access-globe-vignette {
  position: fixed !important;
  inset: 0;
  z-index: 0 !important;
  width: 100% !important;
  height: 100vh;
  height: 100dvh !important;
  max-width: 100vw !important;
  max-height: 100vh;
  max-height: 100dvh !important;
  overflow: hidden;
  pointer-events: none !important;
}

.dx-access-globe-canvas {
  display: block;
}

.dx-access-globe-vignette {
  background:
    radial-gradient(ellipse at 50% 48%, transparent 42%, color-mix(in srgb, var(--mkt-ink) 28%, transparent) 72%, color-mix(in srgb, var(--mkt-ink) 78%, transparent) 100%),
    linear-gradient(180deg, color-mix(in srgb, var(--mkt-ink) 22%, transparent), transparent 16%, transparent 84%, color-mix(in srgb, var(--mkt-ink) 40%, transparent));
}

html.light .dx-access-globe-vignette,
html[data-public-theme='light'] .dx-access-globe-vignette {
  background:
    radial-gradient(
      ellipse at 50% 48%,
      transparent 40%,
      color-mix(in srgb, var(--mkt-fog) 35%, transparent) 70%,
      color-mix(in srgb, var(--mkt-fog) 88%, transparent) 100%
    ),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--mkt-fog) 55%, transparent),
      transparent 18%,
      transparent 82%,
      color-mix(in srgb, var(--mkt-fog) 70%, transparent)
    );
}

html.light .dx-access-noise,
html[data-public-theme='light'] .dx-access-noise {
  opacity: 0.025;
}

html.light .dx-access-globe-chip,
html[data-public-theme='light'] .dx-access-globe-chip {
  border-color: color-mix(in srgb, var(--mkt-lime-deep) 40%, transparent);
  background: color-mix(in srgb, white 88%, transparent);
  color: var(--mkt-day-chip);
  box-shadow:
    0 10px 28px color-mix(in srgb, black 10%, transparent),
    0 0 0 1px color-mix(in srgb, var(--mkt-lime-deep) 8%, transparent);
}

html.light .dx-access-globe-chip i,
html[data-public-theme='light'] .dx-access-globe-chip i {
  background: color-mix(in srgb, var(--mkt-lime-deep) 14%, transparent);
  border-color: color-mix(in srgb, var(--mkt-lime-deep) 40%, transparent);
}

html.light .dx-access-globe-chip i::before,
html[data-public-theme='light'] .dx-access-globe-chip i::before {
  background: var(--mkt-lime-deep);
}

html.light .dx-access-status,
html[data-public-theme='light'] .dx-access-status {
  border-color: color-mix(in srgb, black 8%, transparent);
  background: color-mix(in srgb, white 82%, transparent);
  color: var(--mkt-muted-day);
  box-shadow: 0 8px 24px color-mix(in srgb, black 6%, transparent);
}

html.light .dx-access-status-dot,
html[data-public-theme='light'] .dx-access-status-dot {
  background: var(--mkt-lime-deep);
  box-shadow: 0 0 8px color-mix(in srgb, var(--mkt-lime-deep) 55%, transparent);
}

html.light .dx-mkt-lang,
html[data-public-theme='light'] .dx-mkt-lang {
  border-color: color-mix(in srgb, black 10%, transparent);
  background: color-mix(in srgb, white 88%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 70%, transparent),
    0 8px 24px color-mix(in srgb, black 8%, transparent);
}

html.light .dx-mkt-lang button,
html[data-public-theme='light'] .dx-mkt-lang button {
  color: var(--mkt-muted-day);
}

html.light .dx-mkt-lang button.active,
html[data-public-theme='light'] .dx-mkt-lang button.active {
  background: var(--mkt-day-lang-active);
  color: var(--mkt-on-lime);
  box-shadow:
    0 1px 0 color-mix(in srgb, white 35%, transparent) inset,
    0 6px 16px color-mix(in srgb, var(--mkt-lime-deep) 28%, transparent);
}

html.light .dx-mkt-lang button:hover:not(.active),
html[data-public-theme='light'] .dx-mkt-lang button:hover:not(.active) {
  color: var(--mkt-day-chip);
  background: color-mix(in srgb, black 4%, transparent);
}

/* Dark glass card stays on day — high-contrast gate over light field.
   The later theme-attribute rule wins back the night glass when a pack is set. */
html.light .dx-access-form,
html[data-public-theme='light'] .dx-access-form {
  border-color: color-mix(in srgb, black 10%, transparent);
  background:
    linear-gradient(165deg, color-mix(in srgb, white 6%, transparent), transparent 40%),
    color-mix(in srgb, var(--mkt-surface) 92%, transparent);
  box-shadow:
    0 28px 70px color-mix(in srgb, black 18%, transparent),
    inset 0 1px 0 color-mix(in srgb, white 6%, transparent);
  color: var(--mkt-paper);
}

html.light .dx-access-form:hover,
html[data-public-theme='light'] .dx-access-form:hover {
  border-color: color-mix(in srgb, var(--mkt-lime-deep) 35%, transparent);
  box-shadow:
    0 32px 80px color-mix(in srgb, black 20%, transparent),
    0 0 40px color-mix(in srgb, var(--mkt-lime-deep) 8%, transparent),
    inset 0 1px 0 color-mix(in srgb, white 7%, transparent);
}

html.light .dx-scope-access.dx-access-premium .dx-eyebrow,
html[data-public-theme='light'] .dx-scope-access.dx-access-premium .dx-eyebrow {
  color: var(--mkt-lime-bright) !important;
}

html.light .dx-access-link,
html[data-public-theme='light'] .dx-access-link {
  color: var(--mkt-lime-bright);
}

html.light .dx-access-link:hover,
html[data-public-theme='light'] .dx-access-link:hover {
  color: var(--mkt-link-hover);
}

.dx-access-globe-chip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.48rem 0.75rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--mkt-lime-bright) 32%, transparent);
  background: color-mix(in srgb, var(--mkt-chip-bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--mkt-chip);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
  opacity: 0;
  will-change: transform, opacity;
  box-shadow:
    0 12px 32px color-mix(in srgb, black 40%, transparent),
    0 0 20px color-mix(in srgb, var(--mkt-lime-bright) 8%, transparent);
  transition: opacity 0.28s ease;
  pointer-events: none;
}

.dx-access-globe-chip i {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 0.3rem;
  background: color-mix(in srgb, var(--mkt-lime-bright) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--mkt-lime-bright) 35%, transparent);
  flex-shrink: 0;
  position: relative;
}

.dx-access-globe-chip i::before {
  content: '';
  position: absolute;
  inset: 22%;
  border-radius: 2px;
  background: var(--mkt-lime-bright);
  opacity: 0.9;
}

.dx-access-globe-chip i[data-kind='newCase']::before {
  clip-path: polygon(20% 20%, 80% 20%, 80% 80%, 20% 80%);
}

.dx-access-globe-chip i[data-kind='statement']::before {
  clip-path: polygon(25% 15%, 75% 15%, 75% 85%, 25% 85%);
}

.dx-access-globe-chip i[data-kind='delivery']::before {
  clip-path: polygon(15% 40%, 50% 15%, 85% 40%, 85% 85%, 15% 85%);
}

.dx-access-globe-chip i[data-kind='payment']::before {
  border-radius: 50%;
}

.dx-access-chrome {
  position: absolute;
  inset-inline: 0;
  top: 0;
  z-index: 50;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  direction: ltr;
  padding-block: max(0.75rem, env(safe-area-inset-top, 0px)) 0.55rem;
  padding-inline: max(1rem, env(safe-area-inset-left, 0px), 4.5vw)
    max(1rem, env(safe-area-inset-right, 0px), 4.5vw);
  pointer-events: none;
}

.dx-access-chrome > * {
  pointer-events: auto;
}

.dx-access-home {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.85rem;
  background: var(--mkt-home);
  color: var(--mkt-on-lime);
  text-decoration: none;
  box-shadow:
    0 1px 0 color-mix(in srgb, white 40%, transparent) inset,
    0 12px 28px color-mix(in srgb, var(--mkt-lime-bright) 35%, transparent);
  transition: transform 0.18s ease, box-shadow 0.2s ease;
}

.dx-access-home:hover {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 color-mix(in srgb, white 45%, transparent) inset,
    0 16px 36px color-mix(in srgb, var(--mkt-lime-bright) 45%, transparent);
}

.dx-access-chrome-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.dx-access-status {
  position: absolute;
  z-index: 40;
  inset-inline: 0;
  bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  padding: 0.45rem 0.85rem;
  width: -moz-max-content;
  width: max-content;
  max-width: calc(100% - 2rem);
  margin-inline: auto;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, white 8%, transparent);
  background: color-mix(in srgb, var(--mkt-glass) 72%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--mkt-muted);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.dx-access-status span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.dx-access-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mkt-lime-bright);
  box-shadow: 0 0 8px color-mix(in srgb, var(--mkt-lime-bright) 70%, transparent);
}

.dx-mkt-lang {
  display: inline-flex;
  gap: 0;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, white 12%, transparent);
  background: color-mix(in srgb, var(--mkt-glass) 72%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 5%, transparent),
    0 8px 24px color-mix(in srgb, black 28%, transparent);
  flex-shrink: 0;
}

.dx-mkt-lang button {
  border: 0;
  background: transparent;
  color: var(--mkt-lang);
  font: 650 0.65rem/1 var(--font-num), var(--font-dm-mono), ui-monospace, sans-serif;
  letter-spacing: 0.08em;
  padding: 0.55rem 0.7rem;
  border-radius: 7px;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
  min-width: 2.35rem;
}

.dx-mkt-lang button.active {
  background: var(--mkt-lang-active);
  color: var(--mkt-on-lime);
  box-shadow:
    0 1px 0 color-mix(in srgb, white 35%, transparent) inset,
    0 6px 16px color-mix(in srgb, var(--mkt-lime-bright) 28%, transparent);
}

.dx-mkt-lang button:hover:not(.active) {
  color: var(--mkt-paper);
  background: color-mix(in srgb, white 4%, transparent);
}

.dx-access-gate {
  position: relative;
  z-index: 4;
  width: min(28.5rem, calc(100% - 2rem));
  padding: clamp(4.5rem, 8vw, 5.5rem) 0 2rem;
}

.dx-access-form,
html[data-public-theme] .dentixa-public .dx-scope-access .dx-access-form,
html[data-app-theme] .dx-scope-access .dx-access-form {
  width: 100%;
  position: relative;
  z-index: 5;
  border: 1px solid color-mix(in srgb, white 11%, transparent);
  border-radius: 1.35rem;
  background:
    linear-gradient(165deg, color-mix(in srgb, white 5.5%, transparent), transparent 40%),
    color-mix(in srgb, var(--mkt-surface) 88%, transparent);
  padding: 2.1rem 1.75rem 1.7rem;
  box-shadow:
    0 28px 70px color-mix(in srgb, black 50%, transparent),
    inset 0 1px 0 color-mix(in srgb, white 6%, transparent);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  transition: border-color 0.25s ease, box-shadow 0.35s ease;
  color: var(--mkt-paper);
}

.dx-access-form:hover {
  border-color: color-mix(in srgb, var(--mkt-lime-bright) 20%, transparent);
  box-shadow:
    0 32px 80px color-mix(in srgb, black 50%, transparent),
    0 0 40px color-mix(in srgb, var(--mkt-lime-bright) 6%, transparent),
    inset 0 1px 0 color-mix(in srgb, white 7%, transparent);
}

.dx-access-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
  margin-bottom: 1.35rem;
}

.dx-access-brand-mark {
  filter: drop-shadow(0 10px 24px color-mix(in srgb, var(--mkt-lime-bright) 16%, transparent));
}

.dx-access-brand-wordmark {
  max-width: min(86vw, 20rem);
}

.dx-access-brand-product {
  margin: 0.1rem 0 0;
  color: var(--mkt-muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

.dx-access-form .dx-eyebrow,
.dx-scope-access.dx-access-premium .dx-eyebrow {
  margin-bottom: 0.45rem;
  color: var(--mkt-lime-bright) !important;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
}

.dx-access-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.4;
  color: var(--mkt-paper);
  text-align: center;
}

.dx-access-form .dx-access-sub {
  color: var(--mkt-muted);
  font-size: 0.82rem;
  margin-top: 0.35rem;
  text-align: center;
  line-height: 1.5;
}

.dx-access-form label {
  display: block;
  margin-top: 1.05rem;
  color: var(--mkt-muted);
  font-size: 11px;
}

.dx-access-form input:not([type='checkbox']):not([type='radio']),
html[data-public-theme] .dentixa-public .dx-scope-access .dx-access-form input:not([type='checkbox']):not([type='radio']),
html[data-app-theme] .dx-scope-access .dx-access-form input:not([type='checkbox']):not([type='radio']) {
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.82rem 0.9rem;
  border: 1px solid color-mix(in srgb, white 12%, transparent) !important;
  border-radius: 10px;
  background: var(--mkt-input) !important;
  color: var(--mkt-input-text) !important;
  box-shadow: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dx-access-form input:focus,
html[data-public-theme] .dentixa-public .dx-access-form input:focus,
html[data-app-theme] .dx-scope-access .dx-access-form input:focus {
  border-color: color-mix(in srgb, var(--mkt-lime-bright) 55%, transparent) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mkt-lime-bright) 20%, transparent) !important;
  outline: none;
}

.dx-access-form button[type='submit'] {
  font-weight: 800;
}

.dx-access-form button[type='submit'],
html[data-public-theme] .dentixa-public .dx-scope-access .dx-access-form button[type='submit'],
html[data-app-theme] .dx-scope-access .dx-access-form button[type='submit'] {
  margin-top: 1.45rem;
  width: 100%;
  padding: 0.92rem 1rem;
  border: 0;
  border-radius: 12px;
  background: var(--mkt-cta) !important;
  background-image: var(--mkt-cta) !important;
  color: var(--mkt-on-lime) !important;
  letter-spacing: -0.01em;
  box-shadow:
    0 1px 0 color-mix(in srgb, white 45%, transparent) inset,
    0 -1px 0 color-mix(in srgb, black 12%, transparent) inset,
    0 10px 28px color-mix(in srgb, var(--mkt-lime-bright) 28%, transparent);
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s ease;
}

.dx-access-form button[type='submit']:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 color-mix(in srgb, white 50%, transparent) inset,
    0 -1px 0 color-mix(in srgb, black 12%, transparent) inset,
    0 14px 36px color-mix(in srgb, var(--mkt-lime-bright) 40%, transparent);
}

.dx-access-form button[type='submit']:active:not(:disabled) {
  transform: translateY(0);
}

.dx-access-link {
  color: var(--mkt-lime-bright);
  text-decoration: none;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.dx-access-link:hover {
  opacity: 1;
  color: var(--mkt-link-hover);
}

.dx-access-link-muted {
  color: var(--mkt-muted);
  font-size: 0.75rem;
}

.dx-access-link-muted:hover {
  color: var(--mkt-lime-bright);
}

.dx-access-reveal {
  animation: dxAccessReveal 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes dxAccessReveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dx-access-reveal {
    animation: none;
  }
}

@media (max-width: 420px) {
  .dx-access-form {
    padding: 1.55rem 1.2rem 1.35rem;
    border-radius: 1.1rem;
  }

  .dx-mkt-lang button {
    min-width: 2rem;
    padding: 0.48rem 0.55rem;
    font-size: 0.6rem;
  }
}

