:root {
  color-scheme: dark;
  --page-bg: #080808;
  --text: #f5f5f5;
  --muted: rgba(245, 245, 245, 0.72);
  --border: rgba(255, 255, 255, 0.13);
  --surface: rgba(15, 15, 15, 0.76);
  --surface-soft: rgba(255, 255, 255, 0.07);
  --error: #ff8f8f;
  --success: #b8f5c8;
  --header-height: 84px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--page-bg);
  color: var(--text);
  font-family: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: #000;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.68);
  font-family: Montserrat, Manrope, sans-serif;
}

.site-header::after {
  position: absolute;
  z-index: -1;
  top: 100%;
  right: 0;
  left: 0;
  height: 92px;
  background: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.8) 28%, transparent 100%);
  content: "";
  pointer-events: none;
}

.site-header-inner {
  width: min(100%, 1440px);
  height: 100%;
  margin-inline: auto;
  padding: 10px clamp(18px, 3vw, 46px);
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(410px, 1.8fr) auto;
  align-items: center;
  gap: clamp(20px, 3vw, 52px);
}

.site-header-brand {
  width: min(100%, 208px);
}

.site-header-brand img {
  width: 100%;
  height: auto;
}

.site-desktop-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(18px, 2.2vw, 34px);
  color: #fff;
  font-size: 0.93rem;
  font-weight: 500;
}

.site-desktop-nav a,
.site-desktop-nav span,
.site-footer-column > a:not(.site-footer-button),
.site-footer-column > span {
  position: relative;
}

.site-desktop-nav a::after {
  position: absolute;
  right: 0;
  bottom: -7px;
  left: 0;
  height: 1px;
  transform: scaleX(0);
  transform-origin: center;
  background: #fff;
  content: "";
  transition: transform 160ms ease;
}

.site-desktop-nav a:hover::after,
.site-desktop-nav a:focus-visible::after {
  transform: scaleX(1);
}

[aria-disabled="true"] {
  color: rgba(255, 255, 255, 0.55);
  cursor: default;
}

.site-header-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.site-header-button {
  min-height: 44px;
  padding: 10px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #fff;
  border-radius: 5px;
  background: #000;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background 160ms ease, color 160ms ease;
}

.site-header-button:hover,
.site-header-button:focus-visible {
  background: #fff;
  color: #000;
}

.site-header-button svg,
.site-footer-button svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: currentColor;
}

.site-mobile-menu {
  display: none;
}

.auth-screen {
  position: relative;
  display: grid;
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100dvh - var(--header-height));
  place-items: center;
  overflow: hidden;
  padding: clamp(28px, 5vw, 64px);
}

.auth-background-video,
.auth-screen-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.auth-background-video {
  z-index: 0;
  max-width: none;
  object-fit: cover;
  object-position: 50% 36%;
  filter: saturate(0.72) contrast(1.08);
}

.auth-screen-overlay {
  z-index: 1;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.08), transparent 42%),
    linear-gradient(180deg, #000 0%, rgba(5, 5, 5, 0.54) 16%, rgba(5, 5, 5, 0.7) 72%, #000 100%);
}

.auth-shell {
  position: relative;
  z-index: 30;
  width: min(100%, 390px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: transparent;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.auth-shell::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgb(18, 18, 18), rgb(10, 10, 10));
  content: "";
  opacity: 0.7;
  pointer-events: none;
}

.brand-link {
  display: block;
  width: 220px;
  max-width: 72%;
  margin: 0 auto -2px;
}

.brand-logo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.auth-heading {
  display: grid;
  gap: 7px;
  text-align: center;
}

.auth-heading h1,
.auth-heading p {
  margin: 0;
}

.auth-heading h1 {
  font-size: clamp(1.65rem, 5vw, 1.95rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 650;
}

.auth-heading p {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 6px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.07);
}

.auth-tab {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(245, 245, 245, 0.66);
  cursor: pointer;
  font-weight: 600;
}

.auth-tab.is-active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-group {
  display: grid;
  gap: 7px;
}

.field-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(245, 245, 245, 0.78);
}

.field-group input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 14px;
  background: rgba(4, 4, 4, 0.68);
  color: #fff;
  outline: none;
  appearance: none;
}

.field-group input::placeholder {
  color: rgba(245, 245, 245, 0.42);
}

.field-group input:focus {
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.field-group input:disabled {
  color: rgba(245, 245, 245, 0.62);
  cursor: default;
}

.password-control {
  position: relative;
}

.password-control input {
  padding-right: 66px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  min-width: 49px;
  min-height: 36px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(245, 245, 245, 0.68);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
}

.form-message {
  min-height: 0;
  margin: 0;
  color: var(--error);
  font-size: 0.83rem;
  line-height: 1.45;
  text-align: center;
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(245, 245, 245, 0.78);
  cursor: pointer;
  font-size: 0.82rem;
  line-height: 1.35;
}

.remember-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 0;
  accent-color: #fff;
}

.form-message:empty {
  display: none;
}

.form-message.is-success {
  color: var(--success);
}

.primary-action,
.secondary-action {
  width: 100%;
  min-height: 50px;
  border-radius: 10px;
  padding: 13px 16px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 140ms ease, background 140ms ease;
}

.primary-action {
  border: 1px solid rgba(255, 255, 255, 0.86);
  background: linear-gradient(135deg, #fff, #dedede);
  color: #060606;
}

.secondary-action {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.primary-action:active,
.secondary-action:active {
  transform: translateY(1px) scale(0.997);
}

.text-action,
.legal-link {
  border: 0;
  background: transparent;
  color: rgba(245, 245, 245, 0.68);
  cursor: pointer;
  text-decoration: none;
}

.text-action {
  align-self: center;
  padding: 4px 8px;
  font-size: 0.84rem;
  font-weight: 600;
}

.dashboard-preview-link {
  width: fit-content;
  margin: 17px auto 13px;
  color: rgba(255, 255, 255, 0.84);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.dashboard-preview-link span {
  transition: transform 160ms ease;
}

.dashboard-preview-link:hover span,
.dashboard-preview-link:focus-visible span {
  transform: translateX(3px);
}

.legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: rgba(245, 245, 245, 0.44);
  font-size: 0.78rem;
}

.legal-link {
  padding: 3px 0;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-tab:focus-visible,
.password-toggle:focus-visible,
.primary-action:focus-visible,
.secondary-action:focus-visible,
.text-action:focus-visible,
.legal-link:focus-visible,
.brand-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.is-hidden {
  display: none !important;
}

.site-footer {
  position: relative;
  z-index: 20;
  padding: 60px clamp(28px, 6vw, 90px) 0;
  background: #000;
  color: #fff;
  font-family: Montserrat, Manrope, sans-serif;
}

.site-footer::before {
  position: absolute;
  z-index: -1;
  right: 0;
  bottom: 100%;
  left: 0;
  height: 130px;
  background: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0.82) 34%, transparent 100%);
  content: "";
  pointer-events: none;
}

.site-footer-grid {
  width: min(100%, 1340px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.15fr repeat(3, 1fr);
  gap: clamp(32px, 5vw, 78px);
}

.site-footer-grid section {
  min-width: 0;
}

.site-footer-brand > a {
  width: 150px;
  display: block;
}

.site-footer-brand img {
  width: 100%;
  height: auto;
}

.site-footer-brand p {
  margin: 20px 0 22px;
  font-size: 0.92rem;
  font-style: italic;
  line-height: 1.55;
}

.site-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.site-socials span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
}

.site-socials svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.site-footer-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.site-footer-column h2 {
  margin: 0 0 8px;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.2;
}

.site-footer-column > a:not(.site-footer-button),
.site-footer-column > span {
  font-size: 1rem;
  line-height: 1.45;
}

.site-footer-column > a:not(.site-footer-button):hover,
.site-footer-column > a:not(.site-footer-button):focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-footer-button {
  min-height: 52px;
  margin-bottom: 4px;
  padding: 13px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid #fff;
  border-radius: 9px;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease;
}

.site-footer-button:hover,
.site-footer-button:focus-visible {
  background: #fff;
  color: #000;
}

.site-footer-bottom {
  width: min(100%, 1340px);
  margin: 54px auto 0;
  padding: 22px 0 28px;
  display: flex;
  justify-content: center;
  gap: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.84rem;
}

.site-footer-bottom a {
  padding-left: 22px;
  border-left: 2px solid #fff;
}

.site-mobile-dock {
  display: none;
}

.site-header a:focus-visible,
.site-mobile-menu summary:focus-visible,
.site-footer a:focus-visible,
.site-mobile-dock a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

@media (max-width: 1100px) {
  .site-header-inner {
    grid-template-columns: minmax(150px, 0.65fr) minmax(350px, 1.6fr) auto;
    gap: 20px;
    padding-inline: 20px;
  }

  .site-desktop-nav {
    gap: 16px;
    font-size: 0.78rem;
  }

  .site-header-button {
    padding-inline: 10px;
    font-size: 0.72rem;
  }

  .site-header-button svg {
    display: none;
  }
}

@media (max-width: 640px) {
  :root {
    --header-height: 72px;
  }

  .site-header-inner {
    padding: 9px 10px;
    grid-template-columns: minmax(88px, 1fr) 42px 80px 88px;
    gap: 6px;
  }

  .site-header-brand {
    width: 100%;
    max-width: 128px;
  }

  .site-desktop-nav {
    display: none;
  }

  .site-mobile-menu {
    position: relative;
    display: block;
  }

  .site-mobile-menu summary {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    list-style: none;
  }

  .site-mobile-menu summary::-webkit-details-marker {
    display: none;
  }

  .site-mobile-menu summary svg {
    width: 22px;
    height: 18px;
    display: block;
    fill: none;
    stroke: #fff;
    stroke-linecap: round;
    stroke-width: 2;
  }

  .site-mobile-menu nav {
    position: fixed;
    top: var(--header-height);
    right: 10px;
    left: 10px;
    width: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.96);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  }

  .site-mobile-menu nav a,
  .site-mobile-menu nav span {
    padding: 12px 11px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 0.84rem;
  }

  .site-mobile-menu nav > :last-child {
    border-bottom: 0;
  }

  .site-header-actions {
    display: contents;
  }

  .site-header-button {
    min-height: 42px;
    padding: 7px 5px;
    font-size: 0.63rem;
    text-align: center;
  }

  .auth-screen {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100dvh - var(--header-height));
    padding: max(72px, env(safe-area-inset-top)) 24px max(30px, env(safe-area-inset-bottom));
  }

  .auth-background-video {
    object-position: 50% center;
  }

  .auth-screen-overlay {
    background:
      radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.08), transparent 42%),
      linear-gradient(180deg, #000 0%, rgba(5, 5, 5, 0.34) 18%, rgba(5, 5, 5, 0.72) 76%, #000 100%);
  }

  .auth-shell {
    width: 100%;
    max-width: 390px;
    margin-inline: auto;
    gap: 16px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .auth-shell::before {
    display: none;
  }

  .auth-heading h1 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .field-group > label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .brand-link {
    width: 220px;
    max-width: 70%;
  }

  .auth-form {
    position: relative;
    z-index: 0;
    gap: 11px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: transparent;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .auth-form::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgb(18, 18, 18), rgb(10, 10, 10));
    content: "";
    opacity: 0.7;
    pointer-events: none;
  }

  .site-footer {
    padding: 62px 24px 94px;
  }

  .site-footer-grid {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .site-footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .site-footer-brand > a {
    width: 132px;
  }

  .site-footer-bottom {
    margin-top: 46px;
    padding-bottom: 0;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
  }

  .site-footer-bottom a {
    padding: 0;
    border-left: 0;
  }

  .site-mobile-dock {
    position: fixed;
    z-index: 80;
    right: 0;
    bottom: 0;
    left: 0;
    min-height: 72px;
    padding: 8px max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: start;
    gap: 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.96);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.6);
    font-family: Montserrat, Manrope, sans-serif;
  }

  .site-mobile-dock > a,
  .site-mobile-dock > span {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #fff;
    text-align: center;
  }

  .site-mobile-dock > a > span,
  .site-mobile-dock > span > span {
    height: 22px;
    display: grid;
    place-items: center;
    font-size: 1rem;
    line-height: 1;
  }

  .site-mobile-dock small {
    font-size: 0.52rem;
    font-weight: 500;
    line-height: 1.2;
  }
}

@media (max-height: 720px) and (max-width: 640px) {
  .auth-screen {
    justify-content: center;
    overflow-y: auto;
    padding-top: max(24px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  .auth-shell {
    gap: 12px;
  }

  .brand-link {
    width: 180px;
  }

  .auth-heading {
    gap: 4px;
  }

  .auth-heading h1 {
    font-size: 1.5rem;
  }

  .auth-tabs button,
  .primary-action,
  .secondary-action,
  .field-group input {
    min-height: 44px;
  }

  .auth-form {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
