/* TessyHostsData shared design foundation */
:root {
  color-scheme: light;
  --thd-lavender: #F5EEFF;
  --thd-lilac: #E5D5FF;
  --thd-orchid: #A84FE6;
  --thd-plum: #35104F;
  --thd-cream: #FFFCF6;
  --thd-ink: #281A35;
  --thd-muted: #756981;
  --thd-line: #E7DFF0;
  --thd-surface: #FFFFFF;
  --thd-radius: 14px;
  --thd-shadow: 0 10px 28px rgba(53, 16, 79, 0.08);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Poppins, "Segoe UI", system-ui, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: inherit;
  line-height: 1.18;
  letter-spacing: -0.018em;
}

p, li, label, small {
  line-height: 1.55;
}

img, picture, video, canvas, svg {
  max-width: 100%;
}

button, input, select, textarea {
  font: inherit;
}

button, [role="button"], input[type="button"],
input[type="submit"], input[type="reset"] {
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease,
    border-color 160ms ease, box-shadow 160ms ease;
}

button:disabled, input:disabled, select:disabled, textarea:disabled {
  cursor: not-allowed;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"]),
select, textarea {
  max-width: 100%;
  border: 1px solid var(--thd-line);
  border-radius: 11px;
  padding: 0.68rem 0.82rem;
  color: var(--thd-ink);
  background-color: var(--thd-surface);
}

textarea {
  min-height: 7rem;
  resize: vertical;
}

a {
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 3px solid var(--thd-orchid);
  outline-offset: 2px;
}

::selection {
  color: var(--thd-plum);
  background: var(--thd-lilac);
}

@media (max-width: 640px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"]),
  select, textarea {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Contact page refinement — OVH staging */
body:has(#contactForm) {
  background: linear-gradient(180deg, #F8F3FF 0%, #FFFCF6 72%);
  color: var(--thd-ink);
}

body:has(#contactForm) main {
  width: min(1120px, calc(100% - 40px));
  max-width: none;
  margin: 0 auto;
  padding: clamp(36px, 5vw, 70px) 0 64px;
}

body:has(#contactForm) main > section:first-child {
  max-width: 790px;
  margin: 0 0 28px;
  padding: 0 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body:has(#contactForm) main > section:first-child .eyebrow {
  color: #7D35B3;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

body:has(#contactForm) main h1 {
  margin: 12px 0 16px;
  color: var(--thd-plum);
  font-size: clamp(2.15rem, 4.5vw, 3.65rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

body:has(#contactForm) main > section:first-child p {
  max-width: 660px;
  color: var(--thd-muted);
  font-size: clamp(1rem, 1.5vw, 1.12rem);
}

body:has(#contactForm) .layout {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  align-items: start;
  gap: 24px;
  width: 100%;
}

body:has(#contactForm) .panel {
  min-width: 0;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--thd-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--thd-shadow);
}

body:has(#contactForm) .panel h2 {
  margin-top: 0;
  margin-bottom: 14px;
  color: var(--thd-plum);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.3;
}

body:has(#contactForm) .panel p {
  color: var(--thd-muted);
}

body:has(#contactForm) .note {
  margin-top: 22px;
  padding: 16px 18px;
  border: 1px solid #E5D5FF;
  border-left: 4px solid var(--thd-orchid);
  border-radius: 12px;
  background: #FAF6FF;
  color: var(--thd-plum);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

body:has(#contactForm) #contactForm {
  display: grid;
  gap: 17px;
  margin: 0;
}

body:has(#contactForm) #contactForm .field {
  min-width: 0;
  margin: 0;
}

body:has(#contactForm) #contactForm .field.hidden {
  display: none !important;
}

body:has(#contactForm) #contactForm label {
  display: block;
  margin-bottom: 7px;
  color: var(--thd-ink);
  font-size: 0.9rem;
  font-weight: 600;
}

body:has(#contactForm) #contactForm input:not([type="checkbox"]):not([type="radio"]),
body:has(#contactForm) #contactForm select,
body:has(#contactForm) #contactForm textarea {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid #DCD0E8;
  border-radius: 11px;
  background: #FFFEFF;
  color: var(--thd-ink);
  box-shadow: none;
}

body:has(#contactForm) #contactForm input:focus,
body:has(#contactForm) #contactForm select:focus,
body:has(#contactForm) #contactForm textarea:focus {
  border-color: var(--thd-orchid);
  outline: 3px solid rgba(168, 79, 230, 0.13);
  outline-offset: 1px;
}

body:has(#contactForm) #contactForm textarea {
  min-height: 155px;
  line-height: 1.6;
}

body:has(#contactForm) #contactForm small {
  display: block;
  margin-top: 7px;
  color: var(--thd-muted);
  font-size: 0.8rem;
}

body:has(#contactForm) .captcha-box {
  min-width: 0;
  overflow-wrap: anywhere;
  border-radius: 12px;
}

body:has(#contactForm) #submitButton {
  min-height: 48px;
  width: 100%;
  padding: 12px 20px;
  border: 1px solid var(--thd-plum);
  border-radius: 12px;
  background: var(--thd-plum);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(53, 16, 79, 0.14);
}

body:has(#contactForm) #submitButton:hover:not(:disabled) {
  background: #522174;
  border-color: #522174;
}

body:has(#contactForm) #submitButton:disabled {
  opacity: 0.65;
  box-shadow: none;
}

body:has(#contactForm) #formStatus {
  overflow-wrap: anywhere;
}

@media (max-width: 780px) {
  body:has(#contactForm) main {
    width: min(100% - 28px, 620px);
    padding-top: 34px;
    padding-bottom: 42px;
  }

  body:has(#contactForm) .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  body:has(#contactForm) .panel {
    padding: 22px;
    border-radius: 16px;
  }

  body:has(#contactForm) main > section:first-child {
    margin-bottom: 18px;
  }
}

@media (max-width: 400px) {
  body:has(#contactForm) main {
    width: calc(100% - 22px);
  }

  body:has(#contactForm) .panel {
    padding: 17px;
  }
}

/* Shared four-group footer — OVH staging */
.thd-site-footer {
  width: 100%;
  margin-top: clamp(40px, 7vw, 84px);
  padding: clamp(30px, 5vw, 54px) max(22px, calc((100% - 1240px) / 2));
  background: #281039;
  color: #FFFCF6;
  border-top: 3px solid #A84FE6;
}

.thd-site-footer .thd-footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
}

.thd-site-footer .thd-footer-group {
  min-width: 0;
}

.thd-site-footer .thd-footer-group h2 {
  margin: 0 0 16px;
  color: #E5D5FF;
  font-size: 0.91rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
}

.thd-site-footer .thd-footer-group ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.thd-site-footer .thd-footer-group a {
  color: #F5EDF9;
  font-size: 0.86rem;
  line-height: 1.5;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.thd-site-footer .thd-footer-group a:hover {
  color: #E5D5FF;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.thd-site-footer .thd-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  max-width: 1240px;
  margin: 34px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(229, 213, 255, 0.25);
  color: #DCCFE7;
  font-size: 0.78rem;
  line-height: 1.6;
}

.thd-site-footer a:focus-visible {
  outline-color: #E5D5FF;
}

@media (max-width: 900px) {
  .thd-site-footer .thd-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 24px;
  }
}

@media (max-width: 480px) {
  .thd-site-footer {
    padding: 30px 18px 22px;
  }

  .thd-site-footer .thd-footer-grid {
    gap: 24px 16px;
  }

  .thd-site-footer .thd-footer-group h2 {
    font-size: 0.84rem;
  }

  .thd-site-footer .thd-footer-group a {
    font-size: 0.81rem;
  }

  .thd-site-footer .thd-footer-bottom {
    margin-top: 26px;
  }
}

/* Dashboard, Admin and Super Admin refinement — OVH staging */

/* Regular project dashboard */
body:has(.sidebar) .app {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  min-height: 100vh;
  min-width: 0;
  background: #F8F5FC;
}

body:has(.sidebar) .sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  width: 100%;
  height: 100vh;
  min-width: 0;
  overflow-y: auto;
  padding: 25px 17px;
  background: #2D1048;
  color: #FFFCF6;
  border-right: 1px solid rgba(255,255,255,.09);
}

body:has(.sidebar) .brand {
  margin-bottom: 28px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

body:has(.sidebar) .sidebar .nav {
  display: grid;
  gap: 5px;
}

body:has(.sidebar) .sidebar .nav button {
  width: 100%;
  min-height: 43px;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #F4EAFB;
  text-align: left;
  line-height: 1.4;
}

body:has(.sidebar) .sidebar .nav button:hover {
  background: rgba(229,213,255,.12);
}

body:has(.sidebar) .sidebar .nav button.active {
  border-color: rgba(229,213,255,.18);
  background: #4A2167;
  color: #FFFFFF;
  font-weight: 600;
}

body:has(.sidebar) .main {
  min-width: 0;
  width: 100%;
  padding: clamp(22px, 3.5vw, 48px);
}

body:has(.sidebar) .top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 30px;
}

body:has(.sidebar) .title {
  color: var(--thd-plum);
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.15;
  letter-spacing: -.035em;
}

body:has(.sidebar) .subtitle,
body:has(.sidebar) .sub {
  max-width: 760px;
  color: var(--thd-muted);
  line-height: 1.65;
}

body:has(.sidebar) .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 18px;
  min-width: 0;
}

body:has(.sidebar) .card {
  min-width: 0;
  padding: clamp(18px, 2.2vw, 25px);
  border: 1px solid var(--thd-line);
  border-radius: 16px;
  background: #FFFFFF;
  box-shadow: 0 5px 18px rgba(53,16,79,.045);
}

body:has(.sidebar) .card h2,
body:has(.sidebar) .card h3 {
  color: var(--thd-plum);
  line-height: 1.3;
}

body:has(.sidebar) .label,
body:has(.sidebar) .eyebrow {
  color: #76528E;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .035em;
}

body:has(.sidebar) .stat {
  color: var(--thd-plum);
  font-size: clamp(1.65rem, 2.7vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}

body:has(.sidebar) .main button,
body:has(.sidebar) .main .primary {
  min-height: 40px;
  border-radius: 10px;
  font-weight: 600;
}

body:has(.sidebar) .main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="file"]),
body:has(.sidebar) .main select,
body:has(.sidebar) .main textarea {
  width: 100%;
  max-width: 100%;
}

body:has(.sidebar) .main form,
body:has(.sidebar) .main .field {
  min-width: 0;
}

body:has(.sidebar) .main .list,
body:has(.sidebar) .main .tablewrap {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

body:has(.sidebar) .main table {
  width: 100%;
  border-collapse: collapse;
}

body:has(.sidebar) .main th,
body:has(.sidebar) .main td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--thd-line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

/* Platform Admin and Super Admin */
body:has(aside.side) {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  align-items: start;
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  background: #F8F5FC;
  color: var(--thd-ink);
}

body:has(aside.side) aside.side {
  position: sticky;
  top: 0;
  align-self: start;
  width: 100%;
  height: 100vh;
  min-width: 0;
  overflow-y: auto;
  padding: 25px 17px;
  background: #2D1048;
  color: #FFFCF6;
  border-right: 1px solid rgba(255,255,255,.09);
}

body:has(aside.side) aside.side .brand {
  margin-bottom: 26px;
  color: #FFFFFF;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

body:has(aside.side) aside.side .brand span {
  display: block;
  margin-top: 4px;
  color: #DCC5F0;
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .1em;
}

body:has(aside.side) aside.side nav {
  display: grid;
  gap: 5px;
}

body:has(aside.side) aside.side nav button {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #F4EAFB;
  text-align: left;
  line-height: 1.45;
}

body:has(aside.side) aside.side nav button:hover {
  background: rgba(229,213,255,.12);
}

body:has(aside.side) aside.side nav button.active {
  border-color: rgba(229,213,255,.18);
  background: #4A2167;
  color: #FFFFFF;
  font-weight: 600;
}

body:has(aside.side) .main {
  min-width: 0;
  width: 100%;
  padding: clamp(22px, 3.5vw, 48px);
}

body:has(aside.side) .top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 26px;
}

body:has(aside.side) .title {
  color: var(--thd-plum);
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.15;
  letter-spacing: -.035em;
}

body:has(aside.side) .sub,
body:has(aside.side) .eyebrow {
  color: var(--thd-muted);
  line-height: 1.6;
}

body:has(aside.side) .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 17px;
  min-width: 0;
}

body:has(aside.side) .card {
  min-width: 0;
  padding: clamp(17px, 2vw, 24px);
  border: 1px solid var(--thd-line);
  border-radius: 15px;
  background: #FFFFFF;
  box-shadow: 0 5px 18px rgba(53,16,79,.045);
}

body:has(aside.side) .card h2,
body:has(aside.side) .card h3 {
  color: var(--thd-plum);
  line-height: 1.35;
}

body:has(aside.side) .metric {
  color: var(--thd-plum);
  overflow-wrap: anywhere;
}

body:has(aside.side) .tablewrap {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--thd-line);
  border-radius: 12px;
  background: #FFFFFF;
}

body:has(aside.side) table {
  width: 100%;
  border-collapse: collapse;
}

body:has(aside.side) th {
  background: #F4ECFC;
  color: var(--thd-plum);
  font-size: .82rem;
  font-weight: 700;
}

body:has(aside.side) th,
body:has(aside.side) td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--thd-line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

body:has(aside.side) .toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

body:has(aside.side) .toolbar input,
body:has(aside.side) .toolbar select {
  max-width: 100%;
}

body:has(aside.side) input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="file"]),
body:has(aside.side) select,
body:has(aside.side) textarea {
  max-width: 100%;
}

body:has(aside.side) .section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

body:has(aside.side) .section-head h2 {
  margin: 0;
  color: var(--thd-plum);
  font-size: clamp(1.35rem, 2.3vw, 1.85rem);
  line-height: 1.3;
}

/* Keep tab visibility under the existing application logic. */
@media (max-width: 820px) {
  body:has(.sidebar) .app,
  body:has(aside.side) {
    display: block;
  }

  body:has(.sidebar) .sidebar,
  body:has(aside.side) aside.side {
    position: relative;
    width: 100%;
    height: auto;
    max-height: none;
    padding: 16px;
    overflow: visible;
  }

  body:has(.sidebar) .brand,
  body:has(aside.side) aside.side .brand {
    margin-bottom: 14px;
  }

  body:has(.sidebar) .sidebar .nav,
  body:has(aside.side) aside.side nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  body:has(.sidebar) .sidebar .nav button,
  body:has(aside.side) aside.side nav button {
    width: auto;
    max-width: 100%;
    min-height: 40px;
  }

  body:has(.sidebar) .main,
  body:has(aside.side) .main {
    padding: 22px 16px 36px;
  }

  body:has(.sidebar) .top,
  body:has(aside.side) .top {
    margin-bottom: 22px;
  }
}

@media (max-width: 480px) {
  body:has(.sidebar) .grid,
  body:has(aside.side) .grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body:has(.sidebar) .card,
  body:has(aside.side) .card {
    padding: 17px;
  }

  body:has(.sidebar) .main table,
  body:has(aside.side) table {
    min-width: 560px;
  }
}

/* Standalone pages and footer layout — OVH staging */

/* Legal, Connect Website, Payments and Commerce */
body:has(> main h1):not(:has(.hero-full-photo)):not(:has(.sidebar)):not(:has(aside.side)):not(:has(#contactForm)) {
  min-width: 0;
  background: linear-gradient(180deg, #F8F3FF 0%, #FFFCF6 420px);
  color: var(--thd-ink);
}

body:has(> main h1):not(:has(.hero-full-photo)):not(:has(.sidebar)):not(:has(aside.side)):not(:has(#contactForm)) > main {
  width: min(1120px, calc(100% - 40px));
  min-width: 0;
  margin: 0 auto;
  padding: clamp(34px, 5vw, 64px) 0;
}

body:has(> main h1):not(:has(.hero-full-photo)):not(:has(.sidebar)):not(:has(aside.side)):not(:has(#contactForm)) main h1 {
  margin: 0 0 14px;
  color: var(--thd-plum);
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -.04em;
  text-wrap: balance;
}

body:has(> main h1):not(:has(.hero-full-photo)):not(:has(.sidebar)):not(:has(aside.side)):not(:has(#contactForm)) main h2 {
  color: var(--thd-plum);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.3;
}

body:has(> main h1):not(:has(.hero-full-photo)):not(:has(.sidebar)):not(:has(aside.side)):not(:has(#contactForm)) main p {
  line-height: 1.7;
}

body:has(> main h1):not(:has(.hero-full-photo)):not(:has(.sidebar)):not(:has(aside.side)):not(:has(#contactForm)) main .card,
body:has(> main h1):not(:has(.hero-full-photo)):not(:has(.sidebar)):not(:has(aside.side)):not(:has(#contactForm)) main .panel,
body:has(> main h1):not(:has(.hero-full-photo)):not(:has(.sidebar)):not(:has(aside.side)):not(:has(#contactForm)) main .section {
  min-width: 0;
  border-color: var(--thd-line);
  border-radius: 16px;
}

body:has(> main h1):not(:has(.hero-full-photo)):not(:has(.sidebar)):not(:has(aside.side)):not(:has(#contactForm)) main form {
  min-width: 0;
}

body:has(> main h1):not(:has(.hero-full-photo)):not(:has(.sidebar)):not(:has(aside.side)):not(:has(#contactForm)) main label {
  color: var(--thd-ink);
  font-weight: 600;
}

body:has(> main h1):not(:has(.hero-full-photo)):not(:has(.sidebar)):not(:has(aside.side)):not(:has(#contactForm)) main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="file"]),
body:has(> main h1):not(:has(.hero-full-photo)):not(:has(.sidebar)):not(:has(aside.side)):not(:has(#contactForm)) main select,
body:has(> main h1):not(:has(.hero-full-photo)):not(:has(.sidebar)):not(:has(aside.side)):not(:has(#contactForm)) main textarea {
  width: 100%;
  max-width: 100%;
  border: 1px solid #DCD0E8;
  border-radius: 10px;
}

body:has(> main h1):not(:has(.hero-full-photo)):not(:has(.sidebar)):not(:has(aside.side)):not(:has(#contactForm)) main button {
  min-height: 40px;
  border-radius: 10px;
  font-weight: 600;
}

body:has(> main h1):not(:has(.hero-full-photo)):not(:has(.sidebar)):not(:has(aside.side)):not(:has(#contactForm)) main table {
  width: 100%;
  border-collapse: collapse;
}

body:has(> main h1):not(:has(.hero-full-photo)):not(:has(.sidebar)):not(:has(aside.side)):not(:has(#contactForm)) main th {
  background: #F4ECFC;
  color: var(--thd-plum);
}

body:has(> main h1):not(:has(.hero-full-photo)):not(:has(.sidebar)):not(:has(aside.side)):not(:has(#contactForm)) main th,
body:has(> main h1):not(:has(.hero-full-photo)):not(:has(.sidebar)):not(:has(aside.side)):not(:has(#contactForm)) main td {
  padding: 12px;
  border-bottom: 1px solid var(--thd-line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

/* Authentication screens */
body:has(#loginFormElement),
body:has(#signupFormElement) {
  min-height: 100vh;
  background: linear-gradient(145deg, #F1E6FF 0%, #FFFCF6 58%, #F8F3FF 100%);
  color: var(--thd-ink);
}

body:has(#loginFormElement) #loginFormElement,
body:has(#signupFormElement) #signupFormElement {
  max-width: 500px;
  margin: 24px auto;
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid var(--thd-line);
  border-radius: 20px;
  background: rgba(255,255,255,.97);
  box-shadow: var(--thd-shadow);
}

body:has(#loginFormElement) #loginFormElement label,
body:has(#signupFormElement) #signupFormElement label {
  display: block;
  margin-bottom: 7px;
  color: var(--thd-ink);
  font-weight: 600;
}

body:has(#loginFormElement) #loginFormElement input:not([type="checkbox"]),
body:has(#signupFormElement) #signupFormElement input:not([type="checkbox"]) {
  width: 100%;
  max-width: 100%;
  border: 1px solid #DCD0E8;
  border-radius: 10px;
}

body:has(#loginFormElement) #loginFormElement button,
body:has(#signupFormElement) #signupFormElement button {
  min-height: 44px;
  border-radius: 11px;
  font-weight: 600;
}

/* Actual footer markup uses direct group sections on some pages. */
footer.thd-site-footer {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  width: 100%;
  min-width: 0;
  padding: clamp(30px, 5vw, 54px) max(22px, calc((100% - 1240px) / 2));
  margin-top: clamp(36px, 6vw, 72px);
  border-top: 3px solid var(--thd-orchid);
  background: #281039;
  color: #FFFCF6;
}

footer.thd-site-footer .thd-footer-group {
  min-width: 0;
}

footer.thd-site-footer .thd-footer-group h2 {
  margin: 0 0 14px;
  color: #E5D5FF;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.4;
}

footer.thd-site-footer .thd-footer-group ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

footer.thd-site-footer .thd-footer-group a {
  color: #F5EDF9;
  font-size: .84rem;
  line-height: 1.5;
  text-decoration: none;
  overflow-wrap: anywhere;
}

footer.thd-site-footer .thd-footer-group a:hover {
  color: #E5D5FF;
  text-decoration: underline;
  text-underline-offset: 4px;
}

footer.thd-site-footer .thd-footer-bottom {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 1240px;
  margin: 8px auto 0;
}

@media (max-width: 850px) {
  footer.thd-site-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 22px;
    padding: 30px 22px;
  }

  body:has(> main h1):not(:has(.hero-full-photo)):not(:has(.sidebar)):not(:has(aside.side)):not(:has(#contactForm)) > main {
    width: calc(100% - 32px);
    padding-block: 32px;
  }
}

@media (max-width: 480px) {
  footer.thd-site-footer {
    padding: 28px 17px 22px;
    gap: 23px 15px;
  }

  footer.thd-site-footer .thd-footer-group h2 {
    font-size: .82rem;
  }

  footer.thd-site-footer .thd-footer-group a {
    font-size: .78rem;
  }

  body:has(#loginFormElement) #loginFormElement,
  body:has(#signupFormElement) #signupFormElement {
    margin: 14px 11px;
    padding: 21px 17px;
  }
}

/* Footer width and word-wrap correction — OVH staging */
footer.thd-site-footer {
  display: block !important;
  grid-template-columns: none !important;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
  align-items: start !important;
  justify-content: stretch !important;
  gap: 0 !important;
}

footer.thd-site-footer > .thd-footer-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  width: 100% !important;
  max-width: 1240px !important;
  margin: 0 auto !important;
  gap: 28px !important;
}

footer.thd-site-footer > .thd-footer-group {
  display: block !important;
  position: static !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  justify-self: stretch !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

footer.thd-site-footer > .thd-footer-group ul {
  display: grid !important;
  width: auto !important;
  max-width: none !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

footer.thd-site-footer > .thd-footer-group a {
  display: inline !important;
  width: auto !important;
  max-width: 100% !important;
  white-space: normal !important;
  overflow-wrap: break-word !important;
  word-break: normal !important;
  hyphens: manual !important;
}

@media (max-width: 850px) {
  footer.thd-site-footer > .thd-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 26px 22px !important;
  }
}

@media (max-width: 480px) {
  footer.thd-site-footer {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 22px !important;
  }
}
