/* ==========================================================
   Lawtopia — Auth pages (login / register)
   Single source of truth for spacing & layout
   ========================================================== */

body.lawtopia-platform.hx-auth-body {
  --lt-auth-nav: 76px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 55% 45% at 0% 0%, rgba(226, 87, 26, 0.08), transparent 55%),
    radial-gradient(ellipse 40% 35% at 100% 100%, rgba(226, 87, 26, 0.05), transparent 50%),
    var(--lt-paper);
}

body.lawtopia-platform.hx-auth-body > .lt-nav,
body.lawtopia-platform.hx-auth-body > header.lt-nav {
  flex: 0 0 auto;
}

body.lawtopia-platform.hx-auth-body > .hx-auth {
  flex: 1 0 auto;
}

body.lawtopia-platform.hx-auth-body > .lt-foot {
  flex: 0 0 auto;
}

body.lawtopia-platform.hx-auth-body > .phy-toast,
body.lawtopia-platform.hx-auth-body > .lt-atmosphere {
  flex: 0 0 auto;
}

/* Split shell */
body.lawtopia-platform .hx-auth {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: stretch;
  gap: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: calc(100vh - var(--lt-auth-nav));
  min-height: calc(100dvh - var(--lt-auth-nav));
  margin: 0;
  background: transparent;
  overflow-x: clip;
}

/* Form column */
body.lawtopia-platform .hx-auth__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: clamp(1.5rem, 3.5vw, 2.75rem) clamp(1.25rem, 3.5vw, 2.5rem);
  color: var(--lt-ink);
  box-sizing: border-box;
  background: transparent;
  border: 0;
  box-shadow: none;
}

body.lawtopia-platform .hx-auth--register .hx-auth__panel {
  align-items: flex-start;
  padding-block: clamp(1.5rem, 3vw, 2.5rem) clamp(2rem, 4vw, 3rem);
}

body.lawtopia-platform .hx-auth__card {
  width: min(440px, 100%);
  margin: 0;
  padding: clamp(1.35rem, 2.5vw, 2rem);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--lt-rule);
  box-shadow: 0 24px 60px -36px rgba(122, 43, 8, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-sizing: border-box;
}

html[data-theme="dark"] body.lawtopia-platform .hx-auth__card {
  background: rgba(26, 20, 16, 0.92);
  box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.75);
}

body.lawtopia-platform .hx-auth__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin: 0 0 .75rem;
  padding: .35rem .75rem;
  border-radius: 999px;
  background: var(--lt-orange-tint);
  border: 1px solid var(--lt-rule-warm);
  color: var(--lt-orange-deep);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
}

html[data-theme="dark"] body.lawtopia-platform .hx-auth__eyebrow {
  background: rgba(255, 122, 60, 0.12);
  color: var(--lt-orange-hot);
}

body.lawtopia-platform .hx-auth__title {
  margin: 0 0 .45rem;
  font-family: var(--lt-font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  line-height: 1.25;
  color: var(--lt-ink);
}

body.lawtopia-platform .hx-auth__sub {
  margin: 0 0 1.35rem;
  color: var(--lt-muted);
  line-height: 1.75;
  font-size: .95rem;
}

/* Notices */
body.lawtopia-platform .hx-auth__notice {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  margin: 0 0 1.1rem;
  padding: .9rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(198, 40, 40, 0.22);
  background: rgba(198, 40, 40, 0.06);
  color: var(--lt-ink);
}
body.lawtopia-platform .hx-auth__notice--ok {
  border-color: rgba(226, 87, 26, 0.28);
  background: rgba(226, 87, 26, 0.08);
}
body.lawtopia-platform .hx-auth__notice--info {
  border-color: rgba(226, 87, 26, 0.22);
  background: rgba(226, 87, 26, 0.06);
}
body.lawtopia-platform .hx-auth__noticeIco {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #C62828;
  color: #fff;
  font-weight: 800;
  font-size: .85rem;
}
body.lawtopia-platform .hx-auth__notice--ok .hx-auth__noticeIco,
body.lawtopia-platform .hx-auth__notice--info .hx-auth__noticeIco {
  background: var(--lt-orange);
}
body.lawtopia-platform .hx-auth__noticeTitle {
  display: block;
  margin: 0 0 .2rem;
  font-size: .95rem;
  font-weight: 800;
}
body.lawtopia-platform .hx-auth__noticeMsg,
body.lawtopia-platform .hx-auth__noticeList {
  margin: 0;
  font-size: .88rem;
  line-height: 1.65;
  color: var(--lt-muted);
}
body.lawtopia-platform .hx-auth__noticeList {
  padding-inline-start: 1.1rem;
}

/* Form */
body.lawtopia-platform .hx-auth__form {
  display: grid;
  gap: .9rem;
}
body.lawtopia-platform .hx-auth__form .fgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem;
}
body.lawtopia-platform .hx-auth__form .field {
  display: grid;
  gap: .4rem;
  margin: 0;
  min-width: 0;
}
body.lawtopia-platform .hx-auth__form .label {
  font-size: .84rem;
  font-weight: 700;
  color: var(--lt-ink);
}
body.lawtopia-platform .hx-auth__form .input,
body.lawtopia-platform .hx-auth__form select.input {
  width: 100%;
  max-width: 100%;
  min-height: 3.05rem;
  padding: 0 1rem;
  box-sizing: border-box;
  background: var(--lt-paper);
  color: var(--lt-ink);
  border: 1px solid var(--lt-rule);
  border-radius: 12px;
  font-family: var(--lt-font-body);
  font-size: 1rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}
html[data-theme="dark"] body.lawtopia-platform .hx-auth__form .input,
html[data-theme="dark"] body.lawtopia-platform .hx-auth__form select.input {
  background: #14100D;
}
body.lawtopia-platform .hx-auth__form .input::placeholder { color: var(--lt-faint); }
body.lawtopia-platform .hx-auth__form .input:focus {
  outline: none;
  border-color: var(--lt-orange);
  box-shadow: 0 0 0 3px rgba(226, 87, 26, 0.14);
}

body.lawtopia-platform .hx-auth__submit {
  width: 100%;
  max-width: 100%;
  min-height: 3.15rem;
  margin-top: .25rem;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--lt-orange-hot), var(--lt-orange));
  color: #fff;
  font-family: var(--lt-font-body);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: 0 14px 28px -16px rgba(226, 87, 26, 0.7);
  transition: background .2s ease, transform .15s ease;
}
html[data-theme="dark"] body.lawtopia-platform .hx-auth__submit { color: #1A0E06; }
body.lawtopia-platform .hx-auth__submit:hover {
  background: linear-gradient(180deg, var(--lt-orange), var(--lt-orange-deep));
}
body.lawtopia-platform .hx-auth__submit:active { transform: translateY(1px); }

body.lawtopia-platform .hx-auth__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .65rem 1rem;
  margin-top: .15rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--lt-rule);
  font-size: .92rem;
  color: var(--lt-muted);
}
body.lawtopia-platform .hx-auth__meta a,
body.lawtopia-platform .hx-auth__meta button,
body.lawtopia-platform .hx-auth__meta button[type="submit"] {
  min-height: 0;
  padding: 0;
  background: none !important;
  border: 0;
  box-shadow: none !important;
  font-family: inherit;
  font-size: inherit;
  font-weight: 800;
  color: var(--lt-orange) !important;
  text-decoration: none;
  cursor: pointer;
}
body.lawtopia-platform .hx-auth__meta a:hover,
body.lawtopia-platform .hx-auth__meta button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.lawtopia-platform .hx-auth__trust {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: .4rem;
  font-size: .8rem;
  color: var(--lt-faint);
}
body.lawtopia-platform .hx-auth__trust li {
  display: flex;
  align-items: center;
  gap: .45rem;
}
body.lawtopia-platform .hx-auth__trust li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lt-orange);
  flex: none;
}

/* Visual wall — full image, no crop */
body.lawtopia-platform .hx-auth__wall,
body.lawtopia-platform .hx-auth__wall--photo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-height: 0;
  min-width: 0;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  background: #0E0B09;
  border-inline-start: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  line-height: 0;
}
body.lawtopia-platform .hx-auth__wall::before,
body.lawtopia-platform .hx-auth__wall--photo::after {
  content: none;
  display: none;
}
body.lawtopia-platform .hx-auth__wall--photo .hx-auth__wallImg,
body.lawtopia-platform .hx-auth__wallImg {
  position: static !important;
  inset: auto !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
  border-radius: 0 !important;
  object-fit: contain !important;
  object-position: center center !important;
  filter: none !important;
}
body.lawtopia-platform .hx-auth__wallCaption,
body.lawtopia-platform .hx-auth__wallCopy,
body.lawtopia-platform .hx-auth__wallLogo {
  display: none !important;
}
body.lawtopia-platform .hx-dock { display: none !important; }

/* Desktop: column sized to portrait image (3:4) so nothing is cropped */
@media (min-width: 961px) {
  body.lawtopia-platform .hx-auth {
    grid-template-columns: minmax(0, 1fr) max-content;
  }
  body.lawtopia-platform .hx-auth__wall,
  body.lawtopia-platform .hx-auth__wall--photo {
    position: sticky;
    top: var(--lt-auth-nav);
    align-self: start;
    height: calc(100vh - var(--lt-auth-nav));
    height: calc(100dvh - var(--lt-auth-nav));
    max-height: calc(100vh - var(--lt-auth-nav));
    max-height: calc(100dvh - var(--lt-auth-nav));
    width: min(46vw, calc((100dvh - var(--lt-auth-nav)) * 0.75), 520px);
    max-width: min(46vw, 520px);
  }
  body.lawtopia-platform .hx-auth__wall--photo .hx-auth__wallImg,
  body.lawtopia-platform .hx-auth__wallImg {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
  }
}

/* Tablet / mobile — full-width natural image */
@media (max-width: 960px) {
  body.lawtopia-platform .hx-auth {
    display: flex;
    flex-direction: column;
    min-height: 0;
    grid-template-columns: none;
  }
  body.lawtopia-platform .hx-auth__wall,
  body.lawtopia-platform .hx-auth__wall--photo {
    order: -1;
    position: relative;
    top: auto;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    border-inline-start: 0;
    border-bottom: 1px solid var(--lt-rule);
  }
  body.lawtopia-platform .hx-auth__wall--photo .hx-auth__wallImg,
  body.lawtopia-platform .hx-auth__wallImg {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
  }
  body.lawtopia-platform .hx-auth__panel {
    width: 100%;
    max-width: 100%;
    align-items: stretch;
    padding: 1.25rem 1rem 1.75rem;
  }
  body.lawtopia-platform .hx-auth--register .hx-auth__panel {
    padding-block: 1.25rem 2rem;
  }
  body.lawtopia-platform .hx-auth__card {
    width: 100%;
    max-width: 520px;
    margin-inline: auto;
    padding: 1.2rem 1.05rem 1.35rem;
    border-radius: 16px;
  }
  body.lawtopia-platform .hx-auth__form .fgrid {
    grid-template-columns: 1fr;
  }
  body.lawtopia-platform .hx-auth__title,
  body.lawtopia-platform .hx-auth__sub,
  body.lawtopia-platform .hx-auth__meta {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 640px) {
  body.lawtopia-platform.hx-auth-body {
    --lt-auth-nav: 64px;
  }
  body.lawtopia-platform .hx-auth__title {
    font-size: clamp(1.55rem, 6.5vw, 1.95rem);
  }
  body.lawtopia-platform .hx-auth__sub {
    margin-bottom: 1.1rem;
    font-size: .92rem;
  }
}

@media (max-width: 480px) {
  body.lawtopia-platform .hx-auth__meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Landscape phones — still show full image, slightly constrained width */
@media (max-height: 480px) and (orientation: landscape) {
  body.lawtopia-platform .hx-auth__wall,
  body.lawtopia-platform .hx-auth__wall--photo {
    max-width: min(100%, 280px);
    margin-inline: auto;
  }
  body.lawtopia-platform .hx-auth__panel {
    padding: 1rem;
  }
}
