/* XGCast auth — new industrial minimal
   Auth-only primitives aligned with the public and private surfaces.
*/

/* FONTS ******************************************************** */

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/public/landing/GrgcKwrN6d3Uz8EwcLHZxwEfC4.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/public/landing/UjlFhCnUjxhNfep4oYBPqnEssyo.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 500;
}

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/public/landing/syRNPWzAMIrcJ3wIlPIP43KjQs.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 700;
}

/* TOKENS ******************************************************* */

:root {
  --auth-bg: #fefefe;
  --auth-surface: #ffffff;
  --auth-ink: #242428;
  --auth-muted: #6d6d6d;
  --auth-accent: #f57230;
  --auth-soft: color-mix(in srgb, var(--auth-bg) 96%, var(--auth-ink));
  --auth-line: color-mix(in srgb, var(--auth-ink) 9%, transparent);
  --auth-line-strong: color-mix(in srgb, var(--auth-ink) 14%, transparent);
  --auth-accent-soft: #fef5f1;

  --auth-font: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --auth-text: 0.9375rem;
  --auth-text-ui: 0.8125rem;

  --auth-max: 560px;
  --auth-shell-max: 1280px;
  --auth-content: 1180px;
  --auth-space: 16px;
  --auth-gutter: clamp(var(--auth-space), 2.5vw, calc(var(--auth-space) * 2));
  --auth-radius: 14px;
  --auth-radius-sm: 8px;
  --auth-header-height: 58px;
  --auth-control-height: 40px;
  --auth-transition: 220ms cubic-bezier(.19, 1, .22, 1);
  --auth-shadow: 0 1px 2px color-mix(in srgb, var(--auth-ink) 2.5%, transparent),
                 0 5px 14px color-mix(in srgb, var(--auth-ink) 2.5%, transparent);
}

/* BASE ********************************************************* */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--auth-bg);
}

body.auth-page {
  width: min(100%, var(--auth-shell-max));
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-inline: 1px solid var(--auth-line);
  background: var(--auth-bg);
  color: var(--auth-ink);
  font-family: var(--auth-font);
  font-size: var(--auth-text);
  font-weight: 400;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

button,
a,
input {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

h1,
p {
  margin: 0;
}

/* HEADER ******************************************************* */

.site-header,
.site-footer {
  background: var(--auth-bg);
}

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  min-height: var(--auth-header-height);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--auth-space);
  padding: 0 var(--auth-gutter);
  border-bottom: 1px solid var(--auth-line);
  background: color-mix(in srgb, #fff 96%, transparent);
  backdrop-filter: blur(16px);
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: calc(var(--auth-space) * .5);
  color: var(--auth-ink);
  font-size: var(--auth-text-ui);
  font-weight: 500;
  letter-spacing: -.015em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  object-fit: cover;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--auth-ink) 12%, transparent);
}

.site-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--auth-space);
  color: var(--auth-muted);
  font-size: var(--auth-text-ui);
  font-weight: 500;
}

.site-nav a {
  text-decoration: none;
  transition: color var(--auth-transition);
}

.site-nav a[href]:hover,
.site-nav a[href]:focus-visible {
  color: var(--auth-ink);
}

.site-nav a[aria-hidden="true"] {
  color: var(--auth-line-strong);
  pointer-events: none;
}

.header-cta {
  white-space: nowrap;
}

.menu-button {
  width: 32px;
  height: 32px;
  display: none;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--auth-muted);
  cursor: pointer;
}

.menu-button:hover,
.menu-button:focus-visible {
  background: var(--auth-soft);
  color: var(--auth-ink);
}

.home-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--auth-space) * .5);
  padding: 0 var(--auth-space);
  border: 1px solid var(--auth-line-strong);
  border-radius: var(--auth-radius-sm);
  background: var(--auth-surface);
  color: var(--auth-ink);
  font-size: var(--auth-text-ui);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--auth-ink) 4%, transparent);
  transition: background var(--auth-transition), border-color var(--auth-transition), color var(--auth-transition), transform var(--auth-transition);
}

.home-button:hover,
.home-button:focus-visible {
  border-color: color-mix(in srgb, var(--auth-ink) 24%, transparent);
  background: var(--auth-soft);
}

.home-button:active {
  transform: translateY(1px);
}

.header-cta {
  border-color: var(--auth-accent);
  background: var(--auth-accent-soft);
  color: var(--auth-accent);
}

.header-cta:hover,
.header-cta:focus-visible {
  border-color: var(--auth-accent);
  background: color-mix(in srgb, var(--auth-accent) 11%, transparent);
  color: var(--auth-accent);
}

.lucide,
.ui-icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* AUTH COMPOSITION ********************************************* */

.home-container {
  width: min(100%, var(--auth-content));
  margin-inline: auto;
  padding-inline: var(--auth-gutter);
}

.auth-skip {
  position: absolute;
  z-index: 60;
  top: var(--auth-space);
  left: var(--auth-space);
  padding: calc(var(--auth-space) * .5) var(--auth-space);
  border-radius: var(--auth-radius-sm);
  background: var(--auth-ink);
  color: var(--auth-surface);
  font-size: var(--auth-text-ui);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--auth-transition);
}

.auth-skip:focus {
  transform: translateY(0);
}

.auth-main {
  width: min(calc(100% - var(--auth-space) - var(--auth-space)), var(--auth-max));
  min-width: 0;
  align-self: center;
  margin-inline: auto;
  padding-block: calc(var(--auth-space) * 3) calc(var(--auth-space) * 4);
}

.auth-header {
  margin-bottom: calc(var(--auth-space) * 1.5);
  text-align: center;
}

.auth-title {
  color: var(--auth-ink);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 600;
  line-height: 1.08;
}

.auth-subtitle,
.auth-note,
.auth-link {
  color: var(--auth-muted);
}

.auth-subtitle {
  max-width: 48ch;
  margin: calc(var(--auth-space) * .5) auto 0;
  font-size: var(--auth-text);
  line-height: 1.55;
}

.auth-subtitle:empty {
  display: none;
}

.auth-panel {
  overflow: hidden;
  border: 1px solid var(--auth-line);
  border-radius: var(--auth-radius);
  background: var(--auth-surface);
  box-shadow: var(--auth-shadow);
}

.auth-panel-inner {
  padding: clamp(calc(var(--auth-space) * 1.25), 5vw, calc(var(--auth-space) * 2));
}

.auth-form,
.auth-section {
  display: grid;
  gap: var(--auth-space);
}

.auth-field {
  min-width: 0;
  display: grid;
  gap: calc(var(--auth-space) * .5);
}

.auth-label,
.auth-input,
.auth-error,
.auth-button,
.auth-link,
.auth-link-button,
.auth-note,
.auth-alert {
  font-size: var(--auth-text-ui);
}

.auth-label {
  color: var(--auth-muted);
  font-weight: 500;
}

.auth-input {
  width: 100%;
  min-height: var(--auth-control-height);
  padding: 0 calc(var(--auth-space) * .75);
  border: 1px solid var(--auth-line-strong);
  border-radius: var(--auth-radius-sm);
  outline: none;
  background: var(--auth-surface);
  color: var(--auth-ink);
  transition: border-color var(--auth-transition), box-shadow var(--auth-transition);
}

.auth-input::placeholder {
  color: var(--auth-muted);
  opacity: .72;
}

.auth-input:focus {
  border-color: color-mix(in srgb, var(--auth-accent) 55%, transparent);
  box-shadow: 0 0 0 3px var(--auth-accent-soft);
}

.auth-input[aria-invalid="true"] {
  border-color: color-mix(in srgb, var(--auth-accent) 50%, transparent);
}

.auth-error {
  color: var(--auth-accent);
}

.auth-divider {
  width: 100%;
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--auth-line);
}

.auth-button {
  width: 100%;
  min-height: var(--auth-control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--auth-space);
  border: 1px solid var(--auth-accent);
  border-radius: var(--auth-radius-sm);
  background: var(--auth-accent-soft);
  color: var(--auth-accent);
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--auth-ink) 4%, transparent);
  transition: background var(--auth-transition), border-color var(--auth-transition), color var(--auth-transition), transform var(--auth-transition), box-shadow var(--auth-transition);
}

.auth-button:hover,
.auth-button:focus-visible {
  background: color-mix(in srgb, var(--auth-accent) 11%, transparent);
}

.auth-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--auth-accent-soft);
}

.auth-button:active {
  transform: translateY(1px);
}

.auth-button-secondary {
  border-color: var(--auth-line-strong);
  background: var(--auth-surface);
  color: var(--auth-ink);
}

.auth-button-secondary:hover,
.auth-button-secondary:focus-visible {
  border-color: color-mix(in srgb, var(--auth-ink) 24%, transparent);
  background: var(--auth-soft);
}

.auth-actions {
  display: grid;
  justify-items: center;
  gap: calc(var(--auth-space) * .5);
  margin-top: var(--auth-space);
  text-align: center;
}

.auth-link,
.auth-link-button {
  padding: 0;
  border: 0;
  background: transparent;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--auth-transition);
}

.auth-link:hover,
.auth-link:focus-visible,
.auth-link-button:hover,
.auth-link-button:focus-visible {
  color: var(--auth-accent);
}

.auth-link:focus-visible,
.auth-link-button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--auth-accent) 35%, transparent);
  outline-offset: 3px;
}

.auth-grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--auth-space);
}

.auth-note {
  margin: 0;
  line-height: 1.55;
}

.auth-panel-inner > .auth-note {
  margin-bottom: var(--auth-space);
}

.auth-flashes {
  position: fixed;
  z-index: 40;
  top: calc(var(--auth-header-height) + var(--auth-space));
  left: 50%;
  width: min(calc(100% - var(--auth-space) - var(--auth-space)), var(--auth-max));
  display: grid;
  gap: calc(var(--auth-space) * .5);
  transform: translateX(-50%);
}

.auth-alert {
  padding: calc(var(--auth-space) * .75) var(--auth-space);
  border: 1px solid var(--auth-line);
  border-radius: var(--auth-radius-sm);
  background: var(--auth-surface);
  color: var(--auth-muted);
  box-shadow: var(--auth-shadow);
}

.auth-alert-danger {
  border-color: color-mix(in srgb, var(--auth-accent) 50%, transparent);
  color: var(--auth-accent);
}

/* ADMIN ******************************************************** */

.auth-main:is(.admin-companies, .admin-blogs) {
  --auth-max: var(--auth-content);
}

.admin-companies .auth-panel + .auth-panel {
  margin-block-start: calc(var(--auth-space) * 1.5);
}

:is(.admin-companies, .admin-blogs) .table-scroll {
  overflow-x: auto;
}

:is(.admin-companies, .admin-blogs) table {
  width: 100%;
  border-collapse: collapse;
}

:is(.admin-companies, .admin-blogs) :is(th, td) {
  padding: calc(var(--auth-space) * .5);
  text-align: start;
  vertical-align: top;
}

:is(.admin-companies, .admin-blogs) :is(th, td):not(:nth-child(2)) {
  width: 1%;
  white-space: nowrap;
}

:is(.admin-companies, .admin-blogs) td:nth-child(2) {
  overflow-wrap: anywhere;
}

:is(.admin-companies, .admin-blogs) :is(input, select).auth-input {
  height: var(--auth-control-height);
  min-width: 0;
  font-family: inherit;
  line-height: inherit;
}

.admin-blogs textarea.auth-input {
  padding-block: calc(var(--auth-space) * .5);
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
}

/* FOOTER ******************************************************* */

.site-footer {
  padding: calc(var(--auth-space) * 2) var(--auth-gutter);
  border-top: 1px solid var(--auth-line);
  color: var(--auth-muted);
  font-size: var(--auth-text-ui);
}

.footer-grid {
  width: min(100%, var(--auth-content));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--auth-space);
  padding-inline: 0;
}

.site-footer nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--auth-space);
}

.site-footer a {
  text-decoration: none;
  transition: color var(--auth-transition);
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--auth-ink);
}

.site-footer span:last-child {
  text-align: right;
}

/* RESPONSIVE *************************************************** */

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 1px);
    left: var(--auth-gutter);
    right: var(--auth-gutter);
    display: none;
    align-items: stretch;
    padding: calc(var(--auth-space) * .5);
    border: 1px solid var(--auth-line-strong);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 46px color-mix(in srgb, var(--auth-ink) 12%, transparent);
  }

  .site-header.nav-open .site-nav {
    display: grid;
  }

  .site-nav a {
    min-height: 38px;
    display: flex;
    align-items: center;
    padding: 0 calc(var(--auth-space) * .75);
    border-radius: 7px;
  }

  .site-nav a[href]:hover,
  .site-nav a[href]:focus-visible {
    background: var(--auth-soft);
  }

  .site-nav a[aria-hidden="true"] {
    display: none;
  }

  .menu-button {
    display: grid;
  }
}

@media (max-width: 700px) {
  body.auth-page {
    border-inline: 0;
  }

  .header-cta {
    display: none;
  }

  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .auth-grid-two {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .site-footer nav {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .site-footer span:last-child {
    text-align: left;
  }
}

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

  .site-nav a,
  .home-button,
  .auth-skip,
  .auth-input,
  .auth-button,
  .auth-link,
  .auth-link-button,
  .site-footer a {
    transition: none;
  }
}
