/* ================================================================
   한국안전교육원 수강신청 시스템 — style.css
   ================================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy:   #1a3f6f;
    --navy-d: #15345c;
    --blue:   #2563eb;
    --red:    #dc2626;
    --green:  #16a34a;
    --orange: #ea580c;
    --gray-1: #f8f9fb;
    --gray-2: #f0f2f5;
    --gray-3: #e5e7eb;
    --gray-6: #6b7280;
    --gray-9: #1a1a1a;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Pretendard', 'Apple SD Gothic Neo', '맑은 고딕', sans-serif;
    background: var(--gray-2);
    color: var(--gray-9);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ── 공지 배너 ───────────────────────────────────────────── */
.notice-banner {
    background: #fff7ed;
    border-bottom: 1px solid #fed7aa;
    padding: 10px 20px;
    font-size: 13.5px;
    color: #9a3412;
    text-align: center;
}
.notice-badge {
    display: inline-block;
    background: var(--orange);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 3px;
    margin-right: 8px;
}

/* ── Header ──────────────────────────────────────────────── */
.site-header {
    background: var(--navy);
    padding: 0 20px;
    height: 58px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.header-inner {
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo-text {
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: .5px;
}
.logo-img {
    height: 52px;
    width: auto;
    display: block;
}
.inquiry-btn {
    color: rgba(255,255,255,.8);
    font-size: 13px;
    padding: 6px 14px;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 6px;
    transition: all .15s;
}
.inquiry-btn:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ── Main wrap ───────────────────────────────────────────── */
.main-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

/* ── Step Indicator ──────────────────────────────────────── */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    position: relative;
    flex: 1;
    min-width: 60px;
}
.step-item + .step-item::before {
    content: '';
    position: absolute;
    left: calc(-50%);
    top: 13px;
    width: 100%;
    height: 2px;
    background: var(--gray-3);
    z-index: 0;
}
.step-item.done + .step-item::before { background: var(--navy); }
.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gray-3);
    color: var(--gray-6);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    transition: all .2s;
}
.step-item.active .step-num { background: var(--navy); color: #fff; }
.step-item.done   .step-num { background: var(--green); color: #fff; }
.step-label {
    font-size: 11px;
    color: var(--gray-6);
    white-space: nowrap;
}
.step-item.active .step-label { color: var(--navy); font-weight: 700; }
.step-item.done   .step-label { color: var(--green); }

/* ── Step Section ─────────────────────────────────────────── */
.step-section { display: none; }
.step-section.active { display: block; }

.step-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 16px rgba(0,0,0,.07);
    padding: 32px 28px;
}
.step-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 24px;
    text-align: center;
}
.step-selected-info {
    text-align: center;
    font-size: 13.5px;
    color: var(--gray-6);
    margin-bottom: 20px;
    padding: 10px;
    background: var(--gray-1);
    border-radius: 8px;
}

/* ── Choice Buttons (과정/업종) ───────────────────────────── */
.btn-choice-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}
.btn-choice {
    height: 80px;
    background: var(--gray-1);
    border: 2px solid var(--gray-3);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-9);
    transition: all .15s;
    padding: 0 12px;
    line-height: 1.4;
    text-align: center;
}
.btn-choice:hover { border-color: var(--navy); color: var(--navy); background: #eff6ff; }
.btn-choice.selected { border-color: var(--navy); background: #dbeafe; color: var(--navy); }

/* ── Region Grid ─────────────────────────────────────────── */
.region-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.btn-region {
    height: 46px;
    background: var(--gray-1);
    border: 1.5px solid var(--gray-3);
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-9);
    transition: all .15s;
}
.btn-region:hover { border-color: var(--navy); color: var(--navy); }
.btn-region.selected { border-color: var(--navy); background: #dbeafe; color: var(--navy); }

/* ── Calendar ────────────────────────────────────────────── */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.calendar-nav button {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1.5px solid var(--gray-3);
    background: #fff;
    font-size: 18px;
    color: var(--gray-6);
    transition: all .12s;
}
.calendar-nav button:hover { border-color: var(--navy); color: var(--navy); }
#calTitle { font-size: 16px; font-weight: 700; color: var(--navy); }

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
}
.calendar-header span {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-6);
    padding: 6px 0;
}
.calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    min-height: 200px;
}
.cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 13px;
    cursor: default;
    padding: 4px 2px;
    gap: 2px;
    min-height: 44px;
}
.cal-day.empty { background: transparent; }
.cal-day.today { border: 1.5px solid var(--navy); }
.cal-day.has-schedule {
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    cursor: pointer;
    transition: all .12s;
}
.cal-day.has-schedule:hover { background: var(--navy); color: #fff; }
.cal-day.has-schedule:hover .cal-remain { color: rgba(255,255,255,.8); }
.cal-day.closed-schedule { background: #f3f4f6; border-color: var(--gray-3); cursor: pointer; }
.cal-day.closed-schedule .cal-full-txt { color: var(--gray-6); }
.cal-day-num { font-weight: 700; line-height: 1; }
.cal-remain { font-size: 10px; color: var(--blue); font-weight: 600; }
.cal-full-txt { font-size: 10px; color: var(--gray-6); }
.cal-loading { grid-column: 1/-1; text-align: center; padding: 40px; color: var(--gray-6); }

/* ── Schedule List ───────────────────────────────────────── */
.schedule-list { margin-top: 16px; }
.schedule-item {
    background: var(--gray-1);
    border: 1.5px solid var(--gray-3);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all .12s;
}
.schedule-item:hover, .schedule-item.selected {
    border-color: var(--navy);
    background: #eff6ff;
}
.sch-course { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.sch-info   { font-size: 13px; color: var(--gray-6); margin-bottom: 8px; }
.sch-meta   { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.sch-fee    { font-size: 14px; font-weight: 700; color: var(--navy); }
.sch-remain { font-size: 13px; }
.sch-remain.ok   { color: var(--green); }
.sch-remain.warn { color: var(--orange); }
.sch-remain.full { color: var(--red); }

/* ── Form ────────────────────────────────────────────────── */
.selected-schedule-box {
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 24px;
    font-size: 13.5px;
    color: #1e40af;
    line-height: 1.7;
}
.form-section { margin-bottom: 28px; }
.form-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
    border-bottom: 2px solid var(--navy);
    padding-bottom: 8px;
    margin-bottom: 18px;
}
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 5px;
}
.req { color: var(--red); margin-left: 2px; }
.form-group input[type=text],
.form-group input[type=email],
.form-group input[type=tel],
.form-group input[type=file] {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1.5px solid var(--gray-3);
    border-radius: 9px;
    font-size: 14px;
    color: var(--gray-9);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
    background: #fff;
}
.form-group input:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(26,63,111,.1);
}
.form-group input[type=file] { padding: 10px 14px; height: auto; }
.form-hint { display: block; font-size: 12px; color: var(--gray-6); margin-top: 4px; line-height: 1.5; }

.address-row { display: flex; gap: 8px; }
.address-row input { flex: 1; }
.btn-address {
    height: 46px;
    padding: 0 16px;
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .12s;
}
.btn-address:hover { background: var(--navy-d); }

/* ── 결제방법 ─────────────────────────────────────────────── */
.pay-method-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 0;   /* 탭과 설명 박스를 폴더 탭처럼 붙임 (기존 16px) */
}
.pay-method-item { cursor: pointer; }
.pay-method-item input { display: none; }
.pay-label {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    border: 2px solid var(--gray-3);
    border-radius: 10px 10px 0 0;   /* 위만 둥글게 (아래는 설명 박스와 연결) */
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-6);
    transition: all .12s;
}
.pay-method-item input:checked + .pay-label {
    border-color: var(--navy);
    background: var(--navy);
    color: #fff;
    margin-bottom: -2px;   /* 설명 박스 위 테두리를 덮어 한 덩어리로 연결 */
    position: relative;
    z-index: 1;            /* 박스 테두리 위로 올라오게 */
}
.transfer-info {
    background: var(--gray-1);
    border: 2px solid var(--navy);    /* 선택 탭과 같은 남색 테두리로 통일 */
    border-radius: 0 0 10px 10px;     /* 위는 탭과 붙고 아래만 둥글게 */
    padding: 16px;
}
.bank-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-size: 15px;
}
.account-no { font-weight: 700; color: var(--navy); font-size: 17px; }
.account-holder { color: var(--gray-6); font-size: 13px; }
.transfer-note { font-size: 13px; color: var(--orange); font-weight: 600; margin-bottom: 16px; }

/* ── 체크박스 ─────────────────────────────────────────────── */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    cursor: pointer;
}
.checkbox-label input[type=checkbox] {
    width: 18px;
    height: 18px;
    accent-color: var(--navy);
    flex-shrink: 0;
}

/* ── 개인정보 동의 ───────────────────────────────────────── */
.form-privacy {
    background: var(--gray-1);
    border: 1px solid var(--gray-3);
    border-radius: 9px;
    padding: 14px 16px;
    margin-bottom: 20px;
}
.privacy-link { color: var(--blue); font-size: 12.5px; margin-left: 6px; }

/* ── Submit ───────────────────────────────────────────────── */
.btn-submit {
    width: 100%;
    height: 54px;
    background: var(--navy);
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    border: none;
    border-radius: 12px;
    transition: background .12s;
    letter-spacing: .5px;
}
.btn-submit:hover { background: var(--navy-d); }
.btn-submit:disabled { background: var(--gray-3); color: var(--gray-6); cursor: not-allowed; }

.form-error {
    background: #fff3f3;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13.5px;
    color: #c62828;
    margin-bottom: 14px;
}

/* ── 환불 규정 고지 (정적, 신청 동의 단계) ───────────────── */
.refund-notice {
    background: #fffbf0;
    border: 1px solid #fde68a;
    border-radius: 9px;
    padding: 16px 18px;
    margin-bottom: 16px;
}
.refund-notice-title { font-size: 14px; font-weight: 700; color: #7c5200; margin-bottom: 12px; }
.refund-notice-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 10px; }
.refund-notice-table th { background: #fef3c7; color: #7c5200; font-weight: 700; font-size: 12px; padding: 7px 10px; text-align: left; border-bottom: 1px solid #fde68a; }
.refund-notice-table td { padding: 8px 10px; border-bottom: 1px solid #fef0c7; color: var(--gray-9); }
.refund-notice-table tr:last-child td { border-bottom: none; }
.refund-notice-table .r-full { color: var(--green);  font-weight: 700; }
.refund-notice-table .r-half { color: var(--orange); font-weight: 700; }
.refund-notice-table .r-none { color: var(--red);    font-weight: 800; }
.refund-notice-table .r-none-row { background: #fff1f2; }
.refund-notice-warn {
    font-size: 13px; color: var(--red); font-weight: 700;
    background: #fff1f2; border: 1px solid #fecaca; border-radius: 7px;
    padding: 9px 12px; margin-bottom: 10px; line-height: 1.6;
}
.refund-notice-list { list-style: none; }
.refund-notice-list li { font-size: 12.5px; color: #7c5200; line-height: 1.8; padding-left: 12px; position: relative; }
.refund-notice-list li::before { content: '·'; position: absolute; left: 3px; }

/* ── 필수 동의 3종 ───────────────────────────────────────── */
.form-privacy .agree-row { align-items: flex-start; }
.form-privacy .agree-row + .agree-row { margin-top: 10px; }
.agree-req { color: var(--red); font-weight: 700; margin-right: 2px; }
.agree-links { margin-left: auto; white-space: nowrap; }

/* ── 사이트 푸터 ─────────────────────────────────────────── */
.site-footer {
    background: var(--navy);
    color: rgba(255,255,255,.7);
    padding: 22px 24px;
    font-size: 12.5px;
    line-height: 1.7;
    text-align: center;
}
.site-footer strong { color: #fff; font-weight: 700; }
.site-footer a { color: rgba(255,255,255,.85); }
.site-footer a:hover { color: #fff; }

/* ── Back button ─────────────────────────────────────────── */
.btn-back {
    display: inline-block;
    margin-top: 20px;
    color: var(--gray-6);
    font-size: 13.5px;
    background: none;
    border: none;
    padding: 6px 0;
    transition: color .12s;
}
.btn-back:hover { color: var(--navy); }

/* ── Complete ────────────────────────────────────────────── */
.complete-card { text-align: center; padding: 48px 28px; }
.complete-icon { font-size: 56px; margin-bottom: 16px; }
.complete-title { font-size: 24px; font-weight: 800; color: var(--navy); margin-bottom: 8px; }
.complete-sub   { font-size: 15px; color: var(--gray-6); margin-bottom: 28px; }
.app-no-box {
    background: #eff6ff;
    border: 2px solid #bfdbfe;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}
.app-no-label { display: block; font-size: 13px; color: var(--gray-6); margin-bottom: 6px; }
.app-no-value { display: block; font-size: 22px; font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.app-no-hint  { font-size: 12px; color: var(--blue); }
.complete-notice {
    background: var(--gray-1);
    border-radius: 10px;
    padding: 18px;
    text-align: left;
    font-size: 14px;
    line-height: 2;
    margin-bottom: 24px;
    color: var(--gray-9);
}
.contact-info { color: var(--gray-6); font-size: 13px; }
.btn-new-apply {
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 14px 36px;
    font-size: 15px;
    font-weight: 700;
    transition: background .12s;
}
.btn-new-apply:hover { background: var(--navy-d); }

/* ── Modal / Overlay ─────────────────────────────────────── */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.overlay.open { display: flex; }
.modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 8px 40px rgba(0,0,0,.15);
    overflow: hidden;
}
.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--gray-3);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-header button { background: none; border: none; font-size: 20px; color: var(--gray-6); cursor: pointer; }
.modal-body { padding: 20px 24px; font-size: 13.5px; line-height: 1.8; }
.modal-body p { margin-bottom: 10px; }
.modal-footer { padding: 12px 24px 20px; display: flex; gap: 10px; align-items: center; }
.btn-agree    { background: var(--navy); color: #fff; border: none; border-radius: 8px; padding: 10px 20px; font-size: 14px; font-weight: 700; }
.btn-disagree { background: var(--gray-2); color: var(--gray-6); border: none; border-radius: 8px; padding: 10px 20px; font-size: 14px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
    .step-label  { font-size: 9px; }
    .step-card   { padding: 24px 16px; }
    .step-title  { font-size: 17px; }
    .btn-choice-group { grid-template-columns: 1fr; }
    .region-grid { grid-template-columns: repeat(3, 1fr); }
    .btn-choice  { height: 60px; font-size: 14px; }
    .logo-img    { height: 40px; }
}
