:root {
  color-scheme: light;
  --login-accent: #f6821f;
  --login-accent-hover: #dc6d12;
  --login-brand: #17231e;
  --login-brand-soft: #21332b;
  --login-surface: #f7f8f6;
  --login-panel: #ffffff;
  --login-text: #17201c;
  --login-muted: #6b746f;
  --login-border: #dfe4e1;
  --login-danger: #bf3535;
  --login-danger-bg: #fff3f2;
  --login-success: #6ecb9a;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  letter-spacing: 0;
}

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

body {
  min-height: 100dvh;
  color: var(--login-text);
  background: var(--login-surface);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(390px, 42%) minmax(0, 1fr);
  min-height: 100dvh;
}

.brand-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  overflow: hidden;
  padding: 40px clamp(40px, 5vw, 76px) 32px;
  color: #f7faf8;
  background: var(--login-brand);
}

.brand-pane::before,
.brand-pane::after {
  position: absolute;
  content: '';
  pointer-events: none;
}

.brand-pane::before {
  top: 0;
  right: 58px;
  bottom: 0;
  width: 1px;
  background: rgb(255 255 255 / 7%);
}

.brand-pane::after {
  right: 0;
  bottom: 88px;
  left: 0;
  height: 1px;
  background: rgb(255 255 255 / 7%);
}

.brand-mark,
.mobile-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 700;
}

.brand-logo-wrap {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgb(0 0 0 / 15%);
}

.brand-logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.brand-content {
  position: relative;
  z-index: 1;
  width: min(100%, 500px);
  margin: auto 0;
  padding: 72px 0 64px;
}

.brand-kicker,
.login-kicker {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.brand-kicker {
  margin-bottom: 18px;
  color: var(--login-success);
}

.brand-content h1 {
  max-width: 460px;
  font-size: clamp(36px, 4.1vw, 58px);
  font-weight: 650;
  line-height: 1.14;
}

.brand-copy {
  margin-top: 18px;
  color: rgb(244 249 246 / 67%);
  font-size: 15px;
  line-height: 1.7;
}

.storage-visual {
  width: min(100%, 420px);
  margin-top: 48px;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 8px;
  background: rgb(255 255 255 / 4%);
  box-shadow: 0 24px 60px rgb(0 0 0 / 19%);
}

.storage-visual-head,
.storage-row {
  display: grid;
  align-items: center;
}

.storage-visual-head {
  grid-template-columns: 1fr auto;
  min-height: 54px;
  padding: 0 17px;
  border-bottom: 1px solid rgb(255 255 255 / 10%);
  font-size: 12px;
  font-weight: 600;
}

.storage-path,
.storage-status {
  display: flex;
  align-items: center;
}

.storage-path {
  gap: 8px;
}

.storage-root-icon {
  width: 13px;
  height: 10px;
  border: 1.5px solid #f5a45c;
  border-radius: 2px;
}

.storage-status {
  gap: 6px;
  color: rgb(244 249 246 / 55%);
  font-size: 10px;
}

.storage-status i,
.brand-footer-dot {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--login-success);
  box-shadow: 0 0 0 3px rgb(110 203 154 / 11%);
}

.storage-row {
  grid-template-columns: 26px minmax(70px, 1fr) 52px;
  gap: 12px;
  min-height: 48px;
  padding: 0 17px;
  border-bottom: 1px solid rgb(255 255 255 / 7%);
}

.storage-row:last-child {
  border-bottom: 0;
}

.storage-file {
  width: 19px;
  height: 22px;
  border: 1px solid rgb(255 255 255 / 25%);
  border-radius: 3px;
  background: rgb(255 255 255 / 7%);
}

.storage-file.folder {
  width: 22px;
  height: 16px;
  border-color: rgb(246 130 31 / 58%);
  background: rgb(246 130 31 / 12%);
}

.storage-file.image {
  border-color: rgb(110 203 154 / 48%);
  background: rgb(110 203 154 / 10%);
}

.storage-line,
.storage-meta {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: rgb(255 255 255 / 12%);
}

.storage-line.long {
  width: 78%;
}

.storage-line.medium {
  width: 55%;
}

.storage-meta {
  justify-self: end;
  width: 42px;
  background: rgb(255 255 255 / 8%);
}

.storage-meta.short {
  width: 30px;
}

.brand-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgb(244 249 246 / 48%);
  font-size: 11px;
}

.access-pane {
  position: relative;
  display: flex;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: 72px clamp(32px, 7vw, 112px);
  background: var(--login-surface);
}

.mobile-brand {
  display: none;
}

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

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

.login-kicker {
  margin-bottom: 13px;
  color: var(--login-accent);
}

.login-heading h2 {
  font-size: 30px;
  font-weight: 680;
  line-height: 1.25;
}

.login-heading > p:last-child {
  margin-top: 10px;
  color: var(--login-muted);
  font-size: 14px;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-field label {
  font-size: 13px;
  font-weight: 600;
}

.input-shell {
  position: relative;
  display: flex;
  height: 50px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--login-border);
  border-radius: 8px;
  background: var(--login-panel);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.input-shell:focus-within {
  border-color: var(--login-accent);
  box-shadow: 0 0 0 3px rgb(246 130 31 / 12%);
}

.input-shell > svg {
  width: 18px;
  height: 18px;
  margin-left: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: #8b948f;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.input-shell input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  padding: 0 14px 0 11px;
  color: var(--login-text);
  background: transparent;
  font-size: 14px;
}

.input-shell input::placeholder {
  color: #a2aaa6;
}

.password-toggle {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 auto;
  margin-right: 4px;
  border-radius: 6px;
  color: #808984;
  background: transparent;
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--login-text);
  background: #f1f3f1;
}

.password-toggle svg {
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle .eye-closed,
.password-toggle.is-visible .eye-open {
  display: none;
}

.password-toggle.is-visible .eye-closed {
  display: block;
}

.login-error {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  margin-top: -4px;
  padding: 10px 12px;
  border: 1px solid rgb(191 53 53 / 20%);
  border-radius: 8px;
  color: var(--login-danger);
  background: var(--login-danger-bg);
  font-size: 12px;
  line-height: 1.45;
}

.login-error[hidden] {
  display: none;
}

.login-error svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-submit {
  display: grid;
  grid-template-columns: 1fr auto;
  width: 100%;
  height: 50px;
  align-items: center;
  margin-top: 4px;
  padding: 0 16px 0 20px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--login-accent);
  box-shadow: 0 10px 24px rgb(246 130 31 / 19%);
  cursor: pointer;
  transition:
    background 150ms ease,
    transform 150ms ease,
    box-shadow 150ms ease;
}

.login-submit:hover:not(:disabled) {
  background: var(--login-accent-hover);
  box-shadow: 0 12px 28px rgb(220 109 18 / 23%);
  transform: translateY(-1px);
}

.login-submit:active:not(:disabled) {
  transform: translateY(0);
}

.login-submit:focus-visible,
.password-toggle:focus-visible {
  outline: 2px solid var(--login-accent);
  outline-offset: 2px;
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.78;
}

.submit-text {
  justify-self: start;
  font-size: 14px;
  font-weight: 650;
}

.submit-arrow,
.submit-spinner {
  grid-area: 1 / 2;
}

.submit-arrow {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.submit-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgb(255 255 255 / 35%);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: login-spin 700ms linear infinite;
}

.login-submit.is-loading .submit-arrow {
  visibility: hidden;
}

.login-submit.is-loading .submit-spinner {
  display: block;
}

.access-footer {
  position: absolute;
  right: 32px;
  bottom: 26px;
  left: 32px;
  color: #929a96;
  font-size: 10px;
  text-align: center;
}

@keyframes login-spin {
  to {
    transform: rotate(360deg);
  }
}

@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;
  }
}

@media (width <= 820px) {
  .login-shell {
    display: block;
  }

  .brand-pane {
    display: none;
  }

  .access-pane {
    min-height: 100dvh;
    align-items: flex-start;
    padding: max(28px, env(safe-area-inset-top)) 24px max(68px, env(safe-area-inset-bottom));
  }

  .access-pane::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 148px;
    content: '';
    background: var(--login-brand);
  }

  .mobile-brand {
    position: absolute;
    z-index: 1;
    top: max(26px, env(safe-area-inset-top));
    left: 24px;
    display: flex;
    color: #ffffff;
  }

  .login-panel {
    position: relative;
    z-index: 2;
    width: min(100%, 440px);
    margin: 91px auto 0;
    padding: 28px 24px 26px;
    border: 1px solid var(--login-border);
    border-radius: 8px;
    background: var(--login-panel);
    box-shadow: 0 18px 46px rgb(23 35 30 / 13%);
  }

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

  .login-heading h2 {
    font-size: 26px;
  }
}

@media (width <= 420px) {
  .access-pane {
    padding-right: 16px;
    padding-left: 16px;
  }

  .mobile-brand {
    left: 20px;
  }

  .login-panel {
    padding: 26px 20px 24px;
  }
}

@media (prefers-color-scheme: dark) {
  html[data-theme='auto'] {
    color-scheme: dark;
    --login-surface: #151815;
    --login-panel: #1d211e;
    --login-text: #eef2ef;
    --login-muted: #9ba49f;
    --login-border: #333a36;
    --login-danger-bg: #2c1d1d;
  }

  html[data-theme='auto'] .password-toggle:hover {
    background: #292e2b;
  }

  html[data-theme='auto'] .input-shell input::placeholder {
    color: #737c77;
  }
}

html[data-theme='dark'] {
  color-scheme: dark;
  --login-surface: #151815;
  --login-panel: #1d211e;
  --login-text: #eef2ef;
  --login-muted: #9ba49f;
  --login-border: #333a36;
  --login-danger-bg: #2c1d1d;
}

html[data-theme='dark'] .password-toggle:hover {
  background: #292e2b;
}

html[data-theme='dark'] .input-shell input::placeholder {
  color: #737c77;
}
