/* 캐리커처 접수 시스템 — 모바일 최적화 스타일시트 */

/* ─── 기본 리셋 & 폰트 ─── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
    background: #f0f2f5;
    color: #222;
    min-height: 100vh;
}

/* ─── 화면 전환 ─── */
.screen { display: none; padding: 20px; max-width: 480px; margin: 0 auto; }
.screen.active { display: block; }

/* ─── 헤더 ─── */
.header {
    text-align: center;
    padding: 24px 0 16px;
}
.header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1a2e;
}
.header .subtitle {
    font-size: 0.95rem;
    color: #666;
    margin-top: 6px;
}

/* ─── 스타일 선택 그리드 ─── */
.style-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 10px;
    padding-bottom: 30px;
}

.style-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.style-card:active {
    transform: scale(0.97);
    box-shadow: 0 1px 6px rgba(0,0,0,0.12);
}

.style-img-wrap {
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: #e8e8e8;
}
.style-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.style-name {
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 10px 6px;
    color: #333;
    background: #fff;
    word-break: keep-all;
}

/* ─── 업로드 화면 ─── */
.back-btn {
    background: none;
    border: none;
    font-size: 0.9rem;
    color: #555;
    cursor: pointer;
    padding: 4px 0;
    display: block;
    margin-bottom: 8px;
}

.selected-style-label {
    font-size: 0.85rem;
    color: #888;
    margin-top: 4px;
}
.selected-style-label span {
    color: #4361ee;
    font-weight: 600;
}

.form-wrap { margin-top: 16px; }

.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}
.form-group input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #ddd;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}
.form-group input[type="text"]:focus {
    border-color: #4361ee;
}

/* ─── 사진 버튼 ─── */
.photo-buttons {
    display: flex;
    gap: 10px;
}
.photo-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 10px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: opacity 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.camera-btn {
    background: #4361ee;
    color: white;
}
.gallery-btn {
    background: #fff;
    color: #4361ee;
    border: 2px solid #4361ee;
}
.photo-btn:active { opacity: 0.8; }

/* ─── 사진 미리보기 ─── */
.preview-wrap {
    margin-top: 14px;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #eee;
}
.preview-wrap img {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    display: block;
}
.remove-photo-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.55);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.8rem;
    cursor: pointer;
}

/* ─── 접수 버튼 ─── */
.submit-btn {
    width: 100%;
    padding: 18px;
    background: #4361ee;
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s, opacity 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.submit-btn:disabled {
    background: #b0b8d0;
    cursor: not-allowed;
}
.submit-btn:not(:disabled):active { opacity: 0.85; }

/* ─── 완료 화면 ─── */
.done-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    text-align: center;
}
.done-icon { font-size: 4rem; margin-bottom: 12px; }
.done-wrap h1 { font-size: 1.8rem; color: #1a1a2e; margin-bottom: 24px; }

.queue-number-box {
    background: #fff;
    border-radius: 20px;
    padding: 30px 50px;
    box-shadow: 0 4px 20px rgba(67,97,238,0.15);
    margin-bottom: 20px;
}
.queue-label { font-size: 0.9rem; color: #888; margin-bottom: 8px; }
.queue-number {
    font-size: 5rem;
    font-weight: 800;
    color: #4361ee;
    line-height: 1;
}
.queue-style { font-size: 0.85rem; color: #666; margin-top: 8px; }

.done-msg { font-size: 1rem; color: #555; margin-bottom: 30px; }

.restart-btn {
    padding: 14px 40px;
    background: #f0f2f5;
    color: #333;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

/* ─── 로딩 오버레이 ─── */
.loading {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999;
}
.loading p { margin-top: 14px; font-size: 1rem; color: #444; }
.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e0e0e0;
    border-top-color: #4361ee;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── 유틸 ─── */
.hidden { display: none !important; }
