:root {
  color-scheme: light;
  --bg: #eef3ef;
  --surface: #fbfcf9;
  --surface-strong: #ffffff;
  --ink: #18211f;
  --muted: #66716f;
  --muted-2: #8a9490;
  --line: #d9e2dd;
  --field: #f7faf7;
  --teal: #0e7c72;
  --teal-dark: #07584f;
  --amber: #d68b2d;
  --coral: #b75642;
  --danger: #b13f36;
  --success: #198754;
  --shadow: 0 24px 70px rgba(21, 34, 32, 0.16);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  display: block;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.08fr) minmax(420px, 0.92fr);
}

.visual-panel {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow: hidden;
  background: #12211f;
}

.visual-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 42% center;
  transform: scale(1.02);
}

.visual-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(8, 22, 20, 0.82), rgba(8, 22, 20, 0.3) 48%, rgba(8, 22, 20, 0.12)),
    linear-gradient(0deg, rgba(8, 22, 20, 0.66), rgba(8, 22, 20, 0.08) 56%);
  z-index: 1;
}

.visual-content {
  position: relative;
  z-index: 2;
  min-height: 100%;
  padding: clamp(28px, 4.6vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  color: #f7fbf8;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  font-weight: 780;
  letter-spacing: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--teal) 82%, white 18%);
  color: #fff;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}

.brand-mark svg {
  width: 27px;
  height: 27px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.brand-on-image {
  font-size: 1.06rem;
}

.storage-brief {
  width: min(520px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: rgba(9, 24, 22, 0.48);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.storage-brief strong {
  display: block;
  margin-top: 5px;
  font-size: 1.9rem;
  line-height: 1.05;
}

.brief-label,
.activity-item span,
.insight span,
.support-list span {
  color: inherit;
  opacity: 0.72;
  font-size: 0.82rem;
}

.brief-pill {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #e8f6ef;
  font-size: 0.77rem;
  font-weight: 720;
}

.insight-grid {
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.insight {
  padding: 15px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(10px);
}

.insight strong {
  display: block;
  margin-top: 8px;
  font-size: 1.12rem;
}

.activity-list {
  width: min(520px, 100%);
  display: grid;
  gap: 10px;
}

.activity-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(9, 24, 22, 0.42);
}

.activity-item strong,
.activity-item span {
  display: block;
}

.activity-dot,
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #4fe0a5;
  box-shadow: 0 0 0 5px rgba(79, 224, 165, 0.15);
}

.activity-dot.muted {
  background: #f0b45c;
  box-shadow: 0 0 0 5px rgba(240, 180, 92, 0.16);
}

.auth-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 64px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(244, 248, 245, 0.94)),
    var(--surface);
}

.auth-inner {
  width: min(100%, 440px);
}

.brand-mobile {
  display: none;
  margin-bottom: 30px;
  color: var(--ink);
}

.auth-form {
  width: 100%;
}

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

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 780;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1 {
  margin: 0;
  font-size: 2.7rem;
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 10px;
  font-size: 1.35rem;
  line-height: 1.15;
}

.form-heading p:not(.eyebrow),
.modal-window > p {
  margin: 13px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.field-group {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

label,
.label-row {
  color: #263230;
  font-size: 0.92rem;
  font-weight: 710;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--field);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.input-shell:focus-within {
  border-color: color-mix(in srgb, var(--teal) 72%, white 28%);
  background: var(--surface-strong);
  box-shadow: 0 0 0 4px rgba(14, 124, 114, 0.12);
}

.field-group.is-invalid .input-shell {
  border-color: rgba(177, 63, 54, 0.72);
  box-shadow: 0 0 0 4px rgba(177, 63, 54, 0.09);
}

.input-icon {
  width: 22px;
  height: 22px;
  margin-left: 16px;
  flex: 0 0 auto;
  stroke: var(--muted-2);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  min-width: 0;
  height: 54px;
  border: 0;
  outline: 0;
  padding: 0 14px;
  background: transparent;
  color: var(--ink);
}

input::placeholder {
  color: #9aa39f;
}

.icon-button {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
}

.icon-button:hover {
  color: var(--teal-dark);
  background: rgba(14, 124, 114, 0.08);
}

.icon-button:focus-visible,
.link-button:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible {
  outline: 3px solid rgba(14, 124, 114, 0.28);
  outline-offset: 2px;
}

.icon-button svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.field-error {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 0.82rem;
  line-height: 1.35;
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 4px 0 18px;
  color: var(--muted);
  font-size: 0.89rem;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 620;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.session-hint {
  white-space: nowrap;
}

.auth-status {
  min-height: 44px;
  display: flex;
  align-items: center;
  margin: 2px 0 12px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.auth-status.compact {
  min-height: 40px;
  margin-top: -2px;
}

.auth-status.is-loading {
  border-color: rgba(14, 124, 114, 0.18);
  background: rgba(14, 124, 114, 0.08);
  color: var(--teal-dark);
}

.auth-status.is-error {
  border-color: rgba(177, 63, 54, 0.2);
  background: rgba(177, 63, 54, 0.08);
  color: #8d312a;
}

.auth-status.is-success {
  border-color: rgba(25, 135, 84, 0.2);
  background: rgba(25, 135, 84, 0.08);
  color: #12653e;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 780;
  letter-spacing: 0;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.primary-button {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 12px 28px rgba(14, 124, 114, 0.22);
}

.primary-button:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.84;
  transform: none;
}

.secondary-button {
  margin-top: 11px;
  background: var(--surface-strong);
  color: var(--ink);
  border-color: var(--line);
}

.secondary-button:hover {
  border-color: color-mix(in srgb, var(--teal) 36%, var(--line));
  background: #f8fbf8;
}

.secondary-button svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.button-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.36);
  border-top-color: #fff;
  animation: spin 760ms linear infinite;
}

.is-busy .button-spinner {
  display: inline-block;
}

.secondary-button .button-spinner {
  border-color: rgba(14, 124, 114, 0.18);
  border-top-color: var(--teal);
}

.auth-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.84rem;
}

.link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--teal-dark);
  font-weight: 720;
}

.link-button:hover {
  color: var(--coral);
}

.separator {
  width: 1px;
  height: 15px;
  background: var(--line);
}

#statusLine {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  display: inline-block;
  flex: 0 0 auto;
}

.status-dot.offline {
  background: #d66853;
  box-shadow: 0 0 0 5px rgba(214, 104, 83, 0.14);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 25, 23, 0.46);
  backdrop-filter: blur(8px);
}

.modal-window {
  position: relative;
  width: min(100%, 430px);
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: 0 30px 90px rgba(15, 25, 23, 0.3);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.modal-window form {
  margin-top: 22px;
}

.support-list {
  margin-top: 22px;
  display: grid;
  gap: 10px;
}

.support-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.support-list strong {
  text-align: right;
  font-size: 0.94rem;
}

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

@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .visual-panel {
    min-height: 310px;
  }

  .visual-content {
    min-height: 310px;
    padding: 24px;
  }

  .brand-on-image,
  .activity-list {
    display: none;
  }

  .auth-panel {
    min-height: auto;
    place-items: start center;
    padding-top: 36px;
  }

  .brand-mobile {
    display: inline-flex;
  }
}

@media (max-width: 560px) {
  .visual-panel {
    min-height: 230px;
  }

  .visual-content {
    min-height: 230px;
  }

  .storage-brief {
    align-items: flex-start;
    flex-direction: column;
  }

  .insight-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .insight {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
  }

  .auth-panel {
    padding: 28px 18px 34px;
  }

  .form-options,
  .auth-footer,
  .support-list div {
    align-items: flex-start;
    flex-direction: column;
  }

  .storage-brief strong {
    font-size: 1.52rem;
  }

  h1 {
    font-size: 2.25rem;
  }

  .separator {
    display: none;
  }
}

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