/* ============================================================
   계장나라 - 스타일
   ============================================================ */

:root {
  --brand: #1a56db;
  --brand-dark: #1642a8;
  --brand-light: #eef2ff;
  --kakao: #fee500;
  --kakao-text: #191600;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1a2233;
  --text-muted: #6b7280;
  --border: #e2e6ee;
  --danger: #dc2626;
  --success: #059669;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(26, 34, 51, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- 인증 페이지 레이아웃 ---- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-hero {
  background: linear-gradient(140deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  padding: 56px 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.auth-hero .logo {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 24px;
}

.auth-hero h1 {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.auth-hero p {
  font-size: 16px;
  opacity: 0.9;
  max-width: 380px;
}

.hero-features {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-features li {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  opacity: 0.95;
}

.hero-features li::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-card h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.auth-card .sub {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 28px;
}

/* ---- 폼 ---- */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}

.field input {
  width: 100%;
  padding: 13px 15px;
  font-size: 15px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

.field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}

.field input::placeholder {
  color: #aab1bd;
}

/* ---- 버튼 ---- */
.btn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.05s, background 0.15s, box-shadow 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-dark);
}

.btn-kakao {
  background: var(--kakao);
  color: var(--kakao-text);
}

.btn-kakao:hover:not(:disabled) {
  background: #f5dc00;
}

.btn-ghost {
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: #f7f9fc;
}

/* ---- 구분선 ---- */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---- 하단 링크 ---- */
.auth-foot {
  margin-top: 22px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-foot a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.auth-foot a:hover {
  text-decoration: underline;
}

/* ---- 알림 메시지 ---- */
.alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 18px;
  display: none;
}

.alert.show {
  display: block;
}

.alert-error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.alert-success {
  background: #ecfdf5;
  color: var(--success);
  border: 1px solid #a7f3d0;
}

/* ---- 홈(로그인 후) ---- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar .brand {
  font-size: 20px;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -0.5px;
}

.topbar .user {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--text-muted);
}

.btn-sm {
  width: auto;
  padding: 8px 16px;
  font-size: 13px;
}

.home-main {
  max-width: 760px;
  margin: 48px auto;
  padding: 0 24px;
}

.welcome-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  text-align: center;
}

.welcome-card .avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand);
  font-size: 30px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.welcome-card h1 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.welcome-card p {
  color: var(--text-muted);
  margin-bottom: 8px;
}

.info-grid {
  margin-top: 28px;
  text-align: left;
  background: #f9fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px dashed var(--border);
}

.info-row:last-child {
  border-bottom: none;
}

.info-row .k {
  color: var(--text-muted);
  font-weight: 600;
}

.info-row .v {
  color: var(--text);
  font-weight: 600;
  word-break: break-all;
  text-align: right;
  max-width: 60%;
}

/* ---- 로딩 상태 ---- */
.loading-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 15px;
}

/* ---- 공통 푸터 ---- */
.site-footer {
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 22px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
.site-footer .links {
  margin-bottom: 8px;
}
.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
  margin: 0 8px;
}
.site-footer a:hover {
  color: var(--brand);
  text-decoration: underline;
}
.site-footer .copyright {
  opacity: 0.8;
}

/* ---- 법적 문서(약관/개인정보) ---- */
.doc-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}
.doc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.doc-topbar .brand {
  font-size: 20px;
  font-weight: 800;
  color: var(--brand);
  text-decoration: none;
}
.doc-topbar a.back {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
}
.doc-topbar a.back:hover {
  color: var(--brand);
}
.doc {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
}
.doc h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.doc .updated {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 12px;
}
.doc .note {
  background: #fff8e6;
  border: 1px solid #f5e3a3;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: #7a5b00;
  margin-bottom: 26px;
}
.doc h2 {
  font-size: 16px;
  font-weight: 800;
  margin: 26px 0 10px;
  padding-top: 4px;
}
.doc p,
.doc li {
  font-size: 14.5px;
  color: #33404f;
  margin-bottom: 8px;
}
.doc ul,
.doc ol {
  padding-left: 20px;
  margin-bottom: 8px;
}
.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 16px;
  font-size: 13.5px;
}
.doc th,
.doc td {
  border: 1px solid var(--border);
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
}
.doc th {
  background: #f5f7fb;
  font-weight: 700;
}
.doc .highlight {
  color: var(--brand);
  font-weight: 700;
}

/* ---- 대시보드(홈) 확장 ---- */
.section-title {
  font-size: 15px;
  font-weight: 800;
  margin: 8px 0 14px;
  color: var(--text);
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 28px;
}
.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: left;
}
.feature-card .emoji {
  font-size: 26px;
}
.feature-card h3 {
  font-size: 15px;
  font-weight: 800;
  margin: 10px 0 4px;
}
.feature-card p {
  font-size: 13px;
  color: var(--text-muted);
}
.feature-card .soon {
  display: inline-block;
  margin-top: 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-light);
  padding: 3px 8px;
  border-radius: 6px;
}
.edit-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.edit-row label {
  width: 88px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}
.edit-row input {
  flex: 1;
  padding: 10px 12px;
  font-size: 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
}
.edit-row input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}
.profile-hint {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 10px;
}

/* ---- 공통 앱 헤더(내비게이션) ---- */
.topbar .nav {
  display: flex;
  gap: 18px;
  align-items: center;
}
.topbar .nav a {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
}
.topbar .nav a:hover,
.topbar .nav a.active {
  color: var(--brand);
}
.topbar .brand {
  text-decoration: none;
}

/* ---- 게시판 ---- */
.board-main {
  max-width: 900px;
  margin: 32px auto;
  padding: 0 20px 60px;
}
.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.board-head h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.cat-tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.cat-tab:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.cat-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.post-list {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.post-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
}
.post-item:last-child {
  border-bottom: none;
}
.post-item:hover {
  background: #f7f9fc;
}
.post-item .cat {
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-light);
  padding: 3px 9px;
  border-radius: 6px;
  min-width: 66px;
  text-align: center;
}
.post-item .t {
  flex: 1;
  font-weight: 600;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-item .meta {
  flex-shrink: 0;
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: right;
  min-width: 120px;
}
.post-item .meta .views {
  margin-left: 8px;
}

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state .big {
  font-size: 40px;
  margin-bottom: 12px;
}

.pager {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}
.pager button {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
}
.pager button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---- 글쓰기 ---- */
.write-main {
  max-width: 720px;
  margin: 32px auto;
  padding: 0 20px 60px;
}
.write-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.write-card h1 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 20px;
}
.write-card select,
.write-card input,
.write-card textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  margin-bottom: 14px;
  background: #fff;
}
.write-card textarea {
  min-height: 260px;
  resize: vertical;
  line-height: 1.7;
}
.write-card select:focus,
.write-card input:focus,
.write-card textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}
.write-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.write-actions .btn {
  width: auto;
  padding: 12px 22px;
}

/* ---- 게시글 상세 ---- */
.post-main {
  max-width: 760px;
  margin: 32px auto;
  padding: 0 20px 60px;
}
.post-detail {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
.post-detail .cat {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-light);
  padding: 4px 10px;
  border-radius: 6px;
}
.post-detail h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 14px 0 10px;
  line-height: 1.35;
}
.post-detail .post-meta {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.post-detail .body {
  padding: 24px 0;
  font-size: 15.5px;
  line-height: 1.8;
  color: #2b3543;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 120px;
}
.post-detail .owner-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.post-detail .owner-actions .btn {
  width: auto;
  padding: 8px 16px;
  font-size: 13px;
}
.btn-danger {
  background: #fff;
  color: var(--danger);
  border: 1.5px solid #f3c4c4;
}
.btn-danger:hover:not(:disabled) {
  background: #fef2f2;
}

/* ---- 댓글 ---- */
.comments {
  margin-top: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.comments h2 {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 16px;
}
.comment {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.comment:last-of-type {
  border-bottom: none;
}
.comment .c-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.comment .c-author {
  font-weight: 700;
  font-size: 13.5px;
}
.comment .c-time {
  font-size: 12px;
  color: var(--text-muted);
}
.comment .c-body {
  font-size: 14px;
  color: #33404f;
  white-space: pre-wrap;
  word-break: break-word;
}
.comment .c-del {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  margin-left: 8px;
}
.comment .c-del:hover {
  color: var(--danger);
}
.comment-form {
  margin-top: 18px;
  display: flex;
  gap: 10px;
}
.comment-form textarea {
  flex: 1;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  min-height: 46px;
  resize: vertical;
}
.comment-form textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}
.comment-form .btn {
  width: auto;
  padding: 0 20px;
  flex-shrink: 0;
}

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
}
.back-link:hover {
  color: var(--brand);
}

/* ---- 반응형 ---- */
@media (max-width: 860px) {
  .auth-wrap {
    grid-template-columns: 1fr;
  }
  .auth-hero {
    display: none;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .doc {
    padding: 24px;
  }
  .topbar {
    padding: 14px 16px;
  }
  .topbar .nav {
    gap: 12px;
  }
  .post-item .meta {
    min-width: auto;
  }
  .post-item .meta .views {
    display: none;
  }
}
