/* ============================================
   전역 기본값
   ============================================ */
:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1a1d21;
  --text-dim: #6b7280;
  --border: #e2e5ea;
  --accent: #2f6feb;
  --accent-hover: #2559c4;
  --ok: #0f7b45;
  --error: #c02626;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 40px 20px 80px;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
  line-height: 1.6;
}

main {
  max-width: 640px;
  margin: 0 auto;
}

/* ============================================
   헤더
   ============================================ */
.page-header {
  max-width: 640px;
  margin: 0 auto 28px;
}

.page-header h1 {
  margin: 0;
  font-size: 24px;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--text-dim);
  font-size: 14px;
}

/* ============================================
   카드 (섹션 박스)
   ============================================ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.card h2 {
  margin: 0 0 16px;
  font-size: 17px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-header h2 {
  margin: 0;
}

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

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

/* 입력칸 종류가 늘어나도 한 곳에서 관리되도록 묶어둡니다.
   text · tel · email · password · textarea 전부 같은 모양. */
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="password"],
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 15px;
  background: var(--card);
  color: var(--text);
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 111, 235, 0.15);
}

textarea {
  resize: vertical;
}

/* ============================================
   버튼
   ============================================ */
button {
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  background: var(--accent-hover);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 12px;
  font-weight: 500;
}

.btn-secondary:hover {
  background: #f0f2f5;
  color: var(--text);
}

/* ============================================
   글 목록
   ============================================ */
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-item {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.post-item:first-child {
  border-top: none;
  padding-top: 0;
}

.post-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.post-content {
  margin: 4px 0 0;
  color: #3c4147;
  font-size: 14px;
  white-space: pre-wrap;   /* 줄바꿈 그대로 표시 */
}

.post-meta {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 12px;
}

.placeholder {
  color: var(--text-dim);
  font-size: 14px;
  padding: 8px 0;
}

/* ============================================
   상태 메시지
   ============================================ */
.status {
  min-height: 22px;
  margin: 0;
  font-size: 14px;
  text-align: center;
}

.status.ok {
  color: var(--ok);
}

.status.error {
  color: var(--error);
  text-align: left;
  background: #fdf0f0;
  border: 1px solid #f5cfcf;
  border-radius: 6px;
  padding: 12px 14px;
  white-space: pre-wrap;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px;
}

/* ============================================
   신청 페이지 (apply.html)
   ============================================ */
.optional {
  font-weight: 400;
  color: var(--text-dim);
}

/* 안내 상자 */
.notice {
  border-color: var(--border);
}

.notice h2 {
  font-size: 15px;
}

.notice p {
  margin: 0 0 10px;
  font-size: 14px;
}

.notice p:last-child {
  margin-bottom: 0;
}

.dim {
  color: var(--text-dim);
}

code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px;
}

/* ============================================
   다크 모드 (OS 설정을 따라감)
   ============================================ */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181c;
    --card: #1e2126;
    --text: #e8eaed;
    --text-dim: #9aa1ab;
    --border: #2f343b;
    --accent: #4d8bf5;
    --accent-hover: #6b9ff7;
    --ok: #4ade80;
    --error: #f87171;
  }

  input[type="text"],
  input[type="tel"],
  input[type="email"],
  input[type="password"],
  textarea {
    background: #16181c;
  }

  .post-content {
    color: #c8ccd2;
  }

  .btn-secondary:hover {
    background: #272b31;
  }

  .status.error {
    background: #2a1c1c;
    border-color: #4a2b2b;
  }
}
