:root {
  color-scheme: light;
  --bg-top: #f5f0eb;
  --bg-bottom: #eee7e1;
  --card: rgba(255, 253, 251, 0.94);
  --card-border: rgba(94, 62, 49, 0.13);
  --ink: #352721;
  --muted: #74645c;
  --soft: #a5968e;
  --accent: #a66f50;
  --accent-strong: #39251f;
  --accent-light: #bb815e;
  --green: #557d6d;
  --shadow: 0 28px 70px rgba(67, 42, 32, 0.18);
  --shadow-soft: 0 16px 34px rgba(67, 42, 32, 0.1);
}

* {
  box-sizing: border-box;
}

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

body.login-page {
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: #f3eee9;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.login-page::before,
body.login-page::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

body.login-page::before {
  width: 520px;
  height: 520px;
  top: -290px;
  left: -170px;
  background: rgba(166, 111, 80, 0.12);
}

body.login-page::after {
  width: 460px;
  height: 460px;
  right: -190px;
  bottom: -260px;
  background: rgba(85, 125, 109, 0.12);
}

.login-shell {
  min-height: 100vh;
  padding: 36px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.container {
  width: min(100%, 1040px);
  margin: 0;
}

.login-layout {
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr);
  overflow: hidden;
  border: 1px solid rgba(92, 61, 48, .12);
  border-radius: 30px;
  background: rgba(255, 253, 251, .96);
  box-shadow: 0 34px 90px rgba(60, 38, 29, .18);
  animation: login-rise .65s cubic-bezier(.22,.8,.3,1) both;
}

@keyframes login-rise {
  from { opacity: 0; transform: translateY(18px) scale(.988); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 0 5px rgba(130,173,153,.12); }
  50% { box-shadow: 0 0 0 9px rgba(130,173,153,.035); }
}

@keyframes brand-orbit {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-10px, 8px, 0); }
}

.brand-panel {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  padding: 46px 48px 42px;
  overflow: hidden;
  color: #fffaf6;
  background:
    linear-gradient(155deg, rgba(45, 28, 23, .96), rgba(75, 45, 34, .95) 55%, rgba(90, 58, 42, .94));
}

.brand-panel::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 460px;
  height: 460px;
  right: -210px;
  top: 100px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.018);
  animation: brand-orbit 12s ease-in-out infinite;
}

.brand-panel::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 0;
  right: 0;
  bottom: 0;
  height: 7px;
  background: linear-gradient(90deg, #8d3e28 0%, #d6a06f 55%, #b65336 100%);
}

.brand-panel__top {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-secure-badge { display: none; }

.brand-logo-wrap {
  width: 82px;
  height: 82px;
  flex: 0 0 82px;
  display: grid;
  place-items: center;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.brand-logo-wrap img { width: 72px; height: 72px; object-fit: contain; }
.brand-name { color: #fffdfb; font-size: 16px; font-weight: 800; line-height: 1.3; letter-spacing: .045em; }
.brand-tagline { margin-top: 6px; color: rgba(255,250,246,.78); font-size: 12px; font-weight: 500; line-height: 1.4; }

.brand-panel__content { margin: auto 0; max-width: 410px; }
.brand-kicker {
  display: inline-block;
  margin-bottom: 17px;
  color: #d9b38b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.brand-panel__content h2 { margin: 0; max-width: 390px; font-size: clamp(2.25rem, 4vw, 3.45rem); line-height: 1.04; letter-spacing: -.045em; }
.brand-panel__content p { max-width: 390px; margin: 22px 0 0; color: rgba(255,250,246,.68); font-size: 15px; line-height: 1.75; }
.brand-panel__footer { display: flex; align-items: center; gap: 9px; color: rgba(255,250,246,.67); font-size: 12px; font-weight: 600; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #82ad99; box-shadow: 0 0 0 5px rgba(130,173,153,.12); animation: status-pulse 2.4s ease-in-out infinite; }

.login-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 58px 38px;
  border-radius: 0;
  background: #fffdfb;
  border: 0;
  box-shadow: none;
}

.login-card__content { display: contents; }

.login-card::before {
  display: none;
}

.login-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  padding: 10px 16px;
  margin-bottom: 20px;
  border-radius: 999px;
  background: rgba(166, 111, 80, 0.11);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.heading-wrap {
  margin-top: 0;
}

.heading {
  margin: 0;
  font-family: inherit;
  font-size: clamp(2rem, 4vw, 2.55rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--accent-strong);
}

.heading span {
  display: block;
  margin-top: 8px;
  color: var(--accent);
  font-size: 0.6em;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.subheading {
  margin: 12px 0 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--muted);
}

.subheading strong { color: var(--ink); font-weight: 700; }

.login-step-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 22px;
  color: #8d7d75;
  font-size: 10px;
  font-weight: 700;
}
.login-step-copy { display: flex; flex-direction: column; gap: 5px; line-height: 1.4; }
.login-step-copy span { color: #a66f50; font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.login-step-copy strong { color: #51372d; font-size: 12px; }
.login-step-track { display: grid; grid-template-columns: repeat(2, 26px); gap: 5px; }
.login-step-track i { height: 4px; border-radius: 999px; background: #eadfd8; }
.login-step-track i.is-active { background: #8d4b35; }

.form {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.field-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.password-wrapper {
  position: relative;
}

.form .input {
  width: 100%;
  min-height: 58px;
  padding: 0 18px;
  border: 1px solid #e7ddd7;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  box-shadow: 0 8px 22px rgba(62, 40, 31, .055);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.form .input::placeholder {
  color: var(--soft);
}

.password-wrapper .input {
  padding-right: 58px;
}

.form .input:focus {
  outline: none;
  border-color: rgba(166, 111, 80, 0.42);
  box-shadow:
    0 0 0 4px rgba(166, 111, 80, 0.12),
    0 16px 28px rgba(67, 42, 32, 0.12);
  transform: translateY(-1px);
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background 0.2s ease;
}

.toggle-password:hover {
  background: rgba(57, 37, 31, 0.06);
}

.toggle-password svg {
  width: 22px;
  height: 22px;
  fill: #827169;
  transition: fill 0.2s ease, transform 0.2s ease;
}

.toggle-password.is-visible svg {
  fill: var(--accent);
  transform: scale(1.04);
}

.form-footer {
  padding-top: 4px;
}

.form .login-button {
  width: 100%;
  padding: 16px 20px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-strong) 0%, #704735 55%, var(--accent) 100%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 20px 34px rgba(89, 54, 40, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.login-security {
  margin: auto 0 0;
  padding-top: 28px;
  text-align: center;
  color: #9a8a82;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .035em;
}
.login-security span { margin-right: 5px; filter: grayscale(1); }

.developer-credit {
  margin-top: 18px;
  text-align: center;
  color: #8b7a72;
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: .035em;
}

.developer-credit__brand {
  display: none;
}

.developer-credit__byline strong {
  color: #5c4439;
  font-weight: 700;
}

@media (max-width: 860px) {
  .login-layout { grid-template-columns: 1fr; min-height: auto; max-width: 540px; margin: 0 auto; }
  .brand-panel { min-height: 235px; padding: 28px 30px 30px; }
  .brand-panel__content { margin: 34px 0 0; }
  .brand-panel__content h2 { max-width: 430px; font-size: 2rem; }
  .brand-panel__content p, .brand-panel__footer { display: none; }
  .login-card { padding: 38px 40px 28px; }
}

.form .login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 36px rgba(89, 54, 40, 0.3);
  filter: saturate(1.05);
}

.form .login-button:active {
  transform: translateY(0);
  box-shadow: 0 14px 24px rgba(89, 54, 40, 0.23);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  transition: background-color 9999s ease-in-out 0s;
}

@media (max-width: 640px) {
  .login-shell {
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    padding: 0;
    align-items: stretch;
  }

  .container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    flex-direction: column;
    margin-inline: auto;
  }

  .login-layout {
    width: 100%;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .brand-panel {
    min-height: clamp(205px, 27svh, 230px);
    padding: calc(22px + env(safe-area-inset-top)) 22px 24px;
    background: linear-gradient(135deg, #35231e 0%, #503229 52%, #674536 100%);
  }
  .brand-panel__top { flex: 1; flex-direction: column; justify-content: center; gap: 6px; text-align: center; }
  .brand-panel__content, .brand-secure-badge { display: none; }
  .brand-logo-wrap { width: 88px; height: 88px; flex-basis: 88px; border-radius: 0; }
  .brand-logo-wrap img { width: 82px; height: 82px; }
  .brand-identity { display: flex; flex-direction: column; align-items: center; }
  .brand-name { font-size: 17px; letter-spacing: .035em; }
  .brand-tagline { margin-top: 3px; font-size: 10px; }
  .login-card {
    flex: 1 0 auto;
    justify-content: center;
    align-items: center;
    min-height: 350px;
    padding: 28px 24px 24px;
  }
  .login-card__content {
    display: block;
    width: 100%;
    max-width: 420px;
    margin-block: auto;
  }
  .login-mark { display: none; }
  .heading-wrap { margin-top: 0; }

  .heading {
    font-size: 1.8rem;
    line-height: 1.05;
  }

  .subheading { max-width: 290px; margin-top: 8px; color: #7f7069; font-size: 13px; font-weight: 500; line-height: 1.45; }
  .subheading strong { color: inherit; font-weight: inherit; }
  .login-step-indicator { margin: 0 0 20px; }
  .form { margin-top: 24px; gap: 16px; }
  .field { gap: 7px; }
  .field-label { font-size: 10px; letter-spacing: .12em; }
  .form .input { min-height: 54px; padding-inline: 16px; border-radius: 14px; font-size: 15px; box-shadow: none; }
  .form .login-button { min-height: 52px; padding: 14px 18px; border-radius: 14px; font-size: 15px; box-shadow: 0 12px 24px rgba(89,54,40,.18); }
  .login-security { width: 100%; margin: 0; padding-top: 18px; font-size: 10px; }

  .developer-credit {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    flex: 0 0 auto;
    margin-top: 0;
    margin-bottom: 0;
    padding: 11px max(16px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    border: 1px solid rgba(166, 111, 80, .18);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
    background: #fbf8f4;
    box-shadow: none;
    text-align: left;
    animation: login-rise .65s .12s cubic-bezier(.22,.8,.3,1) both;
  }

  .developer-credit::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, #8d3e28 0%, #d6a06f 55%, #b65336 100%);
  }

  .developer-credit__brand {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
  }

  .developer-credit__mark {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(145deg, #bd674b, #9f402c);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .035em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 8px 18px rgba(115, 57, 39, .18);
  }

  .developer-credit__identity {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .developer-credit__identity strong {
    color: var(--ink);
    font-size: 11px;
    line-height: 1.3;
    letter-spacing: 0;
  }

  .developer-credit__identity small {
    color: #8b7a72;
    font-size: 8px;
    line-height: 1.4;
    letter-spacing: .01em;
  }

  .developer-credit__byline {
    display: flex;
    min-width: 0;
    align-items: flex-end;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 8px;
    line-height: 1.4;
  }

  .developer-credit__byline span {
    color: #917f76;
  }

  .developer-credit__byline strong {
    color: #9f402c;
    font-size: 9px;
    white-space: nowrap;
  }
}

@media (max-width: 640px) and (max-height: 650px) {
  .brand-panel { min-height: 166px; padding-top: calc(12px + env(safe-area-inset-top)); padding-bottom: 14px; }
  .brand-panel__top { gap: 9px; }
  .brand-logo-wrap { width: 64px; height: 64px; flex-basis: 64px; }
  .brand-logo-wrap img { width: 60px; height: 60px; }
  .brand-name { font-size: 15px; }
  .login-card { min-height: 330px; padding-block: 20px; }
  .form { margin-top: 16px; }
  .login-security { padding-top: 14px; }
}

@media (orientation: landscape) and (max-height: 600px) and (max-width: 950px) {
  .login-shell { min-height: 100vh; min-height: 100dvh; padding: 0; align-items: stretch; }
  .container { display: flex; width: 100%; min-height: 100vh; min-height: 100dvh; flex-direction: column; margin: 0; }
  .login-layout {
    display: grid;
    flex: 1 0 auto;
    grid-template-columns: minmax(250px, .82fr) minmax(360px, 1.18fr);
    min-height: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .brand-panel { min-height: 0; padding: max(18px, env(safe-area-inset-top)) 24px max(18px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); }
  .brand-panel__content { margin: auto 0; }
  .brand-kicker, .brand-panel__content p, .brand-panel__footer, .login-mark { display: none; }
  .brand-panel__content h2 { max-width: 300px; font-size: clamp(1.35rem, 4.2vw, 1.8rem); }
  .login-card { align-items: center; justify-content: center; min-height: 0; padding: 18px max(28px, env(safe-area-inset-right)) 16px 28px; }
  .login-card__content { display: block; width: 100%; max-width: 440px; margin-block: auto; }
  .heading-wrap { margin-top: 0; }
  .heading { font-size: 1.65rem; }
  .subheading { margin-top: 6px; font-size: 12px; }
  .login-step-indicator { margin-top: 2px; font-size: 9px; }
  .form { margin-top: 14px; gap: 10px; }
  .form .input { min-height: 46px; }
  .form .login-button { padding: 12px 18px; }
  .login-security { width: 100%; margin: 0; padding-top: 10px; font-size: 9px; }
  .developer-credit { margin: 0; padding-block: 5px calc(5px + env(safe-area-inset-bottom)); }
}

@media (max-width: 360px) {
  .login-shell { padding: 0; }
  .container { min-height: 100vh; min-height: 100svh; min-height: 100dvh; }
  .brand-panel { padding-inline: 16px; }
  .login-card { padding-inline: 15px; }
  .developer-credit__byline {
    align-items: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-layout,
  .developer-credit,
  .brand-panel::before,
  .status-dot,
  .login-alert,
  #installModal,
  #installModalContent {
    animation: none !important;
  }
  .form .input,
  .form .login-button,
  .toggle-password,
  .branch-option__card {
    transition-duration: .01ms !important;
  }
}
