:root {
  color-scheme: light;
  --brand-ink: #111111;
  --brand-accent: #988c87;
  --paper: #f6f4f1;
  --surface: #ffffff;
  --text: #181716;
  --text-muted: #5e5955;
  --line: #dedad6;
  --line-strong: #c9c4c0;
  --danger: #9d3434;
  --danger-soft: #f9eded;

  --duration-micro: 80ms;
  --duration-exit: 150ms;
  --duration-default: 250ms;
  --duration-panel: 400ms;
  --duration-confirm: 500ms;
  --ease-smooth-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: ease-in-out;

  font-family: Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--brand-ink);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--brand-ink);
  background: var(--surface);
  transform: translateY(-160%);
  transition: transform var(--duration-default) var(--ease-smooth-out);
}

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

.login-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: minmax(360px, 42vw) minmax(520px, 1fr);
}

.brand-stage {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  padding: 52px clamp(40px, 4vw, 72px);
  color: #ffffff;
  background: var(--brand-ink);
}

.brand-logo {
  position: relative;
  z-index: 1;
  display: block;
  width: 160px;
  height: auto;
}

.environment-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  min-height: 26px;
  margin-top: 18px;
  padding: 0 10px;
  align-items: center;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 999px;
  color: rgb(255 255 255 / 62%);
  background: rgb(255 255 255 / 5%);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 24px;
  text-transform: uppercase;
}

.environment-badge--light {
  margin: 0;
  border-color: var(--line);
  color: var(--text-muted);
  background: var(--surface);
}

.brand-symbol {
  --reveal-opacity: 0.07;
  position: absolute;
  width: clamp(280px, 27vw, 420px);
  height: auto;
  right: clamp(38px, 5vw, 78px);
  bottom: clamp(72px, 8vh, 126px);
  opacity: 0.07;
}

.login-panel {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-rows: minmax(0, 1fr) auto;
  background: var(--paper);
}

.mobile-header {
  display: none;
}

.login-panel__content {
  width: min(420px, calc(100% - 72px));
  margin: 0 auto;
  align-self: center;
  padding: 32px 0;
}

.login-heading {
  margin-bottom: 30px;
}

.login-heading h1 {
  margin: 0;
  font-size: clamp(42px, 3vw, 44px);
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.16;
}

.login-form {
  display: grid;
  gap: 24px;
}

.field label {
  display: inline-block;
  margin-bottom: 10px;
  color: #34312f;
  font-size: 13px;
  font-weight: 650;
  line-height: 18px;
}

.field__forgot {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  margin-right: -8px;
  padding: 0 8px;
  align-items: center;
  justify-self: end;
  border-radius: 8px;
  color: #6f6762;
  font-size: 12px;
  font-weight: 650;
  line-height: 18px;
  text-decoration: none;
  text-underline-offset: 3px;
}

.field__forgot[aria-disabled="true"] {
  cursor: default;
  opacity: 0.72;
}

.field__forgot[aria-disabled="true"]:hover {
  text-decoration: none;
}

.field__forgot:hover {
  text-decoration: underline;
}

.field__forgot:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

.field__control {
  position: relative;
}

.field input {
  width: 100%;
  height: 60px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  color: var(--text);
  background: var(--surface);
  font-size: 16px;
  transition:
    border-color var(--duration-default) var(--ease-smooth-out),
    box-shadow var(--duration-default) var(--ease-smooth-out),
    background-color var(--duration-default) var(--ease-smooth-out);
}

.field[data-field="password"] input {
  padding-right: 104px;
}

.field input::placeholder {
  color: #756f6b;
}

.field input:hover {
  border-color: var(--line-strong);
}

.field input:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 4px rgb(152 140 135 / 14%);
}

.field.is-invalid input {
  border-color: var(--danger);
  background: var(--danger-soft);
  box-shadow: 0 0 0 4px rgb(157 52 52 / 8%);
  animation: field-shake 300ms var(--ease-smooth-out);
}

.field__error {
  display: block;
  margin: 7px 2px 0;
  color: var(--danger);
  font-size: 11px;
  line-height: 1.4;
}

.field__error:empty {
  display: none;
}

.field__support {
  display: grid;
  min-height: 44px;
  align-items: start;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.field__support .field__error {
  margin-top: 12px;
}

.password-toggle {
  position: absolute;
  height: 44px;
  top: 50%;
  right: 8px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  color: #6f6762;
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  transform: translateY(-50%);
  cursor: pointer;
  transition:
    color var(--duration-exit) var(--ease-smooth-out),
    background-color var(--duration-exit) var(--ease-smooth-out);
}

.password-toggle:hover {
  color: var(--brand-ink);
  background: #eeebe8;
}

.password-toggle:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 1px;
}

.checkbox {
  position: relative;
  display: inline-flex;
  width: fit-content;
  min-height: 44px;
  padding: 10px 2px;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  cursor: pointer;
  user-select: none;
}

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

.checkbox__control {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  border: 1px solid #aaa39e;
  border-radius: 5px;
  background: var(--surface);
  pointer-events: none;
  transition:
    border-color var(--duration-exit) var(--ease-smooth-out),
    box-shadow var(--duration-exit) var(--ease-smooth-out),
    background-color var(--duration-exit) var(--ease-smooth-out),
    transform var(--duration-exit) var(--ease-smooth-out);
}

.checkbox__control img {
  display: block;
  width: 14px;
  height: 14px;
  opacity: 0;
  filter: invert(1);
  transform: scale(0.72);
  transition:
    opacity var(--duration-exit) var(--ease-smooth-out),
    transform var(--duration-exit) var(--ease-smooth-out);
}

.checkbox:hover .checkbox__control {
  border-color: var(--brand-accent);
}

.checkbox input:focus-visible + .checkbox__control {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 4px rgb(152 140 135 / 18%);
}

.checkbox input:checked + .checkbox__control {
  border-color: var(--brand-ink);
  background: var(--brand-ink);
}

.checkbox input:checked + .checkbox__control img {
  opacity: 1;
  transform: scale(1);
}

.checkbox:active .checkbox__control {
  transform: scale(0.94);
  transition-duration: var(--duration-micro);
}

.submit-button {
  position: relative;
  display: flex;
  width: 100%;
  height: 60px;
  padding: 0 22px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--brand-ink);
  border-radius: 14px;
  color: #ffffff;
  background: var(--brand-ink);
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  transition:
    transform var(--duration-default) var(--ease-smooth-out),
    box-shadow var(--duration-default) var(--ease-smooth-out),
    background-color var(--duration-default) var(--ease-smooth-out);
}

.submit-button:hover {
  background: #242322;
  box-shadow: 0 14px 34px rgb(17 17 17 / 16%);
  transform: translateY(-2px);
}

.submit-button:active {
  box-shadow: 0 6px 18px rgb(17 17 17 / 12%);
  transform: translateY(0) scale(0.99);
  transition-duration: var(--duration-micro);
}

.submit-button:focus-visible {
  outline: 3px solid rgb(152 140 135 / 35%);
  outline-offset: 3px;
}

.submit-button:disabled {
  cursor: wait;
}

.submit-button__label {
  transition:
    opacity var(--duration-exit) var(--ease-in-out),
    transform var(--duration-exit) var(--ease-in-out),
    filter var(--duration-exit) var(--ease-in-out);
}

.submit-button__spinner {
  position: absolute;
  width: 19px;
  height: 19px;
  top: 50%;
  left: 50%;
  border: 2px solid rgb(255 255 255 / 26%);
  border-top-color: #ffffff;
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.7);
}

.submit-button.is-loading .submit-button__label {
  opacity: 0;
  filter: blur(2px);
  transform: translateY(-4px);
}

.submit-button.is-loading .submit-button__spinner {
  opacity: 1;
  animation: spinner 700ms linear infinite;
}

.form-notice {
  margin-top: -14px;
  padding: 13px 15px;
  border: 1px solid #d8d2ce;
  border-radius: 11px;
  color: #5e5753;
  background: #efebe8;
  font-size: 11px;
  line-height: 1.5;
  animation: notice-in var(--duration-panel) var(--ease-smooth-out) both;
}

.form-notice:not([hidden]) {
  border-color: rgb(157 52 52 / 18%);
  color: var(--danger);
  background: var(--danger-soft);
}

.dashboard-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
}

.dashboard-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: 260px minmax(0, 1fr);
}

.dashboard-sidebar {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 34px 28px 28px;
  flex-direction: column;
  color: #ffffff;
  background: var(--brand-ink);
}

.dashboard-brand {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.dashboard-brand img {
  width: 128px;
  height: auto;
}

.dashboard-brand .environment-badge {
  min-height: 22px;
  margin: 0;
  padding: 0 8px;
  font-size: 8px;
  line-height: 20px;
}

.dashboard-nav {
  display: grid;
  margin-top: 76px;
  gap: 6px;
}

.dashboard-nav a,
.dashboard-nav span {
  display: flex;
  min-height: 44px;
  padding: 0 14px;
  align-items: center;
  border-radius: 10px;
  color: rgb(255 255 255 / 46%);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.dashboard-nav a.is-active {
  color: #ffffff;
  background: rgb(255 255 255 / 8%);
}

.dashboard-nav span[aria-disabled="true"] {
  cursor: not-allowed;
}

.dashboard-logout {
  min-height: 44px;
  margin-top: auto;
  padding: 0 14px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 10px;
  color: rgb(255 255 255 / 68%);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition:
    color var(--duration-exit) var(--ease-smooth-out),
    background-color var(--duration-exit) var(--ease-smooth-out);
}

.dashboard-logout:hover {
  color: #ffffff;
  background: rgb(255 255 255 / 7%);
}

.dashboard-main {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(32px, 5vw, 72px);
}

.dashboard-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}

.dashboard-eyebrow {
  display: block;
  margin-bottom: 10px;
  color: #6f6863;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.14em;
  line-height: 16px;
  text-transform: uppercase;
}

.dashboard-topbar h1,
.password-card h2 {
  margin: 0;
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 650;
  letter-spacing: -0.05em;
  line-height: 1.04;
}

.dashboard-user {
  display: grid;
  padding-top: 2px;
  justify-items: end;
  gap: 3px;
  font-size: 12px;
}

.dashboard-user span {
  color: var(--text-muted);
}

.dashboard-workspace {
  margin-top: clamp(52px, 8vw, 104px);
}

.status-card {
  display: flex;
  min-height: 84px;
  padding: 22px 24px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.status-card__label {
  color: var(--text-muted);
  font-size: 13px;
}

.status-card strong {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5f7d63;
  box-shadow: 0 0 0 5px rgb(95 125 99 / 12%);
}

.workspace-placeholder {
  display: grid;
  min-height: 320px;
  margin-top: 18px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  color: #98918c;
  background: rgb(255 255 255 / 42%);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.password-card {
  width: min(520px, 100%);
  margin-top: clamp(52px, 8vw, 90px);
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 24px 72px rgb(17 17 17 / 7%);
}

.password-card h2 {
  font-size: clamp(30px, 3vw, 38px);
}

.password-form {
  display: grid;
  margin-top: 34px;
  gap: 18px;
}

.password-form label {
  display: grid;
  gap: 9px;
  color: #34312f;
  font-size: 12px;
  font-weight: 650;
}

.password-form input {
  width: 100%;
  height: 56px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
  background: #ffffff;
  transition:
    border-color var(--duration-default) var(--ease-smooth-out),
    box-shadow var(--duration-default) var(--ease-smooth-out);
}

.password-form input:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 4px rgb(152 140 135 / 14%);
}

.password-form__notice {
  min-height: 20px;
  color: var(--danger);
  font-size: 12px;
  line-height: 20px;
}

.error-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  color: #ffffff;
  background: var(--brand-ink);
}

.error-page main {
  display: grid;
  padding: 32px;
  justify-items: center;
  gap: 24px;
  text-align: center;
}

.error-page h1 {
  margin: 12px 0 0;
  font-size: clamp(30px, 6vw, 56px);
  letter-spacing: -0.045em;
}

.error-page a {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 10px;
  line-height: 42px;
  text-decoration: none;
}

@media (max-width: 780px) {
  .dashboard-shell {
    display: block;
  }

  .dashboard-sidebar {
    min-height: auto;
    padding: 20px 22px;
    flex-direction: row;
    align-items: center;
  }

  .dashboard-nav {
    display: none;
  }

  .dashboard-logout {
    width: auto;
    margin: 0 0 0 auto;
    padding: 0 13px;
    text-align: center;
  }

  .dashboard-main {
    padding: 36px 22px 52px;
  }

  .dashboard-topbar {
    display: grid;
  }

  .dashboard-user {
    justify-items: start;
  }

  .workspace-placeholder {
    min-height: 240px;
  }
}

.form-notice:not([hidden]) {
  display: block;
}

.login-panel__footer {
  display: flex;
  width: 100%;
  padding: 30px clamp(38px, 4vw, 56px) 32px;
  align-items: center;
  justify-content: space-between;
  color: #8c8681;
  font-size: 11px;
}

.login-panel__footer nav {
  display: flex;
  gap: 24px;
}

.login-panel__footer a {
  text-decoration: none;
}

.login-panel__footer a:hover {
  color: var(--text);
}

.reveal {
  --reveal-opacity: 1;
  opacity: 0;
  filter: blur(3px);
  transform: translateY(12px);
  animation: reveal-in var(--duration-confirm) var(--ease-smooth-out) forwards;
}

.brand-symbol.reveal {
  --reveal-opacity: 0.07;
}

.reveal--1 {
  animation-delay: 40ms;
}

.reveal--2 {
  animation-delay: 80ms;
}

.reveal--3 {
  animation-delay: 120ms;
}

.reveal--4 {
  animation-delay: 160ms;
}

@keyframes reveal-in {
  to {
    opacity: var(--reveal-opacity);
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes spinner {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes field-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  30% {
    transform: translateX(-6px);
  }
  60% {
    transform: translateX(4px);
  }
  80% {
    transform: translateX(-2px);
  }
}

@keyframes notice-in {
  from {
    opacity: 0;
    filter: blur(2px);
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .login-shell {
    grid-template-columns: minmax(360px, 40vw) minmax(500px, 1fr);
  }

  .brand-stage {
    padding-right: 44px;
    padding-left: 44px;
  }

  .brand-symbol {
    right: 36px;
  }

  .login-panel__content {
    width: min(400px, calc(100% - 64px));
  }
}

@media (max-width: 880px) {
  html {
    background: var(--paper);
  }

  .login-shell {
    display: block;
  }

  .brand-stage {
    display: none;
  }

  .login-panel {
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .mobile-header {
    display: flex;
    padding: 26px 28px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
  }

  .mobile-logo {
    width: 128px;
    height: auto;
  }

  .login-panel__content {
    width: min(420px, calc(100% - 56px));
    padding: 32px 0;
  }
}

@media (max-width: 520px) {
  .mobile-header {
    padding: 22px 20px;
  }

  .login-panel__content {
    width: calc(100% - 40px);
    padding: 28px 0;
  }

  .login-heading {
    margin-bottom: 28px;
  }

  .login-heading h1 {
    font-size: 42px;
  }

  .login-form {
    gap: 26px;
  }

  .login-panel__footer {
    padding: 24px 20px;
  }
}

@media (max-height: 740px) and (min-width: 881px) {
  .brand-stage {
    padding-top: 32px;
    padding-bottom: 32px;
  }

  .brand-symbol {
    width: clamp(240px, 24vw, 340px);
    bottom: 38px;
  }

  .login-panel__content {
    padding: 24px 0;
  }

  .login-form {
    gap: 22px;
  }

  .login-heading {
    margin-bottom: 26px;
  }
}

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