:root {
  --bg:#fdf8f0; --surface:#ffffff; --surface2:#f5ede0;
  --accent:#e8622a; --accent2:#f5a623; --blue:#2d6be4;
  --green:#27a96c; --red:#e03e3e;
  --text:#1a1a2e; --muted:#8b8fa8; --border:#e8e0d5; --thai:#c0392b;
}
*{margin:0;padding:0;box-sizing:border-box;-webkit-tap-highlight-color:transparent;}
a,button,select,input,textarea,label,[role=button],[tabindex]{outline:none;}
a:focus,button:focus,[role=button]:focus{outline:none;}
a:focus-visible,button:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}
html{background:var(--bg);overflow-x:hidden;}
body{
  background:var(--bg);
  color:var(--text);
  font-family:'Noto Sans KR',sans-serif;
  min-height:100vh;
  padding:0 0 30px;
  font-size:14px;
  overflow-x:hidden;
}

/* ─── 모바일 기준 + 데스크탑에서 가운데 정렬 ─────────────────────────── */
.wrap{
  max-width:420px;
  margin-left:auto;
  margin-right:auto;
  padding-left:14px;
  padding-right:14px;
}

/* 태블릿/데스크탑 — 좌우 여유 확장 */
@media (min-width: 640px) {
  .wrap { max-width: 600px; }
}
@media (min-width: 960px) {
  .wrap { max-width: 680px; }
}

/* HEADER — 본문(.wrap)과 동일한 max-width 가운데 정렬 (콘텐츠 정렬).
   border-bottom 라인만 ::after pseudo-element로 100vw 확장 */
.auth-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  padding:8px 14px 12px;
  margin:0 auto 14px;
  max-width:420px;
  position:relative;
}
.auth-header::after{
  content:'';
  position:absolute;
  left:50%;
  bottom:0;
  transform:translateX(-50%);
  width:100vw;
  height:2px;
  background:var(--border);
}
@media (min-width: 640px){ .auth-header{ max-width:600px; } }
@media (min-width: 960px){ .auth-header{ max-width:680px; } }
.auth-logo{font-size:17px;font-weight:900;text-decoration:none;color:var(--text);line-height:1.2;}
.auth-logo span{color:var(--accent);}
.auth-logo .thai-logo{font-family:'Sarabun',sans-serif;color:var(--thai);font-size:11px;display:block;font-weight:600;margin-top:2px;}
.auth-header-right{display:flex;align-items:center;gap:6px;}
.user-greet{font-size:12px;color:var(--muted);font-weight:700;}
.user-greet b{color:var(--text);}
.hbtn, .back-btn {
  background:none;
  border:1px solid var(--border);
  color:var(--muted);
  border-radius:20px;
  padding:5px 12px;
  font-family:inherit;
  font-size:11px;
  font-weight:700;
  cursor:pointer;
  text-decoration:none;
  display:inline-block;
  line-height:1.3;
  white-space:nowrap;
}
.hbtn:hover, .back-btn:hover{border-color:var(--accent);color:var(--accent);}
.hbtn.primary{background:var(--accent);color:white;border-color:var(--accent);}
.hbtn.primary:hover{opacity:0.9;color:white;}

/* 페이지 제목 라벨 (헤더 아래, 카드 위) */
.page-title{font-size:16px;font-weight:900;color:var(--text);padding:4px 0 12px;display:flex;align-items:center;gap:6px;flex-wrap:wrap;}
.page-title .pt-sub{font-size:11px;color:var(--muted);font-weight:600;margin-left:auto;}
.page-title .pt-note{font-size:11px;color:var(--muted);font-weight:600;}

/* 메인 상단 공지 노출 라인 */
.notice-bar{background:#fff8ee;border:1.5px solid var(--accent);border-radius:11px;padding:6px 4px;margin-bottom:12px;}
.notice-line{display:flex;align-items:center;gap:8px;padding:6px 10px;text-decoration:none;color:var(--text);border-radius:7px;}
.notice-line:hover{background:#fff3e0;}
.notice-line .nb-icon{font-size:14px;flex-shrink:0;}
.notice-line .nb-title{flex:1;min-width:0;font-size:13px;font-weight:700;word-break:break-word;}
.notice-line .nb-arr{color:var(--accent);font-weight:900;flex-shrink:0;}

/* 공지 모달 */
.notice-modal{position:fixed;inset:0;background:rgba(0,0,0,0.55);z-index:1000;display:flex;align-items:flex-start;justify-content:center;padding:40px 14px;overflow-y:auto;}
.notice-modal[hidden]{display:none;}
.nm-panel{background:#fff;border-radius:14px;max-width:560px;width:100%;padding:18px 20px 16px;box-shadow:0 14px 60px rgba(0,0,0,0.3);}
.nm-head{display:flex;align-items:center;gap:10px;border-bottom:2px solid var(--border);padding-bottom:10px;margin-bottom:12px;}
.nm-title{flex:1;font-size:16px;font-weight:900;word-break:break-word;}
.nm-close{background:transparent;border:none;font-size:18px;cursor:pointer;color:var(--muted);padding:4px 8px;border-radius:6px;}
.nm-close:hover{background:var(--surface2);color:var(--text);}
.nm-meta{font-size:11px;color:var(--muted);margin-bottom:12px;}
.nm-body{font-size:14px;line-height:1.7;color:var(--text);word-break:break-word;}
.nm-body img{max-width:100%;height:auto;border-radius:6px;margin:6px 0;}
.nm-body p{margin:8px 0;}
.nm-body a{color:var(--blue);text-decoration:underline;}
.nm-attachments{margin-top:14px;padding-top:10px;border-top:1px solid var(--border);}
.nm-att-title{font-size:12px;font-weight:700;color:var(--muted);margin-bottom:6px;}
.nm-att-item{display:flex;align-items:center;gap:6px;padding:6px 10px;background:var(--surface2);border-radius:8px;text-decoration:none;color:var(--text);font-size:12px;font-weight:600;margin-bottom:4px;}
.nm-att-item:hover{background:#eaf2ff;color:var(--blue);}
.nm-att-size{color:var(--muted);font-size:10px;margin-left:auto;font-weight:700;}

/* WRAP / CARDS */
.wrap{margin-top:10px;margin-bottom:30px;}
.card{
  background:var(--surface);
  border:1.5px solid var(--border);
  border-radius:16px;
  padding:18px 16px;
  margin-bottom:12px;
}
.card h2{font-size:16px;font-weight:900;margin-bottom:3px;}
.card .sub{font-size:11px;color:var(--muted);font-weight:600;margin-bottom:14px;}

/* FORMS */
.field{display:flex;flex-direction:column;gap:4px;margin-bottom:10px;}
.field label{font-size:11px;font-weight:700;color:var(--muted);display:flex;justify-content:space-between;align-items:center;line-height:1.3;}
.field label .hint{font-size:10px;font-weight:600;color:var(--muted);}
.field .row{display:flex;gap:5px;}
.field input{
  flex:1;
  background:var(--surface2);
  border:1.5px solid var(--border);
  border-radius:9px;
  padding:7px 11px;
  font-size:13px;
  font-family:inherit;
  color:var(--text);
  outline:none;
  width:100%;
  line-height:1.4;
}
.field input:focus{border-color:var(--accent);}
.field input[readonly]{background:#eee;color:var(--muted);}
.field .check-btn{
  background:var(--blue);
  color:white;
  border:none;
  border-radius:9px;
  padding:0 11px;
  font-family:inherit;
  font-size:11px;
  font-weight:700;
  cursor:pointer;
  flex-shrink:0;
  white-space:nowrap;
}
.field .check-btn:disabled{opacity:0.5;cursor:not-allowed;}
.field .msg{font-size:10px;font-weight:600;line-height:1.4;}
.field .msg.ok{color:var(--green);}
.field .msg.err{color:var(--red);}

.btn-primary{
  width:100%;
  background:var(--accent);
  color:white;
  border:none;
  border-radius:10px;
  padding:10px;
  font-family:inherit;
  font-weight:700;
  font-size:14px;
  cursor:pointer;
  margin-top:4px;
}
.btn-primary:hover{opacity:0.9;}
.btn-primary:disabled{opacity:0.5;cursor:not-allowed;}

.btn-secondary{
  display:block;
  text-align:center;
  width:100%;
  background:var(--surface);
  color:var(--accent);
  border:1.5px solid var(--accent);
  border-radius:10px;
  padding:9px;
  font-family:inherit;
  font-weight:700;
  font-size:14px;
  cursor:pointer;
  text-decoration:none;
}
.btn-secondary:hover{background:var(--surface2);}

/* SELECT (대비) */
select{
  background:var(--surface2) url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8.2L1.4 3.6 2.6 2.4 6 5.8l3.4-3.4 1.2 1.2z'/%3E%3C/svg%3E") no-repeat right 10px center;
  background-size:11px 11px;
  border:1.5px solid var(--border);
  border-radius:9px;
  padding:7px 30px 7px 11px;
  font-size:13px;
  font-family:inherit;
  color:var(--text);
  outline:none;
  -webkit-appearance:none;
  -moz-appearance:none;
  appearance:none;
  width:100%;
  cursor:pointer;
}
select:focus{border-color:var(--accent);background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23e8622a' d='M6 8.2L1.4 3.6 2.6 2.4 6 5.8l3.4-3.4 1.2 1.2z'/%3E%3C/svg%3E");}
/* IE/구버전 엣지에서 기본 화살표 제거 */
select::-ms-expand{display:none;}

/* ALERTS */
.alert{border-radius:9px;padding:8px 11px;font-size:12px;font-weight:600;margin-bottom:11px;line-height:1.5;}
.alert.err{background:#fde8e8;color:var(--red);}
.alert.ok{background:#e8f8f0;color:var(--green);}
.alert.info{background:#eaf2ff;color:var(--blue);}
.alert ul{margin:0;padding-left:16px;}
.alert li{margin-top:2px;}

/* LINKS */
.link-row{text-align:center;margin-top:12px;font-size:12px;color:var(--muted);}
.link-row a{color:var(--accent);font-weight:700;text-decoration:none;}
.link-row a:hover{text-decoration:underline;}

/* SECTION */
.divider{border-top:1px solid var(--border);margin:14px 0;}
.section-title{font-size:12px;font-weight:700;color:var(--muted);letter-spacing:0.5px;margin-bottom:10px;}

/* RECAPTCHA — 모바일에서 깔끔하게 */
.g-recaptcha{transform:scale(0.9);transform-origin:0 0;}

/* MENU CARD — 마이페이지/대시보드 공용 */
.menu-card{
  display:flex;align-items:center;gap:10px;
  background:var(--surface);border:1.5px solid var(--border);border-radius:12px;
  padding:11px 12px;margin-bottom:8px;
  cursor:pointer;text-decoration:none;color:var(--text);
  transition:all 0.15s;
}
.menu-card:hover{border-color:var(--accent);}
.menu-card.disabled{cursor:default;opacity:0.65;}
.menu-card.disabled:hover{border-color:var(--border);}
.mc-icon{font-size:22px;flex-shrink:0;width:36px;text-align:center;}
.mc-body{flex:1;min-width:0;}
.mc-title{font-size:13px;font-weight:900;display:flex;align-items:center;gap:5px;flex-wrap:wrap;}
.mc-desc{font-size:11px;color:var(--muted);font-weight:600;margin-top:2px;}
.mc-arrow{font-size:18px;color:var(--muted);flex-shrink:0;}
.mc-badge{display:inline-block;background:var(--surface2);color:var(--muted);border-radius:8px;padding:1px 6px;font-size:9px;font-weight:700;}
.mc-badge.pending{background:#fff3e0;color:var(--accent);}
.mc-badge.approved{background:#e8f8f0;color:var(--green);}
.mc-badge.expired{background:#fde8e8;color:var(--red);}

/* 라디오 그룹 */
.radio-group{display:flex;gap:6px;flex-wrap:wrap;}
.radio-group label{display:flex;align-items:center;gap:4px;padding:7px 11px;background:var(--surface2);border:1.5px solid var(--border);border-radius:9px;font-size:12px;font-weight:700;cursor:pointer;}
.radio-group label:has(input:checked){border-color:var(--accent);background:#fff3e0;color:var(--accent);}

/* 인라인 체크박스 (입금금액 좌측 소득공제 등) */
.tax-chk{display:flex;align-items:center;gap:5px;padding:0 10px;background:var(--surface2);border:1.5px solid var(--border);border-radius:9px;font-size:12px;font-weight:700;color:var(--muted);cursor:pointer;white-space:nowrap;flex-shrink:0;}
.tax-chk:has(input:checked){border-color:var(--accent);background:#fff3e0;color:var(--accent);}
