/* =======================================================================
   RAON Robotics 방문신청 전용 스타일
   Trendy redesign 2025
   ======================================================================= */

/* ── 진행 단계 표시 ─────────────────── */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    max-width: 480px;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    flex: 1;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    border: 2px solid #d1d9e8;
    background: #fff;
    color: #9aacbe;
    transition: all .2s;
    position: relative;
    z-index: 1;
}

.step-label {
    font-size: 12px;
    font-weight: 600;
    color: #9aacbe;
    white-space: nowrap;
    letter-spacing: -.01em;
}

/* 완료된 단계 */
.step-item.done .step-circle {
    background: #e8eeff;
    border-color: #1c52cc;
    color: #1c52cc;
}
.step-item.done .step-label {
    color: #1c52cc;
}

/* 현재 단계 */
.step-item.active .step-circle {
    background: #1c52cc;
    border-color: #1c52cc;
    color: #fff;
    box-shadow: 0 4px 14px rgba(28,82,204,.35);
}
.step-item.active .step-label {
    color: #1c52cc;
    font-weight: 700;
}

/* 단계 사이 연결선 */
.step-line {
    flex: 1;
    height: 2px;
    background: #d1d9e8;
    margin-bottom: 22px;
    max-width: 60px;
}
.step-line.done {
    background: #1c52cc;
}

/* ── 버튼 공통 베이스 ──────────────── */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    padding: 9px 22px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
    letter-spacing: -.01em;
    text-decoration: none;
    transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
}

/* ── 긍정/확정/동의 — 파란 채움 ──── */
.btn-primary {
    background: #1c52cc;
    border: 1.5px solid #1c52cc;
    color: #fff;
    box-shadow: 0 1px 3px rgba(28,82,204,.18), 0 3px 10px rgba(28,82,204,.18);
}
.btn-primary:hover {
    background: #1240a8;
    border-color: #1240a8;
    box-shadow: 0 2px 6px rgba(28,82,204,.22), 0 6px 18px rgba(28,82,204,.26);
}
.btn-primary:active  { background: #0e3490; border-color: #0e3490; box-shadow: none; }
.btn-primary:disabled { opacity: .38; cursor: not-allowed; box-shadow: none; }

/* ── 부정/취소/거절 — 아웃라인 뉴트럴 ── */
.btn-secondary {
    background: #fff;
    border: 1.5px solid rgba(200,210,235,.9);
    color: #4a5a78;
    box-shadow: 0 1px 3px rgba(20,40,90,.06);
}
.btn-secondary:hover {
    background: #f4f6fb;
    border-color: #9aacbe;
    color: #1a2540;
    box-shadow: 0 1px 4px rgba(20,40,90,.1);
}
.btn-secondary:active { background: #edf0f7; }

/* ── 약관동의 / 액션 버튼 고정 크기 ── */
.agree-actions .btn-primary,
.agree-actions .btn-secondary,
.action-row .btn-primary,
.action-row .btn-secondary {
    width: 190px;
    height: 44px;
    font-size: 15px;
    font-weight: 700;
}

.action-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.btn-42 { height: 42px; padding: 0 18px; line-height: 1; min-width: 88px; }

/* ── 약관 영역 ───────────────────── */
.agree-area textarea {
    width: 100%;
    height: 150px;
    padding: 14px;
    border: 1.5px solid rgba(200,210,235,.8);
    border-radius: 10px;
    background: #f8faff;
    resize: none;
    font-size: 13px;
    color: #4a5a78;
    line-height: 1.65;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.agree-area textarea:focus {
    outline: none;
    border-color: #1c52cc;
    box-shadow: 0 0 0 3px rgba(28,82,204,.1);
}

.agree-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 14px;
    color: #2d3d58;
    cursor: pointer;
}
.agree-row input {
    width: 17px; height: 17px;
    accent-color: #1c52cc;
    cursor: pointer;
}

.agree-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* ── 카드 타이틀 ─────────────────── */
.card-title {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #1c52cc;
    background: #e8eeff;
    border-radius: 6px;
    padding: 5px 12px;
    border: 1px solid rgba(28,82,204,.2);
    margin: 0 0 14px;
}

/* ── 섹션 헤드 ───────────────────── */
.section-head {
    font-weight: 800;
    font-size: 15px;
    color: #0e1d38;
    letter-spacing: -.025em;
    margin: 0 0 16px;
}

/* ── 폼 그리드 / 필드 ────────────── */
.form-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 8px;
    align-items: center;
}

.form-grid label,
.form-grid > span {
    font-size: 14px;
    font-weight: 600;
    color: #2d3d58;
    letter-spacing: -.01em;
    font-family: inherit;
}

.field {
    padding: 8px 13px;
    border: 1.5px solid rgba(200,210,235,.8);
    border-radius: 10px;
    width: 100%;
    background: #fff;
    font-size: 14px;
    color: #1a2540;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.field:hover:not(:focus):not(:disabled) {
    border-color: rgba(28,82,204,.25);
}
.field:focus {
    outline: none;
    border-color: #1c52cc;
    box-shadow: 0 0 0 3px rgba(28,82,204,.1);
}

.inline { display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; }
.hint { color: #9aacbe; font-size: 12px; margin-top: 8px; line-height: 1.5; }
.muted { color: #6b7a94; font-size: 12px; }

/* ── 방문객 리스트 ───────────────── */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 12px;
}
.counter {
    font-size: 13px;
    font-weight: 600;
    color: #6b7a94;
}

/* 방문객 카드 */
.visitor-row {
    border: 1.5px solid rgba(200,210,235,.7);
    background: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    transition: border-color .15s, box-shadow .15s;
}
.visitor-row:hover {
    border-color: rgba(28,82,204,.25);
    box-shadow: 0 2px 10px rgba(28,82,204,.08);
}

/* 카드 헤더: 번호 + 삭제 */
.visitor-row-hd {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.visitor-num {
    font-size: 11px;
    font-weight: 700;
    color: #1c52cc;
    background: #eef2ff;
    border: 1px solid rgba(28,82,204,.2);
    border-radius: 6px;
    padding: 3px 10px;
    letter-spacing: .02em;
}

/* 필드 그리드: 5열 균등 */
.visitor-fields {
    display: grid;
    grid-template-columns: 1.4fr 1fr 2fr 1.5fr 1.2fr;
    gap: 8px;
    align-items: center;
}

.btn-mini {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1.5px solid rgba(200,210,235,.8);
    background: #fff;
    color: #4a5a78;
    cursor: pointer;
    font-weight: 700;
    font-size: 12px;
    font-family: inherit;
    letter-spacing: -.01em;
    transition: background .15s, border-color .15s, color .15s;
}
.btn-mini:hover { background: #f4f6fb; border-color: #9aacbe; color: #1a2540; }

/* 삭제 등 실제 위험 액션 */
.btn-mini--danger {
    background: #fff5f5;
    border-color: rgba(220,38,38,.25);
    color: #dc2626;
}
.btn-mini--danger:hover {
    background: #fee2e2;
    border-color: rgba(220,38,38,.5);
}

/* ── 모달 ─────────────────────────── */
.modal.hidden { display: none; }
.modal {
    position: fixed; inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
}
.modal__backdrop {
    position: absolute; inset: 0;
    background: rgba(7,15,32,.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.modal__dialog {
    position: relative; z-index: 1;
    width: min(560px, 92vw);
    background: #fff;
    border: 1px solid rgba(200,210,235,.8);
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(7,15,32,.2);
    padding: 0;
    animation: modalIn .2s cubic-bezier(.4,0,.2,1);
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(.94) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(200,210,235,.6);
    background: #f8faff;
    border-radius: 18px 18px 0 0;
}
.modal__title {
    margin: 0;
    font-weight: 800;
    font-size: 16px;
    color: #0e1d38;
    letter-spacing: -.02em;
}
.modal__close {
    border: 1px solid rgba(200,210,235,.8);
    background: #fff;
    color: #6b7a94;
    width: 34px; height: 34px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    display: grid;
    place-items: center;
    font-family: inherit;
    transition: background .15s, color .15s;
}
.modal__close:hover { background: #eef2ff; color: #0e1d38; }

.modal__body { padding: 20px; }
.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid rgba(200,210,235,.6);
    background: #f8faff;
    border-radius: 0 0 18px 18px;
}

.result-card {
    margin-top: 12px;
    border: 1.5px solid rgba(28,82,204,.18);
    border-radius: 12px;
    padding: 14px 16px;
    background: #f8faff;
}
.result-card.hidden { display: none; }
.result-row {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid rgba(200,210,235,.5);
}
.result-row:last-child { border-bottom: none; }
.result-key { color: #6b7a94; font-weight: 600; font-size: 13px; }
.result-val { color: #0e1d38; font-weight: 700; font-size: 13px; }

/* ── 방문목적 칩 ─────────────────── */
.purpose-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 10px;
}

.chip-outline.purpose-chip {
    appearance: none;
    border: 1.5px solid rgba(200,210,235,.8);
    background: #fff;
    color: #4a5a78;
    padding: 7px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    line-height: 1;
    font-family: inherit;
    transition: all .15s;
}
.chip-outline.purpose-chip:hover {
    background: #eef2ff;
    border-color: rgba(28,82,204,.3);
    color: #1c52cc;
    transform: translateY(-1px);
}
.chip-outline.purpose-chip:active { transform: translateY(0); }
.chip-outline.purpose-chip:focus-visible {
    outline: 3px solid rgba(28,82,204,.2);
    outline-offset: 2px;
}
.chip-outline.purpose-chip.is-active {
    background: #1c52cc;
    border-color: #1c52cc;
    color: #fff;
    box-shadow: 0 3px 12px rgba(28,82,204,.3);
}
.chip-outline.purpose-chip.is-active:hover {
    background: #1240a8;
    border-color: #1240a8;
}
.chip-outline.purpose-chip[disabled] {
    opacity: .5; cursor: not-allowed; transform: none;
}

/* ── 반응형 ──────────────────────── */
@media (max-width: 1024px) { .form-grid { grid-template-columns: 160px 1fr; } }
@media (max-width: 560px)  { .form-grid { grid-template-columns: 1fr; } }

/* 방문객 카드 — 태블릿: 2열 */
@media (max-width: 900px) {
    .visitor-fields {
        grid-template-columns: 1fr 1fr;
    }
    .visitor-fields .visitor-email,
    .visitor-fields .visitor-phone { grid-column: 1 / -1; }
}
/* 방문객 카드 — 모바일: 1열 */
@media (max-width: 480px) {
    .visitor-fields { grid-template-columns: 1fr; }
    .visitor-fields .visitor-email,
    .visitor-fields .visitor-phone { grid-column: auto; }
}

/* ── 커스텀 드롭다운 셀렉트 ─────────── */
.cs-wrap {
    position: relative;
    width: 100%;
}
.cs-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 13px;
    border: 1.5px solid rgba(200,210,235,.8);
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    color: #1a2540;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    line-height: 1.5;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
    letter-spacing: -.01em;
}
.cs-btn:hover:not(.cs-btn--disabled) { border-color: rgba(28,82,204,.25); }
.cs-btn:focus {
    outline: none;
    border-color: #1c52cc;
    box-shadow: 0 0 0 3px rgba(28,82,204,.1);
}
.cs-btn--disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.cs-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cs-arrow {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    color: #9aacbe;
    transition: transform .18s cubic-bezier(.4,0,.2,1);
}
.cs-wrap.is-open .cs-arrow { transform: rotate(180deg); }
.cs-wrap.is-open .cs-btn {
    border-color: #1c52cc;
    box-shadow: 0 0 0 3px rgba(28,82,204,.1);
}
.cs-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1.5px solid rgba(200,210,235,.8);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(20,40,90,.14);
    padding: 4px;
    margin: 0;
    list-style: none;
    z-index: 300;
    max-height: 240px;
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-6px) scale(.98);
    pointer-events: none;
    transition: opacity .15s cubic-bezier(.4,0,.2,1), transform .15s cubic-bezier(.4,0,.2,1);
    scrollbar-width: thin;
    scrollbar-color: rgba(28,82,204,.2) transparent;
}
.cs-menu::-webkit-scrollbar { width: 4px; }
.cs-menu::-webkit-scrollbar-track { background: transparent; }
.cs-menu::-webkit-scrollbar-thumb { background: rgba(28,82,204,.2); border-radius: 4px; }
.cs-wrap.is-open .cs-menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.cs-item {
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #1a2540;
    letter-spacing: -.01em;
    transition: background .1s, color .1s;
    user-select: none;
}
.cs-item:hover:not(.is-selected):not(.is-disabled) {
    background: #eef2ff;
    color: #1c52cc;
}
.cs-item.is-selected {
    background: #1c52cc;
    color: #fff;
    font-weight: 700;
}
.cs-item.is-disabled { opacity: .35; cursor: not-allowed; }
