:root {
  color-scheme: dark;
  --domtec-bg: #050b11;
  --domtec-panel: rgba(12, 21, 28, 0.84);
  --domtec-panel-strong: rgba(8, 15, 22, 0.92);
  --domtec-border: rgba(255, 255, 255, 0.1);
  --domtec-text: #f3f7fb;
  --domtec-muted: #b9c9d7;
  --domtec-accent: #eaf2fa;
  --domtec-accent-text: #0a1620;
  --domtec-glow: rgba(92, 148, 196, 0.18);
}

html,
body {
  background: var(--domtec-bg) !important;
}

body[data-theme="dark"] {
  margin: 0;
  color: var(--domtec-text) !important;
  font-family: "Trebuchet MS", "Avenir Next", "Segoe UI", sans-serif !important;
  background:
    radial-gradient(circle at top left, rgba(87, 132, 170, 0.22), transparent 32%),
    radial-gradient(circle at right center, rgba(255, 255, 255, 0.06), transparent 28%),
    linear-gradient(135deg, #060c12 0%, #081019 48%, #050b11 100%) !important;
}

body[data-theme="dark"]::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent 68%);
  opacity: 0.55;
}

#root {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

#domtec-auth-branding {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  z-index: 1;
  min-height: 100vh;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.055);
  background:
    radial-gradient(circle at top left, rgba(87, 132, 170, 0.18), transparent 30%),
    radial-gradient(circle at 68% 42%, rgba(255, 255, 255, 0.045), transparent 26%),
    linear-gradient(135deg, rgba(7, 13, 20, 0.98), rgba(4, 10, 16, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#domtec-auth-branding::after {
  content: "DOMTEC AUTH";
  position: absolute;
  left: clamp(18px, 4vw, 54px);
  bottom: clamp(84px, 12vh, 150px);
  z-index: 1;
  font-size: clamp(2.1rem, 8vw, 7rem);
  letter-spacing: 0.34em;
  color: rgba(255, 255, 255, 0.028);
  white-space: nowrap;
  pointer-events: none;
}

.domtec-auth-copy {
  box-sizing: border-box;
  position: absolute;
  top: clamp(28px, 5vw, 56px);
  left: clamp(28px, 5vw, 64px);
  z-index: 4;
  width: min(450px, calc(100vw - 56px));
  text-align: left;
  pointer-events: none;
}

#domtec-auth-branding > #root {
  position: relative;
  z-index: 3;
  width: 100%;
  min-height: 100vh;
}

.domtec-auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: #c6d8e7;
}

.domtec-auth-family {
  margin: 0;
  font-size: clamp(2.35rem, 5.2vw, 4.6rem);
  line-height: 0.94;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--domtec-text);
}

.domtec-auth-subtitle {
  margin: 1rem 0 1.35rem;
  max-width: 27rem;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--domtec-muted);
}

#domtec-auth-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  position: fixed;
  left: 50%;
  bottom: clamp(18px, 4vh, 38px);
  z-index: 5;
  transform: translateX(-50%);
  width: min(420px, calc(100vw - 40px));
  opacity: 0.56;
  pointer-events: auto;
}

.domtec-auth-footer-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(185, 201, 215, 0.48) !important;
}

.domtec-auth-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
}

.domtec-auth-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0.34rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(185, 201, 215, 0.13);
  background: rgba(255, 255, 255, 0.025);
  color: rgba(195, 207, 218, 0.58) !important;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  pointer-events: auto;
  transition: opacity 160ms ease, border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.domtec-auth-links a:hover {
  border-color: rgba(205, 216, 226, 0.28);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(232, 238, 244, 0.82) !important;
}

body[data-theme="dark"] main,
body[data-theme="dark"] form,
body[data-theme="dark"] [class*="MuiPaper-root"],
body[data-theme="dark"] [class*="MuiCard-root"],
body[data-theme="dark"] [class*="MuiContainer-root"] > [class*="MuiBox-root"] {
  background: var(--domtec-panel) !important;
  border: 1px solid var(--domtec-border) !important;
  border-radius: 28px !important;
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.015) inset !important;
  backdrop-filter: blur(18px);
}

body[data-theme="dark"] [class*="MuiTypography-root"],
body[data-theme="dark"] label,
body[data-theme="dark"] p,
body[data-theme="dark"] span,
body[data-theme="dark"] a {
  color: var(--domtec-text) !important;
}

body[data-theme="dark"] [class*="MuiTypography-root"][class*="MuiTypography-body"],
body[data-theme="dark"] [class*="MuiTypography-root"][class*="MuiTypography-caption"],
body[data-theme="dark"] [class*="MuiFormHelperText-root"] {
  color: var(--domtec-muted) !important;
}

body[data-theme="dark"] input,
body[data-theme="dark"] textarea,
body[data-theme="dark"] [class*="MuiInputBase-root"] {
  color: var(--domtec-text) !important;
  background: rgba(7, 13, 20, 0.82) !important;
  border-radius: 18px !important;
}

body[data-theme="dark"] fieldset {
  border-color: rgba(255, 255, 255, 0.12) !important;
}

body[data-theme="dark"] button,
body[data-theme="dark"] [class*="MuiButton-root"] {
  border-radius: 999px !important;
  text-transform: none !important;
  font-weight: 700 !important;
}

body[data-theme="dark"] [class*="MuiButton-containedPrimary"],
body[data-theme="dark"] [class*="MuiButton-contained"] {
  background: var(--domtec-accent) !important;
  color: var(--domtec-accent-text) !important;
}

body[data-theme="dark"] [class*="MuiButton-outlined"],
body[data-theme="dark"] [class*="MuiChip-root"] {
  border-color: rgba(255, 255, 255, 0.16) !important;
  color: var(--domtec-text) !important;
}

body[data-theme="dark"] header[class*="MuiAppBar-root"] {
  width: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  pointer-events: none;
}

body[data-theme="dark"] header[class*="MuiAppBar-root"] [class*="MuiToolbar-root"] {
  justify-content: flex-end !important;
  min-height: 42px !important;
  padding: 10px 24px 0 0 !important;
}

body[data-theme="dark"] #language-button {
  min-width: 0 !important;
  min-height: 34px !important;
  padding: 0.25rem 0.7rem !important;
  border: 1px solid rgba(185, 201, 215, 0.16) !important;
  background: rgba(8, 15, 22, 0.46) !important;
  box-shadow: none !important;
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

body[data-theme="dark"] a[href*="domtec.io"] {
  color: rgba(195, 207, 218, 0.58) !important;
}

@media (max-width: 980px) {
  #domtec-auth-branding {
    position: relative;
    inset: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .domtec-auth-copy {
    position: relative;
    top: auto;
    left: auto;
    margin: 22px 22px 0;
  }

  #domtec-auth-branding > #root {
    min-height: auto;
    padding-bottom: 1.5rem;
  }

  #domtec-auth-footer {
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0 auto 24px;
  }

  .domtec-auth-links {
    justify-content: center;
  }
}
