/* register_otp.css — สไตล์หน้า register_otp.php (สมัครด้วยเบอร์โทร + OTP) */
:root{
  --bg:#fff0f6; --card:#ffffff; --text:#2a1622; --muted:#7a6470; --line:#f1dce6;
  --accent:#d92b78; --accent-d:#b81e63; --accent-soft:#ffe3ef;
  --ok:#12a150; --err:#d92d4a; --r:14px;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0; min-height:100vh; min-height:100dvh; padding:16px; padding-bottom:max(16px, env(safe-area-inset-bottom));
  display:grid; place-items:start center;
  background:var(--bg); color:var(--text);
  font-family:"Noto Sans Thai",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  font-size:15px; line-height:1.5;
}
.shell{width:100%; max-width:480px}
.card{
  width:100%; background:var(--card); border-radius:22px;
  padding:22px 18px 24px; box-shadow:0 10px 40px rgba(190,40,110,.14);
}
.side{display:none}
.side-brand{display:flex; align-items:center; gap:10px; font-weight:700; font-size:22px; letter-spacing:.4px; position:relative; z-index:1}
.side-brand img{height:42px; width:auto; border-radius:10px; display:block}
.side-body{position:relative; z-index:1}
.side h2{font-size:30px; line-height:1.3; margin:0 0 12px}
.side p{margin:0; font-size:16px; opacity:.92}
.side-steps{counter-reset:s; list-style:none; padding:0; margin:30px 0 0}
.side-steps li{counter-increment:s; display:flex; gap:12px; align-items:center; margin:14px 0; font-weight:500}
.side-steps li::before{
  content:counter(s); width:30px; height:30px; border-radius:50%; background:rgba(255,255,255,.24);
  display:grid; place-items:center; font-weight:700; flex:none;
}
.side-foot{position:relative; z-index:1; font-size:13px; opacity:.8}
.side::before, .side::after{content:""; position:absolute; border-radius:50%; background:rgba(255,255,255,.10)}
.side::before{width:340px; height:340px; right:-120px; top:-110px}
.side::after{width:260px; height:260px; left:-90px; bottom:-90px}
.top{display:flex; align-items:center; justify-content:space-between; margin-bottom:18px}
.brand{display:flex; align-items:center; gap:8px; font-weight:700; font-size:18px; letter-spacing:.3px}
.brand img{height:34px; width:auto; border-radius:8px; display:block}
.lang{display:flex; border:1px solid var(--line); border-radius:999px; overflow:hidden}
.lang button{
  border:0; background:transparent; padding:5px 12px; font:inherit; font-size:13px;
  color:var(--muted); cursor:pointer;
}
.lang button.on{background:var(--accent); color:#fff}

/* stepper */
.stepper{display:flex; gap:8px; margin:0 0 22px; padding:0; list-style:none}
.stepper li{flex:1; font-size:12px; color:var(--muted)}
.stepper li::before{content:""; display:block; height:4px; border-radius:4px; background:var(--line); margin-bottom:6px}
.stepper li.active{color:var(--accent); font-weight:600}
.stepper li.active::before, .stepper li.done::before{background:var(--accent)}
.stepper li.done{color:var(--text)}

h1{font-size:22px; margin:0 0 4px}
.sub{margin:0 0 20px; color:var(--muted); font-size:14px}

.field{margin-bottom:16px}
label.lbl{display:block; font-weight:600; font-size:14px; margin-bottom:6px}
input[type=text], input[type=tel], input[type=password], select{
  width:100%; height:48px; padding:0 14px; font:inherit; font-size:16px; color:var(--text);
  background:#fff; border:1.5px solid var(--line); border-radius:var(--r); outline:none;
  transition:border-color .15s, box-shadow .15s;
}
input:focus, select:focus{border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-soft)}
input[readonly]{background:#fbf5f8; color:var(--muted)}
.phone-row{display:flex; gap:8px}
.phone-row select{width:118px; flex:none; padding:0 8px}
.hint{margin:6px 2px 0; font-size:12.5px; color:var(--muted)}
.msg-err{margin:6px 2px 0; font-size:13px; font-weight:700; color:var(--err); min-height:0}
.msg-err:empty{display:none}
#phoneErr{min-height:20px}                 /* จองที่ไว้ ข้อความขึ้นแล้วช่องอื่นไม่ขยับ */
#phoneErr:empty{display:block}
.field.bad input, .field.bad select{border-color:var(--err)}

.check{display:flex; gap:10px; align-items:flex-start; font-size:13.5px; margin:4px 0 16px}
.check input{width:20px; height:20px; margin:2px 0 0; accent-color:var(--accent); flex:none}
.check a{color:var(--accent); text-decoration:none; font-weight:500}
.check a:hover{text-decoration:underline}


.btn{
  width:100%; height:50px; border:0; border-radius:var(--r); background:var(--accent); color:#fff;
  font:inherit; font-size:16px; font-weight:600; cursor:pointer; transition:background .15s, opacity .15s;
  display:flex; align-items:center; justify-content:center; gap:8px;
}
.btn:hover:not(:disabled){background:var(--accent-d)}
.btn:disabled{opacity:.4; cursor:not-allowed}
.btn.loading::after{
  content:""; width:16px; height:16px; border-radius:50%;
  border:2.5px solid rgba(255,255,255,.4); border-top-color:#fff; animation:spin .7s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}
.link-btn{
  background:none; border:0; padding:0; font:inherit; color:var(--accent); font-weight:600; cursor:pointer;
}
.link-btn:disabled{color:var(--muted); cursor:not-allowed; font-weight:400}
.foot{margin-top:18px; text-align:center; font-size:14px; color:var(--muted)}
.foot a{color:var(--accent); font-weight:600; text-decoration:none}

/* OTP */
.otp{display:flex; gap:8px; margin:6px 0 8px}
.otp input{
  flex:1; min-width:0; height:56px; padding:0; text-align:center; font-size:24px; font-weight:600;
  border:1.5px solid var(--line); border-radius:12px;
}
.otp.shake{animation:shake .35s}
@keyframes shake{25%{transform:translateX(-6px)}75%{transform:translateX(6px)}}
.otp-meta{display:flex; justify-content:space-between; align-items:center; font-size:13.5px; color:var(--muted); margin:10px 2px 18px}
.otp-meta .expired{color:var(--err)}
.back-row{display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; font-size:14px}

/* password */
.pw{position:relative}
.pw input{padding-right:48px}
.eye{
  position:absolute; right:4px; top:4px; width:40px; height:40px; border:0; background:transparent;
  cursor:pointer; color:var(--muted); border-radius:10px; display:grid; place-items:center;
}
.eye:hover{background:var(--accent-soft); color:var(--accent)}
.rules{list-style:none; margin:10px 2px 0; padding:0; font-size:13px; color:var(--muted)}
.rules li{display:flex; gap:8px; align-items:center; margin:3px 0}
.rules li i{
  width:16px; height:16px; border-radius:50%; border:1.5px solid var(--line); flex:none; position:relative;
}
.rules li.ok{color:var(--ok)}
.rules li.ok i{background:var(--ok); border-color:var(--ok)}
.rules li.ok i::after{
  content:""; position:absolute; left:4.5px; top:1.5px; width:4px; height:8px;
  border:solid #fff; border-width:0 2px 2px 0; transform:rotate(45deg);
}
.rules li.bad{color:var(--err)}
.rules li.bad i{background:var(--err); border-color:var(--err)}
.rules li.bad i::before, .rules li.bad i::after{
  content:""; position:absolute; left:50%; top:50%; width:2px; height:8px; margin:-4px 0 0 -1px; background:#fff;
  transform:rotate(45deg);
}
.rules li.bad i::after{transform:rotate(-45deg)}

.rules .help{
  width:18px; height:18px; padding:0; border:1.5px solid var(--muted); border-radius:50%; background:transparent;
  color:var(--muted); font-weight:700; font-size:11px; line-height:1; font-family:inherit; cursor:pointer; flex:none; display:grid; place-items:center;
}
.rules .help:hover{color:var(--accent); border-color:var(--accent)}

/* done */
.done-wrap{text-align:center; padding:10px 0 4px}
.done-icon{
  width:72px; height:72px; margin:0 auto 14px; border-radius:50%; background:#e7f7ee; display:grid; place-items:center;
}
.done-icon img{width:36px; height:36px; display:block}

.btn:focus-visible, .link-btn:focus-visible, .lang button:focus-visible, .eye:focus-visible{
  outline:3px solid var(--accent); outline-offset:2px;
}

/* tablet / large phone */
@media (min-width:480px){
  .card{padding:30px 30px 30px}
}
/* very small phones */
@media (max-width:359px){
  body{padding:10px}
  .card{padding:18px 14px 20px; border-radius:18px}
  .otp{gap:5px}
  .otp input{height:48px; font-size:20px; border-radius:10px}
  .phone-row select{width:104px}
  h1{font-size:20px}
}
/* desktop: two-column split with pink brand panel */
@media (min-width:860px){
  body{place-items:center; padding:32px}
  .shell{
    max-width:980px; display:grid; grid-template-columns:1fr 1fr;
    background:var(--card); border-radius:28px; overflow:hidden;
    box-shadow:0 24px 70px rgba(190,40,110,.20);
  }
  .card{border-radius:0; box-shadow:none; padding:44px 48px; align-self:center}
  .brand-m{display:none}
  .top{justify-content:flex-end}
  .side{
    display:flex; flex-direction:column; justify-content:space-between; position:relative; overflow:hidden;
    padding:44px; color:#fff; min-height:560px;
    background:linear-gradient(155deg,#ff7eb6 0%,#e6397f 55%,#b81e63 100%);
  }
}
@media (prefers-reduced-motion:reduce){
  *{animation:none !important; transition:none !important}
}

[hidden]{display:none !important}
.sr{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0)}
