:root {
  --teal-950: #082f3b;
  --teal-900: #0b3e4c;
  --teal-800: #0f5664;
  --teal-700: #116f76;
  --mint: #16a39a;
  --mint-light: #5bd2c7;
  --ink: #14343e;
  --muted: #6b7f86;
  --line: #d7e3e4;
  --surface: #ffffff;
  --background: #f3f8f7;
  --danger: #bd4545;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; color: var(--ink); background: var(--background); }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(500px, 47%) minmax(560px, 53%);
}

.login-intro {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(34px, 4vw, 62px) clamp(34px, 4vw, 64px) clamp(32px, 4vw, 58px);
  color: #fff;
  background: linear-gradient(145deg, var(--teal-950) 0%, #075163 54%, #0b6f73 100%);
}
.login-intro::before { content: ""; position: absolute; z-index: 0; inset: 0; pointer-events: none; background: linear-gradient(90deg,rgba(3,42,55,.45) 0%,rgba(3,42,55,.23) 48%,rgba(3,42,55,0) 78%),linear-gradient(180deg,rgba(2,40,51,.06) 54%,rgba(2,35,45,.27) 100%); }

.intro-orbit {
  position: absolute;
  z-index: 1;
  border: 1px solid rgba(127, 232, 221, .17);
  border-radius: 50%;
}
.intro-orbit::before,
.intro-orbit::after {
  content: "";
  position: absolute;
  border-radius: inherit;
  border: 1px solid rgba(127, 232, 221, .11);
}
.orbit-one { width: 620px; height: 620px; right: -350px; top: 5%; }
.orbit-one::before { inset: 76px; }
.orbit-one::after { inset: 154px; }
.orbit-two { width: 430px; height: 430px; left: -255px; bottom: -245px; }
.orbit-two::before { inset: 60px; }
.orbit-two::after { inset: 126px; }

.login-brand,
.mobile-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}
.login-brand { position: relative; z-index: 2; align-self: flex-start; }
.brand-mark {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 15px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.1);
}
.brand-mark svg { width: 32px; fill: none; stroke: #67e0d5; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark.athlete-mark { border: 0; background: transparent; }
.brand-mark.athlete-mark svg { width: 41px; height: 41px; stroke: none; }
.brand-mark.athlete-mark circle { fill: #ecffff; }
.brand-mark.athlete-mark path:first-of-type { fill: #56dfd2; }
.brand-mark.athlete-mark path:last-of-type { fill: #b6fbf4; }
.login-brand strong,
.login-brand small,
.mobile-brand strong,
.mobile-brand small { display: block; }
.login-brand strong { font-size: 21px; letter-spacing: .09em; }
.login-brand small { margin-top: 2px; color: #b7d4d8; font-size: 13px; letter-spacing: .12em; }

.intro-content {
  position: relative;
  z-index: 2;
  width: min(100%, 650px);
  margin: clamp(72px, 13vh, 150px) 0 0;
  padding: 0;
}
.intro-content h1 { margin: 0; font-size: clamp(31px, 2.75vw, 45px); line-height: 1.2; letter-spacing: -.04em; white-space: nowrap; text-shadow: 0 2px 18px rgba(0,35,43,.24); }
.intro-description { max-width: 570px; margin: 21px 0 0; color: #d2e8ea; font-size: clamp(14px, 1.05vw, 17px); line-height: 1.85; text-shadow: 0 1px 10px rgba(0,35,43,.22); }

.category-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; width: min(100%,560px); margin-top: 25px; }
.category-list span {
  min-height: 75px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 10px 5px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 12px;
  color: #e4f1f2;
  background: rgba(255,255,255,.065);
  font-size: 12px;
  font-weight: 650;
  text-align: center;
  backdrop-filter: blur(7px);
}
.category-list svg { width: 24px; height: 24px; fill: none; stroke: #b8fbf4; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }

.handwritten-note { position: relative; z-index: 2; width: max-content; margin: auto 0 clamp(46px,7vh,78px) 10px; color: rgba(220,247,246,.77); font-family: KaiTi,"STKaiti","FangSong",serif; font-size: clamp(18px,1.7vw,27px); line-height: 1.65; letter-spacing: .08em; transform: rotate(-4deg); text-shadow: 0 1px 8px rgba(0,40,48,.2); }
.handwritten-note span,.handwritten-note strong { display: block; font-weight: 400; }
.handwritten-note strong { margin-left: 28px; }
.handwritten-note i { width: 190px; height: 24px; display: block; margin: -2px 0 0 10px; border-top: 1.5px solid rgba(220,247,246,.72); border-radius: 50%; transform: rotate(-6deg); }

.intro-footer { position: relative; z-index: 2; }
.intro-line { display: block; width: 44px; height: 3px; border-radius: 3px; background: #72dcd2; }
.intro-footer p { margin: 13px 0 0; color: #9dbcc1; font-size: 12px; letter-spacing: .22em; }

@media (min-width: 821px) {
  .login-intro {
    background-color: #022b44;
    background-image: url("./anatomy-back-v2.webp"),linear-gradient(180deg,#023451 0%,#022b44 52%,#002339 100%);
    background-position: right bottom,center;
    background-size: auto 100%,cover;
    background-repeat: no-repeat;
  }
}

.auth-panel {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 46px clamp(32px, 6vw, 90px);
  background:
    radial-gradient(circle at 82% 8%, rgba(196, 234, 228, .75), transparent 30%),
    radial-gradient(circle at 10% 94%, rgba(222, 241, 238, .9), transparent 31%),
    #f7faf9;
}
.auth-panel-decoration { position: absolute; border: 1px solid rgba(20, 139, 132, .08); border-radius: 50%; }
.decoration-top { width: 330px; height: 330px; top: -180px; right: -130px; box-shadow: 0 0 0 72px rgba(26,160,151,.025); }
.decoration-bottom { width: 270px; height: 270px; bottom: -180px; left: -145px; box-shadow: 0 0 0 62px rgba(26,160,151,.025); }

.auth-wrap { position: relative; z-index: 1; width: min(100%, 520px); }
.mobile-brand { display: none; margin-bottom: 20px; color: var(--teal-900); }
.mobile-brand .brand-mark { border-color: #cee2e1; background: #eaf7f5; }
.mobile-brand strong { font-size: 18px; letter-spacing: .06em; }
.mobile-brand small { color: #6f888e; font-size: 12px; }

.auth-card {
  width: 100%;
  padding: clamp(31px, 3vw, 46px);
  border: 1px solid rgba(210, 225, 224, .95);
  border-radius: 22px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 26px 76px rgba(20, 69, 75, .13);
  backdrop-filter: blur(14px);
}
.auth-card header p { margin: 0 0 7px; color: var(--mint); font-size: 13px; font-weight: 850; letter-spacing: .08em; }
.auth-card header h2 { margin: 0; color: #103945; font-size: clamp(28px, 2.4vw, 34px); line-height: 1.22; letter-spacing: -.035em; }
.auth-card header span { display: block; margin-top: 9px; color: var(--muted); font-size: 14px; line-height: 1.55; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: 28px 0 25px;
  padding: 4px;
  border-radius: 11px;
  background: #eaf1f0;
}
.auth-tabs button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  color: #647b81;
  background: transparent;
  font-size: 14px;
  font-weight: 780;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}
.auth-tabs button.active { color: #fff; background: linear-gradient(135deg, #12858a, var(--mint)); box-shadow: 0 5px 14px rgba(18, 133, 138, .2); }
.auth-tabs button:focus-visible { outline: 3px solid rgba(22, 163, 154, .2); outline-offset: 2px; }

.auth-form { display: grid; grid-template-columns: 1fr; gap: 0; }
.field-label { margin: 0 0 8px; color: #284b55; font-size: 14px; font-weight: 750; }
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 50px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input-wrap:focus-within { border-color: #41aaa4; box-shadow: 0 0 0 4px rgba(22, 163, 154, .11); }
.input-wrap > svg { width: 20px; height: 20px; margin-left: 15px; flex: 0 0 auto; fill: none; stroke: #7b9298; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.input-wrap input {
  width: 100%;
  height: 50px;
  min-width: 0;
  padding: 0 14px 0 11px;
  border: 0;
  outline: 0;
  color: #173942;
  background: transparent;
  font-size: 15px;
}
.input-wrap input::placeholder { color: #9aa9ad; }
.input-wrap.has-action input { padding-right: 4px; }
.password-toggle { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; border: 0; border-radius: 8px; color: #6f878e; background: transparent; cursor: pointer; }
.password-toggle:hover { color: var(--teal-700); background: #f1f8f7; }
.password-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle .eye-closed { display: none; }
.password-toggle.visible .eye-open { display: none; }
.password-toggle.visible .eye-closed { display: block; }

.field-hint { margin: -10px 0 17px; color: #809197; font-size: 12px; line-height: 1.5; }
.password-strength { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: -9px 0 17px; }
.password-strength span { height: 3px; border-radius: 5px; background: #e4eaeb; transition: background .2s ease; }
.password-strength.level-1 span:first-child { background: #df6e66; }
.password-strength.level-2 span:nth-child(-n+2) { background: #e7ad3c; }
.password-strength.level-3 span { background: #2ca58d; }

.form-options { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: -2px 0 20px; }
.remember,
.agreement { display: flex; align-items: flex-start; gap: 8px; color: #60777e; font-size: 13px; line-height: 1.55; }
.remember { align-items: center; cursor: pointer; }
.remember input,
.agreement input { width: 16px; height: 16px; flex: 0 0 auto; margin: 0; accent-color: var(--mint); }
.agreement { margin: 2px 0 18px; }
.text-button { padding: 5px 0; border: 0; color: #168d88; background: transparent; font-size: 13px; font-weight: 700; cursor: pointer; }
.text-button:hover { color: #0f6d6a; text-decoration: underline; }

.submit-button,
.secondary-auth-button {
  min-height: 52px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.submit-button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 0 19px;
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #0e7881 0%, #16a39a 100%);
  box-shadow: 0 12px 24px rgba(13, 116, 120, .19);
}
.submit-button span { grid-column: 1; justify-self: center; padding-left: 20px; }
.submit-button i { grid-column: 2; font-size: 18px; font-style: normal; font-weight: 500; }
.submit-button:hover { transform: translateY(-1px); filter: brightness(1.025); box-shadow: 0 15px 28px rgba(13, 116, 120, .24); }
.submit-button:disabled { cursor: wait; opacity: .65; transform: none; }
.secondary-auth-button { border: 1px solid #46aaa5; color: #107b78; background: #fff; }
.secondary-auth-button:hover { transform: translateY(-1px); background: #f3fbfa; box-shadow: 0 8px 18px rgba(14,111,108,.08); }
.submit-button:focus-visible,
.secondary-auth-button:focus-visible,
.text-button:focus-visible,
.password-toggle:focus-visible { outline: 3px solid rgba(22, 163, 154, .2); outline-offset: 2px; }

.auth-divider { display: flex; align-items: center; gap: 13px; margin: 22px 0 16px; color: #8a999e; font-size: 12px; }
.auth-divider::before,
.auth-divider::after { content: ""; height: 1px; flex: 1; background: #e4ebec; }
.auth-message { min-height: 22px; margin-top: 14px; color: var(--danger); font-size: 13px; line-height: 1.55; text-align: center; }
.auth-message.success { color: #157a6f; }
.auth-card footer { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 14px; padding-top: 18px; border-top: 1px solid #edf1f1; color: #89999e; font-size: 11px; text-align: center; }
.auth-card footer span { color: #60aaa5; font-size: 8px; }
.medical-disclaimer { margin: 16px 0 0; color: #85979c; font-size: 12px; line-height: 1.55; text-align: center; }

.forgot-dialog { width: min(430px, calc(100% - 30px)); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 30px 80px rgba(5, 43, 51, .28); }
.forgot-dialog::backdrop { background: rgba(5, 35, 43, .54); backdrop-filter: blur(3px); }
.forgot-dialog form { position: relative; padding: 34px; text-align: center; }
.dialog-close { position: absolute; top: 11px; right: 12px; width: 36px; height: 36px; border: 0; border-radius: 9px; color: #71858b; background: #f3f6f6; font-size: 23px; cursor: pointer; }
.dialog-icon { width: 50px; height: 50px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 14px; color: #117f7a; background: #e6f6f3; font-size: 25px; }
.forgot-dialog h2 { margin: 0; color: #153b44; font-size: 22px; }
.forgot-dialog p { margin: 12px 0 22px; color: #61777e; font-size: 14px; line-height: 1.75; }
.dialog-confirm { width: 100%; height: 46px; border: 0; border-radius: 9px; color: #fff; background: var(--teal-700); font-weight: 750; cursor: pointer; }

@media (max-width: 1100px) {
  .login-shell { grid-template-columns: minmax(430px, 43%) minmax(510px, 57%); }
  .login-intro { padding-left: 44px; padding-right: 44px; }
  .category-list { gap: 6px; }
  .category-list span { min-height: 70px; font-size: 11px; }
}

@media (max-width: 820px) {
  .login-shell { display: block; }
  .login-intro { display: none; }
  .auth-panel { min-height: 100svh; padding: 30px 20px 36px; align-content: center; }
  .auth-wrap { width: min(100%, 500px); }
  .mobile-brand { display: flex; }
  .auth-card { padding: 31px 28px; }
}

@media (max-width: 480px) {
  .auth-panel { place-items: start center; padding: 22px 14px 28px; }
  .mobile-brand { margin: 0 5px 18px; }
  .mobile-brand .brand-mark { width: 44px; height: 44px; border-radius: 13px; }
  .auth-card { padding: 27px 21px 24px; border-radius: 18px; }
  .auth-tabs { margin-top: 23px; }
  .input-wrap { margin-bottom: 16px; }
  .form-options { align-items: flex-start; }
  .medical-disclaimer { padding: 0 10px; }
  .forgot-dialog form { padding: 31px 24px 25px; }
}

@media (max-height: 760px) and (min-width: 821px) {
  .auth-panel { padding-top: 24px; padding-bottom: 24px; }
  .auth-card { padding-top: 29px; padding-bottom: 27px; }
  .intro-content { padding-top: 36px; padding-bottom: 30px; }
  .category-list { margin-top: 24px; }
}

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