:root{
  --forest:#163b30;--forest2:#245141;--cream:#f4efe5;--paper:#fbf8f1;
  --gold:#a88a52;--ink:#25372f;--muted:#74786f;--line:rgba(51,70,60,.17);--danger:#9a3d35
}
*{box-sizing:border-box}
html,body{margin:0;width:100%;min-height:100%;font-family:"Segoe UI","Noto Sans TC","Microsoft JhengHei",sans-serif;color:var(--ink);background:#e8e0d2}
button,input{font:inherit} button{cursor:pointer}
:focus-visible{outline:3px solid rgba(168,138,82,.45);outline-offset:2px}

/* DESKTOP: exactly one viewport, compact two-column layout */
.login-shell{height:100dvh;min-height:560px;display:grid;grid-template-columns:48% 52%;overflow:hidden}
.scene{position:relative;min-width:0;height:100%;overflow:hidden;color:#fff9ea;padding:30px 42px;display:flex;flex-direction:column;isolation:isolate}
.forest-art{position:absolute;inset:0;width:100%;height:100%;z-index:-3}
.scene-shade{position:absolute;inset:0;z-index:-2;background:linear-gradient(90deg,rgba(8,31,25,.76),rgba(10,38,30,.28)),linear-gradient(0deg,rgba(8,28,23,.62),transparent 52%)}
.brand{display:flex;align-items:center;gap:11px;letter-spacing:.18em}
.brand-emblem{width:42px;height:42px;border:1px solid rgba(232,218,181,.7);display:grid;place-items:center;border-radius:50%;font-family:Georgia,"Noto Serif TC",serif;font-size:18px;color:#eadbb5;background:rgba(18,54,43,.24)}
.brand strong{display:block;font-family:Georgia,"Noto Serif TC",serif;font-size:20px;font-weight:500}
.brand small{display:block;font-size:8px;letter-spacing:.25em;margin-top:3px;color:#e7dfcb}
.brand-copy{margin:auto 0 28px;max-width:560px}
.eyebrow{font-size:9px;letter-spacing:.3em;color:#e1d0a6;font-weight:700}
.brand-copy h1{margin:13px 0 10px;font-family:Georgia,"Noto Serif TC","PMingLiU",serif;font-size:clamp(34px,3.6vw,54px);line-height:1.27;font-weight:400;letter-spacing:.07em}
.brand-copy p{margin:0;color:#e9e4d7;font-size:12px;line-height:1.75;letter-spacing:.05em}
.trust-row{display:flex;gap:16px;flex-wrap:wrap;padding-top:12px;margin-bottom:14px;border-top:1px solid rgba(235,222,190,.23);font-size:9px;color:#e6deca}
.trust-row span::before{content:"◇";color:#d8bd80;margin-right:5px}
.scene-footer{display:flex;justify-content:space-between;gap:15px;font-size:7px;letter-spacing:.22em;color:#d7cfbb}

.login-side{height:100%;min-width:0;display:grid;grid-template-rows:1fr auto;place-items:center;padding:24px 34px 15px;background:radial-gradient(circle at 88% 10%,rgba(194,175,129,.19),transparent 27%),linear-gradient(145deg,#f8f3e9,#e9e1d2)}
.login-side::before{display:none}
.login-card{align-self:center;width:min(100%,400px);padding:25px 30px 20px;border:1px solid rgba(255,255,255,.8);border-radius:22px;background:rgba(251,248,240,.82);box-shadow:0 20px 55px rgba(45,54,45,.13);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
.card-mark{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:var(--forest);color:#e7d6a8;margin-bottom:12px;font-size:12px}
.card-kicker{margin:0;color:#8b7957;font-size:8px;font-weight:700;letter-spacing:.19em}
h2{margin:6px 0 3px;font-family:Georgia,"Noto Serif TC","PMingLiU",serif;font-size:30px;line-height:1.2;font-weight:500;letter-spacing:.07em;color:#1e352c}
.intro{margin:0 0 15px;color:var(--muted);font-size:12px}
.field{margin-bottom:10px}
label{display:block;margin-bottom:4px;font-size:11px;font-weight:700;color:#3d4c45}
.input-wrap{position:relative}
input{width:100%;height:43px;border:1px solid rgba(82,90,78,.22);border-radius:11px;padding:0 13px;color:var(--ink);background:rgba(255,253,247,.88)}
input::placeholder{color:#99998f;font-size:12px}
input:focus{outline:none;border-color:rgba(38,83,65,.68);box-shadow:0 0 0 3px rgba(36,76,61,.08)}
#password{padding-right:64px}
.toggle{position:absolute;right:5px;top:4px;height:35px;padding:0 9px;border:0;border-radius:8px;background:transparent;color:var(--forest);font-size:11px;font-weight:600}
.toggle:hover{background:rgba(36,76,61,.07)}
.submit{width:100%;height:45px;margin-top:1px;padding:0 16px;border:0;border-radius:11px;display:flex;align-items:center;justify-content:space-between;background:linear-gradient(135deg,#214f3f,#10392e);color:#fffaf0;font-size:12px;font-weight:700;letter-spacing:.05em;box-shadow:0 9px 20px rgba(20,61,47,.18)}
.submit:disabled{opacity:.62;cursor:wait}
.message{min-height:16px;margin:6px 0 0;color:var(--danger);font-size:11px;line-height:1.45}
.message.success{color:var(--forest)}
.security-note{display:flex;gap:8px;align-items:flex-start;border-top:1px solid var(--line);margin-top:8px;padding-top:9px;color:#74766e;font-size:9px;line-height:1.45}
.security-note>span:first-child{color:var(--gold);font-size:14px}
.security-note strong{color:#4a514a}
.page-footer{align-self:end;margin:0;color:#77776e;font-size:7px;letter-spacing:.16em}

/* Short laptop screens */
@media (max-height:650px) and (min-width:761px){
  .scene{padding:20px 30px}.brand-copy{margin-bottom:16px}.brand-copy h1{font-size:34px}
  .trust-row{display:none}.scene-footer{font-size:6px}
  .login-side{padding:12px 28px 8px}.login-card{padding:18px 25px 14px;width:min(100%,380px)}
  .card-mark{display:none}.intro{margin-bottom:10px}.field{margin-bottom:7px}
  input{height:39px}.toggle{top:2px}.submit{height:41px}.security-note{margin-top:5px;padding-top:6px}
}

/* MOBILE/TABLET: background header + compact card, no giant stacked desktop panels */
@media (max-width:760px){
  html,body{min-height:100%;background:#e9e1d2}
  .login-shell{height:auto;min-height:100dvh;display:flex;flex-direction:column;overflow:visible;background:#e9e1d2}
  .scene{height:178px;min-height:178px;padding:16px 18px;display:block}
  .brand{position:relative;z-index:1}.brand-emblem{width:34px;height:34px;font-size:15px}.brand strong{font-size:17px}.brand small{font-size:7px}
  .brand-copy{position:absolute;left:18px;bottom:26px;margin:0}.brand-copy h1{font-size:24px;line-height:1.25;margin:0}.eyebrow,.brand-copy p,.trust-row,.scene-footer{display:none}
  .login-side{height:auto;min-height:calc(100dvh - 160px);display:block;padding:0 10px 14px;margin-top:-18px;background:linear-gradient(#e9e1d2,#e6ddcd)}
  .login-card{position:relative;z-index:2;width:100%;max-width:none;padding:20px 18px 16px;border-radius:19px;background:#faf7ef;box-shadow:0 12px 35px rgba(18,45,36,.2);backdrop-filter:none}
  .card-mark{display:none}.card-kicker{font-size:7px}h2{font-size:26px;margin:5px 0 2px}.intro{font-size:11px;margin-bottom:13px}
  .field{margin-bottom:9px}label{font-size:10px}input{height:44px;font-size:16px}.toggle{top:4px;height:36px}
  .submit{height:46px;font-size:12px}.message{min-height:15px;margin-top:5px}.security-note{margin-top:7px;padding-top:8px;font-size:9px}
  .page-footer{text-align:center;margin-top:10px;font-size:7px}
}

/* Very small phones */
@media (max-width:380px){
  .scene{height:145px;min-height:145px}.brand-copy{bottom:20px}.brand-copy h1{font-size:21px}
  .login-side{min-height:calc(100dvh - 132px);margin-top:-13px;padding-left:7px;padding-right:7px}
  .login-card{padding:16px 14px 13px;border-radius:17px}h2{font-size:24px}.intro{margin-bottom:10px}
  input{height:42px}.submit{height:44px}.security-note{display:none}
}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}


/* v4: desktop ornamentation + hard mobile reset */
.login-side{position:relative;overflow:hidden}
.side-decoration{position:absolute;inset:0;pointer-events:none;color:rgba(27,64,51,.10)}
.vertical-brand{
  position:absolute;right:24px;top:50%;transform:translateY(-50%);
  writing-mode:vertical-rl;font-family:Georgia,serif;font-size:11px;letter-spacing:.42em
}
.edition{
  position:absolute;left:34px;bottom:28px;font-size:7px;line-height:1.8;
  letter-spacing:.22em;color:rgba(83,72,51,.24)
}
.leaf{position:absolute;font-family:Georgia,serif;font-size:180px;line-height:1;opacity:.42;transform:rotate(-35deg)}
.leaf-a{right:-45px;top:-28px}
.leaf-b{left:-55px;bottom:30px;transform:rotate(145deg);font-size:145px}

/* iPhone/iOS: deliberately override every desktop height/position rule */
@media screen and (max-width:760px){
  html,body{width:100%!important;min-width:0!important;overflow-x:hidden!important}
  .login-shell{
    display:flex!important;flex-direction:column!important;
    width:100%!important;height:auto!important;min-height:100dvh!important;
    overflow:visible!important
  }
  .scene{
    position:relative!important;width:100%!important;
    height:170px!important;min-height:170px!important;max-height:170px!important;
    padding:15px 17px!important;overflow:hidden!important;flex:none!important
  }
  .forest-art{position:absolute!important;inset:0!important;width:100%!important;height:100%!important}
  .brand{position:relative!important;top:auto!important;left:auto!important}
  .brand-copy{position:absolute!important;left:17px!important;bottom:22px!important;margin:0!important}
  .brand-copy h1{font-size:23px!important;line-height:1.25!important;margin:0!important}
  .brand-copy .eyebrow,.brand-copy p,.trust-row,.scene-footer{display:none!important}
  .login-side{
    display:block!important;width:100%!important;height:auto!important;
    min-height:calc(100dvh - 155px)!important;margin:-15px 0 0!important;
    padding:0 9px 14px!important;overflow:visible!important
  }
  .side-decoration{display:none!important}
  .login-card{
    position:relative!important;z-index:5!important;width:100%!important;max-width:none!important;
    margin:0!important;padding:18px 16px 15px!important;border-radius:18px!important;
    background:#faf7ef!important;box-shadow:0 12px 30px rgba(18,45,36,.20)!important
  }
  .card-mark{display:none!important}
  .card-kicker{font-size:7px!important}
  h2{font-size:25px!important;margin:5px 0 2px!important}
  .intro{font-size:11px!important;margin:0 0 11px!important}
  .field{margin:0 0 8px!important}
  label{font-size:10px!important;margin-bottom:4px!important}
  input{height:43px!important;font-size:16px!important}
  .submit{height:45px!important;min-height:45px!important}
  .security-note{margin-top:7px!important;padding-top:7px!important}
  .page-footer{margin:9px 0 0!important;text-align:center!important}
}
@media screen and (max-width:760px) and (max-height:700px){
  .scene{height:135px!important;min-height:135px!important;max-height:135px!important}
  .brand-copy h1{font-size:20px!important}
  .login-side{min-height:calc(100dvh - 123px)!important;margin-top:-12px!important}
  .login-card{padding-top:14px!important}
  .security-note{display:none!important}
}


/* v5 — balance desktop card size and make mobile fill the viewport more naturally */

/* Desktop */
@media screen and (min-width:761px){
  .login-shell{grid-template-columns:48% 52%}
  .login-card{
    width:min(78%,520px)!important;
    max-width:520px!important;
    padding:34px 40px 29px!important;
    border-radius:25px!important;
  }
  .card-mark{width:38px!important;height:38px!important;margin-bottom:15px!important}
  .card-kicker{font-size:9px!important}
  h2{font-size:36px!important;margin:8px 0 5px!important}
  .intro{font-size:13px!important;margin-bottom:21px!important}
  .field{margin-bottom:14px!important}
  label{font-size:12px!important;margin-bottom:6px!important}
  input{height:50px!important;font-size:14px!important;border-radius:12px!important}
  .toggle{top:5px!important;height:40px!important;font-size:12px!important}
  .submit{height:51px!important;font-size:13px!important;border-radius:12px!important}
  .message{font-size:12px!important;min-height:18px!important}
  .security-note{font-size:10px!important;margin-top:12px!important;padding-top:12px!important}
}

/* Short desktop/laptop screens: still keep everything on one screen */
@media screen and (min-width:761px) and (max-height:700px){
  .login-card{width:min(74%,485px)!important;max-width:485px!important;padding:24px 32px 20px!important}
  .card-mark{width:32px!important;height:32px!important;margin-bottom:9px!important}
  h2{font-size:31px!important}
  .intro{margin-bottom:13px!important}
  .field{margin-bottom:9px!important}
  input{height:44px!important}
  .toggle{top:2px!important;height:40px!important}
  .submit{height:45px!important}
  .security-note{margin-top:7px!important;padding-top:7px!important}
}

/* Mobile: use more of the screen, remove the large empty lower area */
@media screen and (max-width:760px){
  body{background:#e8e0d2!important}
  .login-shell{
    min-height:100dvh!important;
    background:#e8e0d2!important;
  }
  .scene{
    height:205px!important;
    min-height:205px!important;
    max-height:205px!important;
  }
  .brand-copy{bottom:25px!important}
  .brand-copy h1{font-size:25px!important}

  .login-side{
    flex:1!important;
    display:flex!important;
    flex-direction:column!important;
    justify-content:flex-start!important;
    min-height:calc(100dvh - 188px)!important;
    margin-top:-17px!important;
    padding:0 14px 20px!important;
  }
  .login-card{
    flex:none!important;
    padding:24px 24px 21px!important;
    border-radius:22px!important;
  }
  .card-kicker{font-size:8px!important}
  h2{font-size:30px!important;margin:6px 0 3px!important}
  .intro{font-size:12px!important;margin-bottom:17px!important}
  .field{margin-bottom:12px!important}
  label{font-size:11px!important;margin-bottom:5px!important}
  input{height:50px!important}
  .toggle{top:5px!important;height:40px!important}
  .submit{height:52px!important;min-height:52px!important;font-size:13px!important}
  .security-note{font-size:10px!important;margin-top:12px!important;padding-top:11px!important}
  .page-footer{margin:14px 0 0!important}
}

/* Small-width phones */
@media screen and (max-width:390px){
  .scene{height:185px!important;min-height:185px!important;max-height:185px!important}
  .brand-copy h1{font-size:23px!important}
  .login-side{min-height:calc(100dvh - 170px)!important;margin-top:-15px!important;padding-left:10px!important;padding-right:10px!important}
  .login-card{padding:20px 18px 17px!important}
  h2{font-size:27px!important}
  input{height:47px!important}
  .submit{height:49px!important;min-height:49px!important}
}


/* v6 — mobile only: use the previously empty lower area for the hero + login card */
@media screen and (max-width:760px){
  .scene{
    height:255px!important;
    min-height:255px!important;
    max-height:255px!important;
  }
  .brand-copy{bottom:28px!important}
  .brand-copy h1{font-size:27px!important}

  .login-side{
    min-height:calc(100dvh - 235px)!important;
    margin-top:-20px!important;
    padding:0 14px 14px!important;
  }
  .login-card{
    padding:30px 25px 27px!important;
    border-radius:24px!important;
  }
  .card-kicker{font-size:8px!important}
  h2{font-size:32px!important;margin:7px 0 4px!important}
  .intro{font-size:13px!important;margin-bottom:22px!important}

  .field{margin-bottom:16px!important}
  label{font-size:12px!important;margin-bottom:7px!important}
  input{height:56px!important}
  .toggle{top:8px!important;height:40px!important}
  .submit{height:58px!important;min-height:58px!important;font-size:14px!important}

  .security-note{
    margin-top:18px!important;
    padding-top:16px!important;
    padding-bottom:2px!important;
    font-size:10px!important;
  }
  .page-footer{margin:15px 0 0!important}
}

@media screen and (max-width:390px){
  .scene{
    height:225px!important;
    min-height:225px!important;
    max-height:225px!important;
  }
  .brand-copy h1{font-size:25px!important}
  .login-side{
    min-height:calc(100dvh - 208px)!important;
    margin-top:-17px!important;
    padding-left:10px!important;
    padding-right:10px!important;
  }
  .login-card{padding:25px 20px 22px!important}
  h2{font-size:29px!important}
  .intro{margin-bottom:18px!important}
  .field{margin-bottom:13px!important}
  input{height:52px!important}
  .submit{height:54px!important;min-height:54px!important}
  .security-note{margin-top:14px!important;padding-top:13px!important}
}

/* self-registration entry */
.register-link{display:block;margin:11px 0 0;text-align:center;color:var(--forest);font-size:11px;font-weight:650;text-decoration:none}
.register-link:hover{text-decoration:underline}
@media screen and (max-width:760px){.register-link{font-size:12px;margin-top:13px}}

.account-links{display:flex;justify-content:space-between;gap:14px;flex-wrap:wrap}.account-links .register-link{margin-top:10px}
