:root {
    --primary: #0b5ed7;
    --primary-dark: #084298;
    --danger: #dc3545;
    --success: #198754;
    --warning: #ffc107;
    --bg: #f4f6fb;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #e5e7eb;
    --shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.header {
    background: linear-gradient(135deg, #0b5ed7, #153e8a);
    color: white;
    padding: 30px 20px;
    text-align: center;
}
.header h1 { margin: 0; font-size: 26px; font-weight: 800; }
.header p { margin: 8px 0 0; opacity: .9; }
.container { max-width: 1040px; margin: 28px auto; padding: 0 20px; }
.card { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 28px; }
.notice { background: #eef5ff; border: 1px solid #cfe2ff; color: #084298; border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; white-space: nowrap; box-sizing: border-box; }
.error-box { background: #fff1f2; border: 1px solid #fecdd3; color: #9f1239; border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; }
.success-box { background: #ecfdf5; border: 1px solid #bbf7d0; color: #166534; border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-row { display: flex; flex-direction: column; gap: 7px; }
.form-row.full { grid-column: 1 / -1; }
label { font-weight: 700; }
.required { color: var(--danger); }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="file"], select, textarea {
    width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; font-size: 15px; background: white;
}
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(11,94,215,.15); border-color: var(--primary); }
.help { color: var(--muted); font-size: 13px; }
.checkbox-line { display: flex; gap: 10px; align-items: flex-start; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.btn-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 22px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 18px; border-radius: 12px; border: 0; cursor: pointer; font-weight: 800; font-size: 15px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-light { background: #f3f4f6; color: #111827; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: #f59e0b; color: white; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.topbar h2 { margin: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 900px; background: white; }
th, td { padding: 12px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: #f8fafc; font-size: 14px; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 800; }
.badge-wait { background: #fff7ed; color: #9a3412; }
.badge-ok { background: #dcfce7; color: #166534; }
.badge-no { background: #fee2e2; color: #991b1b; }
.search-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.search-form input, .search-form select { max-width: 220px; }
.detail-grid { display: grid; grid-template-columns: 180px 1fr; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.detail-grid div { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.detail-grid div:nth-child(odd) { background: #f8fafc; font-weight: 800; }
.detail-grid div:nth-last-child(-n+2) { border-bottom: 0; }
.footer { text-align: center; color: var(--muted); padding: 30px 15px; font-size: 13px; }

@media (max-width: 720px) {
    .header { padding: 24px 14px; }
    .header h1 { font-size: 20px; line-height: 1.35; }
    .container { margin: 18px auto; padding: 0 12px; }
    .card { border-radius: 14px; padding: 18px; }
    .notice { white-space: normal; }
    .form-grid { grid-template-columns: 1fr; gap: 14px; }
    .btn { width: 100%; }
    .btn-row { flex-direction: column; align-items: stretch; }
    .topbar { flex-direction: column; align-items: stretch; }
    .search-form input, .search-form select { max-width: none; width: 100%; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-grid div:nth-child(odd) { border-bottom: 0; padding-bottom: 4px; }
    .detail-grid div:nth-child(even) { padding-top: 4px; }
    .detail-grid div:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
    .detail-grid div:last-child { border-bottom: 0; }
}

.login-card { max-width: 900px; margin: 0 auto; }
.label-with-action { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.info-btn {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 0;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
    cursor: pointer;
    line-height: 1;
}
.info-btn:hover { background: var(--primary-dark); }
.modal-open { overflow: hidden; }
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
.modal-box {
    width: min(860px, 100%);
    max-height: 92vh;
    overflow: auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0,0,0,.25);
    padding: 22px;
}
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
    margin-bottom: 16px;
}
.modal-head h2 { margin: 0; font-size: 22px; }
.modal-close {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: #f3f4f6;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}
.modal-body p { margin: 0 0 14px; }
.example-wrap {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    background: #f8fafc;
}
.example-image {
    display: block;
    width: 100%;
    max-height: 620px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-top: 8px;
}
.modal-actions { justify-content: flex-end; }
.file-current { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
input[readonly] { background: #f8fafc; color: #6b7280; }

@media (max-width: 720px) {
    .modal-backdrop { padding: 10px; align-items: flex-start; }
    .modal-box { border-radius: 14px; padding: 16px; margin-top: 8px; }
    .modal-head h2 { font-size: 18px; }
    .example-image { max-height: 520px; }
    .file-current { align-items: stretch; flex-direction: column; }
}

/* 관리자 가입희망자 목록: PC에서는 모든 제목/값이 한 줄로 보이도록 폭과 줄바꿈을 보정 */
.admin-container { max-width: 1480px; }
.admin-list-table { min-width: 1320px; table-layout: fixed; }
.admin-list-table th,
.admin-list-table td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-list-table .col-id { width: 64px; }
.admin-list-table .col-status { width: 88px; }
.admin-list-table .col-login { width: 135px; }
.admin-list-table .col-name { width: 95px; }
.admin-list-table .col-gender { width: 75px; }
.admin-list-table .col-birth { width: 118px; }
.admin-list-table .col-email { width: 245px; }
.admin-list-table .col-phone { width: 145px; }
.admin-list-table .col-party { width: 80px; }
.admin-list-table .col-date { width: 180px; }
.admin-list-table .col-manage { width: 95px; }

@media (max-width: 720px) {
    .admin-container { max-width: 100%; }
    .admin-list-table { min-width: 0; table-layout: auto; border-collapse: separate; border-spacing: 0 12px; }
    .admin-list-table colgroup,
    .admin-list-table thead { display: none; }
    .admin-list-table,
    .admin-list-table tbody,
    .admin-list-table tr,
    .admin-list-table td { display: block; width: 100%; }
    .admin-list-table tr {
        border: 1px solid var(--line);
        border-radius: 14px;
        background: #fff;
        padding: 10px 12px;
        box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    }
    .admin-list-table td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 14px;
        padding: 8px 0;
        border-bottom: 1px solid #eef2f7;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        word-break: break-word;
        text-align: right;
    }
    .admin-list-table td:last-child { border-bottom: 0; }
    .admin-list-table td::before {
        content: attr(data-label);
        flex: 0 0 88px;
        color: var(--muted);
        font-weight: 800;
        text-align: left;
    }
    .admin-list-table td .btn { width: auto; min-width: 92px; }
}

/* 가입정보 확인/수정 로그인 화면 전용 폭 보정
   - 안내문 배경은 문장 길이에 맞춤
   - 아이디/가입자명 입력폼은 과도하게 길어지지 않도록 로그인 카드 폭 축소
   - 모바일에서는 화면폭에 맞게 자동 줄바꿈 */
.login-card {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.login-card .notice {
    display: inline-block;
    width: auto;
    max-width: 100%;
    white-space: nowrap;
    box-sizing: border-box;
}

.login-card input[type="text"],
.login-card input[type="password"],
.login-card input[type="email"],
.login-card input[type="tel"],
.login-card select,
.login-card textarea {
    width: 100%;
}

@media (max-width: 720px) {
    .login-card {
        max-width: 100%;
    }

    .login-card .notice {
        display: block;
        width: 100%;
        white-space: normal;
    }
}

/* 가입정보 확인/수정 로그인 카드 폭 조절 */
.card.login-card {
    width: fit-content;
    max-width: 900px;
    min-width: 0;
    margin-left: auto;
    margin-right: auto;
}

/* 로그인 카드 안쪽 실제 내용 폭 */
.card.login-card .notice,
.card.login-card .form-grid,
.card.login-card .btn-row {
    width: 620px;
    max-width: 100%;
}

/* 아이디 / 가입자명 입력폼 폭 */
.card.login-card .form-row input[type="text"] {
    width: 100%;
    max-width: 100%;
}

/* 스마트폰 화면에서는 전체 폭 사용 */
@media (max-width: 720px) {
    .card.login-card {
        width: 100%;
        max-width: 100%;
    }

    .card.login-card .notice,
    .card.login-card .form-grid,
    .card.login-card .btn-row {
        width: 100%;
        max-width: 100%;
    }
}
