:root {
  --ink: #10244a;
  --muted: #65789c;
  --teal: #0b78f0;
  --teal-dark: #1265d8;
  --paper: #f4f7fb;
  --line: #dce7f5;
  --red: #d94b63;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

button,
input { font: inherit; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(390px, 0.9fr); }
.login-story,
.login-panel { min-width: 0; }

.login-story {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background:
    radial-gradient(circle at 83% 18%, rgba(191, 245, 255, 0.2), transparent 24rem),
    linear-gradient(145deg, #0b78f0 0%, #1265d8 58%, #078fba 145%);
  padding: clamp(34px, 5vw, 76px);
}

.login-story::after {
  content: "";
  position: absolute;
  right: -110px;
  bottom: -170px;
  width: 470px;
  height: 470px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(255, 255, 255, 0.025), 0 0 0 140px rgba(255, 255, 255, 0.018);
}

.login-brand { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 13px; width: max-content; color: inherit; text-decoration: none; }
.login-brand > span:last-child { display: grid; }
.login-brand strong { font-size: 1rem; }
.login-brand small { margin-top: 3px; color: #dcecff; font-size: 0.72rem; }
.login-mark { width: 44px; height: 44px; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 14px; background: transparent; box-shadow: 0 10px 24px rgba(7, 53, 124, 0.2); }
.login-mark img { width: 100%; height: 100%; object-fit: contain; }

.story-copy { position: relative; z-index: 1; max-width: 770px; margin: 70px 0; }
.eyebrow { margin: 0 0 12px; color: #bff5ff; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; }
.story-copy h1 { max-width: 760px; margin: 0; font-size: clamp(3rem, 5.5vw, 5.4rem); line-height: 0.96; letter-spacing: -0.06em; }
.story-copy > p:last-child { max-width: 620px; margin: 28px 0 0; color: #dcecff; font-size: clamp(1rem, 1.4vw, 1.16rem); line-height: 1.7; }

.trust-row { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; }
.trust-row span { border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 999px; color: #e8f3ff; background: rgba(255, 255, 255, 0.075); padding: 8px 12px; font-size: 0.72rem; }

.login-panel { display: grid; place-items: center; padding: 34px; background: linear-gradient(135deg, #f9fbff, #edf4fd); }
.login-card { width: min(100%, 450px); border: 1px solid rgba(198, 216, 239, 0.92); border-radius: 26px; background: rgba(255, 255, 255, 0.96); box-shadow: 0 26px 70px rgba(16, 36, 74, 0.12); padding: clamp(28px, 5vw, 48px); }
.login-card .eyebrow { color: var(--teal-dark); }
.login-card h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.35rem); letter-spacing: -0.04em; }
.login-intro { margin: 9px 0 28px; color: var(--muted); }

.lark-login { min-height: 62px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; border: 1px solid #0b78f0; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #0b78f0, #1265d8); padding: 10px 16px 10px 10px; text-decoration: none; box-shadow: 0 12px 28px rgba(11, 120, 240, 0.2); transition: transform 150ms ease, box-shadow 150ms ease; }
.lark-login[hidden], .password-login-panel[hidden] { display: none; }
.lark-login:hover { transform: translateY(-1px); box-shadow: 0 16px 34px rgba(11, 120, 240, 0.25); }
.lark-login > span:nth-child(2) { display: grid; gap: 3px; }
.lark-login strong { font-size: 0.9rem; }
.lark-login small { color: #dcecff; font-size: 0.72rem; }
.lark-symbol { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; color: #0b78f0; background: #fff; font-weight: 900; }

.password-login-panel { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 17px; }
.password-login-panel summary { width: max-content; margin: 0 auto; color: var(--muted); font-size: 0.75rem; font-weight: 750; cursor: pointer; }
.password-login-panel[open] summary { margin: 0 0 17px; color: var(--teal-dark); }
.password-login-panel form { display: grid; }

label { display: block; margin-bottom: 7px; color: #29485f; font-size: 0.78rem; font-weight: 750; }
.password-field { position: relative; }
.password-field input { width: 100%; min-height: 50px; border: 1px solid var(--line); border-radius: 11px; outline: 0; color: var(--ink); background: #fff; padding: 11px 66px 11px 13px; transition: border-color 150ms ease, box-shadow 150ms ease; }
.password-field input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(8, 127, 120, 0.11); }
.password-field button { position: absolute; top: 50%; right: 7px; transform: translateY(-50%); min-height: 36px; border: 0; border-radius: 8px; color: var(--teal-dark); background: transparent; padding: 0 9px; font-size: 0.75rem; font-weight: 750; cursor: pointer; }
.password-field button:hover { background: #e4f3f0; }

.login-error { min-height: 22px; margin: 10px 0 2px; color: var(--red); font-size: 0.78rem; line-height: 1.45; }
.login-submit { width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--teal); border-radius: 11px; color: #fff; background: var(--teal); padding: 0 17px; font-weight: 750; cursor: pointer; box-shadow: 0 8px 22px rgba(8, 127, 120, 0.18); transition: background 150ms ease, transform 150ms ease; }
.login-submit:hover:not(:disabled) { background: var(--teal-dark); transform: translateY(-1px); }
.login-submit:disabled { opacity: 0.66; cursor: wait; }
.login-note { margin: 24px 0 0; border-top: 1px solid #e1e8e6; color: var(--muted); padding-top: 18px; font-size: 0.72rem; line-height: 1.6; }

@media (max-width: 1080px) {
  .login-shell { grid-template-columns: minmax(0, 1fr) minmax(380px, 0.85fr); }
  .login-story { padding: 40px; }
  .story-copy { margin: 54px 0; }
  .story-copy h1 { font-size: clamp(2.9rem, 5.2vw, 4.45rem); }
}

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-story { min-height: 350px; }
  .story-copy { margin: 48px 0 24px; }
  .trust-row { display: none; }
}

@media (max-width: 560px) {
  .login-story { min-height: 280px; padding: 22px; }
  .login-mark { width: 40px; height: 40px; }
  .story-copy { margin: 34px 0 8px; }
  .story-copy h1 { font-size: clamp(2.35rem, 11.8vw, 3.35rem); }
  .story-copy > p:last-child { display: none; }
  .login-panel { padding: 14px; }
  .login-card { border-radius: 19px; padding: 24px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
