:root{
  --brand:#0F8B5B; --brand-dark:#0B7049; --brand-soft:#E6F4EE;
  --bg:#F3F6FA; --card:#FFFFFF; --text:#1B2430; --muted:#8A94A6; --line:#E3E8EF;
  --danger:#E5484D; --radius:28px;
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased}
a{color:var(--brand);text-decoration:none}
button{font:inherit;cursor:pointer;border:0;background:none;color:inherit}
input{font:inherit;color:inherit}

.shell{max-width:430px;min-height:100vh;margin:0 auto;background:var(--bg);position:relative;display:flex;flex-direction:column;box-shadow:0 0 40px rgba(20,40,80,.06)}
.topbar{height:52px;display:flex;align-items:center;justify-content:center;position:sticky;top:0;background:var(--card);z-index:5;border-bottom:1px solid var(--line)}
.topbar h1{font-size:18px;font-weight:700;color:var(--brand)}
.topbar .back{position:absolute;left:8px;top:6px;width:40px;height:40px;display:grid;place-items:center;border-radius:50%;color:var(--text)}
.topbar .back:active{background:var(--bg)}
.content{flex:1;padding:24px 28px 32px}

.brand{display:flex;flex-direction:column;align-items:center;margin:28px 0 30px}
.brand .logo{width:108px;height:108px;border-radius:30px;background:linear-gradient(145deg,#14A26B,#0B7049);display:grid;place-items:center;box-shadow:0 12px 28px rgba(15,139,91,.28)}
.brand .logo svg{width:62px;height:62px}
.brand .name{margin-top:16px;font-size:22px;font-weight:800;letter-spacing:.2px}
.brand .tag{margin-top:4px;font-size:13px;color:var(--muted)}

.page-title{font-size:22px;font-weight:800;margin:4px 0 6px}
.page-sub{font-size:13px;color:var(--muted);margin-bottom:22px}

.field{margin-bottom:14px}
.input{display:flex;align-items:center;gap:10px;height:52px;padding:0 8px 0 18px;background:var(--card);border:1px solid var(--line);border-radius:var(--radius);transition:border-color .15s,box-shadow .15s}
.input:focus-within{border-color:var(--brand);box-shadow:0 0 0 3px rgba(15,139,91,.12)}
.field.has-error .input{border-color:var(--danger);box-shadow:0 0 0 3px rgba(229,72,77,.1)}
.input .ico{width:22px;height:22px;flex:none;color:var(--brand)}
.input input{flex:1;min-width:0;height:100%;border:0;outline:0;background:transparent;font-size:15px}
.input input::placeholder{color:#A9B2C1}
.input .prefix{font-weight:700;color:var(--brand);font-size:15px;padding-right:10px;border-right:1px solid var(--line)}
.input .eye{width:36px;height:36px;display:grid;place-items:center;color:var(--muted);border-radius:50%;flex:none}
.input .eye svg{width:20px;height:20px}
.input .send{flex:none;height:34px;min-width:72px;padding:0 12px;border-radius:17px;background:var(--brand);color:#fff;font-size:13px;font-weight:700}
.input .send:disabled{background:#9CCFB8;cursor:default}
.err{display:none;font-size:12px;color:var(--danger);padding:6px 18px 0}
.field.has-error .err{display:block}
.hint{font-size:12px;color:var(--muted);padding:6px 18px 0}

.row{display:flex;align-items:center;justify-content:space-between;margin:4px 4px 18px;font-size:14px}
.link{color:var(--brand);font-weight:600}
.check{display:inline-flex;align-items:center;gap:8px;color:var(--text);font-size:14px;cursor:pointer;user-select:none}
.check input{position:absolute;opacity:0;width:1px;height:1px}
.check .box{width:18px;height:18px;border:1.5px solid #B8C2D0;border-radius:5px;display:grid;place-items:center;transition:.15s;flex:none}
.check .box svg{width:12px;height:12px;color:#fff;opacity:0}
.check input:checked + .box{background:var(--brand);border-color:var(--brand)}
.check input:checked + .box svg{opacity:1}
.check input:focus-visible + .box{box-shadow:0 0 0 3px rgba(15,139,91,.2)}
.agree{justify-content:center;margin:0 0 16px;font-size:13px;color:var(--muted)}
.agree.shake{animation:shake .35s}
@keyframes shake{25%{transform:translateX(-5px)}50%{transform:translateX(5px)}75%{transform:translateX(-3px)}}

.btn{width:100%;height:52px;border-radius:26px;background:var(--brand);color:#fff;font-size:17px;font-weight:700;display:flex;align-items:center;justify-content:center;gap:10px;box-shadow:0 8px 20px rgba(15,139,91,.25);transition:background .15s,transform .05s}
.btn:hover{background:var(--brand-dark)}
.btn:active{transform:scale(.99)}
.btn:disabled{opacity:.7;cursor:default}
.btn.ghost{background:var(--brand-soft);color:var(--brand);box-shadow:none}
.spinner{width:18px;height:18px;border:2.5px solid rgba(255,255,255,.4);border-top-color:#fff;border-radius:50%;animation:spin .7s linear infinite;display:none}
.btn.loading .spinner{display:block}
@keyframes spin{to{transform:rotate(360deg)}}

.foot{text-align:center;margin-top:22px;font-size:14px;color:var(--muted)}
.foot a{font-weight:600}
.version{position:fixed;right:12px;bottom:8px;font-size:11px;color:#B3BCCB}

.toast{position:fixed;left:50%;top:18px;transform:translate(-50%,-30px);opacity:0;pointer-events:none;background:#1B2430;color:#fff;padding:11px 18px;border-radius:12px;font-size:14px;max-width:88vw;z-index:50;transition:.25s;box-shadow:0 8px 24px rgba(0,0,0,.18)}
.toast.show{opacity:1;transform:translate(-50%,0)}
.toast.ok{background:var(--brand)}
.toast.bad{background:var(--danger)}

.doc{font-size:14px;line-height:1.7;color:#3A4556}
.doc h2{font-size:16px;margin:18px 0 6px;color:var(--text)}
.doc p{margin-bottom:8px}

.card{background:var(--card);border-radius:18px;padding:18px;margin-bottom:14px;border:1px solid var(--line)}
.kv{display:flex;justify-content:space-between;font-size:14px;padding:6px 0}
.kv span:first-child{color:var(--muted)}

/* ===== Reference-style auth pages ===== */
.ref{background:#F3F6FA}
.ref .shell{max-width:390px;background:#F6F8FB;box-shadow:0 0 24px rgba(20,40,80,.05)}
.ref .rlogo{display:block;width:180px;height:180px;margin:72px auto 54px}
.ref .rform{width:280px;margin:0 auto}
.ref .field{margin-bottom:14px}
.ref .input{height:46px;padding:0 6px 0 15px;border-radius:23px;border:1px solid #E6EAF0;background:#fff;gap:9px}
.ref .input:focus-within{box-shadow:none;border-color:#BFD9CC}
.ref .input .ico{width:26px;height:26px;color:#2B2F36}
.ref.login .input input{font-size:20px;font-weight:700}
.ref.login .input input::placeholder{color:#CDD1D7;font-weight:700}
.ref .input .send{height:30px;min-width:56px;border-radius:6px;font-size:14px;background:#0F8B5B}
.ref .input .send:disabled{background:#8FCFB1}
.ref .err{padding:4px 15px 0}
.ref .rrow{display:flex;justify-content:space-between;align-items:center;padding:0 3px;margin:2px 0 32px;font-size:14px}
.ref .ulink{color:#0F8B5B;text-decoration:underline;text-underline-offset:2px}
.ref .radio{display:inline-flex;align-items:center;gap:6px;color:#0F8B5B;font-size:14px;cursor:pointer;user-select:none}
.ref .radio input{position:absolute;opacity:0;width:1px;height:1px}
.ref .radio .dot{width:15px;height:15px;border:1px solid #BFC5CE;border-radius:50%;display:grid;place-items:center;background:#fff;flex:none}
.ref .radio .dot::after{content:"";width:9px;height:9px;border-radius:50%;background:#0F8B5B;transform:scale(0);transition:transform .12s}
.ref .radio input:checked + .dot{border-color:#0F8B5B}
.ref .radio input:checked + .dot::after{transform:scale(1)}
.ref .ragree{display:flex;justify-content:center;align-items:center;font-size:15px;color:#0F8B5B;margin-bottom:6px}
.ref .ragree.shake{animation:shake .35s}
.ref .btn{height:45px;border-radius:23px;font-size:18px;box-shadow:none;background:#0F8B5B}
.ref .rforget{display:block;text-align:center;margin:36px 0 40px;font-size:14px}
.ref .version{right:18px;bottom:10px;font-size:12px;color:#A7AFBB}

.ref.register .rhead{height:44px;background:#fff;display:flex;align-items:center;justify-content:center;font-size:20px;font-weight:700;color:#0F8B5B}
.ref.register .rform{margin-top:13px}
.ref.register .input{height:48px;border-radius:12px;border-color:#DDE3EA;padding-left:20px;gap:14px}
.ref.register .input .ico{width:24px;height:24px;color:#0F8B5B}
.ref.register .input input{font-size:16px}
.ref.register .input input::placeholder{color:#9AA4B2}
.ref.register .input .prefix{border-right:1px solid #DDE3EA;padding-right:10px;font-size:16px}
.ref.register .btn{height:47px;border-radius:24px;margin-top:6px}
