* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: white;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
}

/* iframe 환경 - 최소 설정 */
body.in-iframe {
    overflow: visible;
}

body.in-iframe .container {
    min-height: auto;
}

.container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    background: white;
    border-radius: 0;
    box-shadow: none;
    overflow-x: hidden;
}

.header {
    background: #ff6b35;
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.content {
    padding: 40px;
}

/* 단계별 표시 */
.steps {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    position: relative;
}

.steps::before {
    display: none;
}

.step {
    text-align: center;
    position: relative;
    z-index: 1;
}

.step-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 6px;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.step.active .step-circle {
    background: #ff6b35;
    color: white;
    transform: scale(1.15);
}

.step.completed .step-circle {
    background: #4caf50;
    color: white;
}

.step-label {
    font-size: 0.75rem;
    color: #666;
    white-space: nowrap;
}

.step.active .step-label {
    color: #ff6b35;
    font-weight: bold;
}

/* 섹션 */
.section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 측정 타입 선택 */
.measurement-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.measurement-card {
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.measurement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.measurement-card.selected {
    border-color: #ff6b35;
    background: rgba(255, 107, 53, 0.1);
}

.measurement-card h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #333;
}

.measurement-card .price {
    font-size: 1.5rem;
    color: #ff6b35;
    font-weight: bold;
    margin-bottom: 10px;
}

.measurement-card .original-price {
    font-size: 1rem;
    color: #999;
    text-decoration: line-through;
    margin-bottom: 15px;
}

.measurement-card .duration {
    font-size: 0.9rem;
    color: #666;
    background: #f5f5f5;
    padding: 8px 15px;
    border-radius: 20px;
    display: inline-block;
}

/* 캘린더 */
.calendar {
    margin-bottom: 30px;
}

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

.calendar-header h3 {
    font-size: 1.5rem;
    color: #333;
}

.calendar-nav {
    display: flex;
    gap: 10px;
}

.calendar-nav button {
    background: #ff6b35;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.calendar-nav button:hover {
    background: #e65a2b;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.calendar-day {
    aspect-ratio: 1;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.calendar-day:hover:not(.disabled):not(.other-month) {
    background: #f5f5f5;
    transform: scale(1.05);
}

.calendar-day.selected {
    background: #ff6b35;
    color: white;
    border-color: #ff6b35;
}

.calendar-day.today {
    border-color: #4caf50;
}

.calendar-day.disabled {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
}

.calendar-day.other-month {
    color: #ccc;
}

/* 휴무일이지만 분석관찰만 가능한 날 */
.calendar-day.analysis-only-day {
    background: #fff8e1;
    border-color: #ffc107;
    color: #e65100;
    cursor: pointer;
}

.calendar-day.analysis-only-day::after {
    content: '분';
    display: block;
    font-size: 0.5rem;
    color: #ff8f00;
    margin-top: -2px;
    font-weight: bold;
}

.weekday-header {
    text-align: center;
    font-weight: bold;
    color: #666;
    padding: 10px;
}

/* 시간 슬롯 */
.time-slots {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 30px;
    /* 터치 스크롤 허용 */
    touch-action: pan-y;
}

.time-slot {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    /* 터치 스크롤 허용 */
    touch-action: manipulation;
}

/* 데스크톱에서만 호버 효과 */
@media (hover: hover) {
    .time-slot:hover:not(.unavailable) {
        background: #f5f5f5;
        transform: scale(1.05);
    }
}

.time-slot.selected {
    background: #ff6b35;
    color: white;
    border-color: #ff6b35;
}

.time-slot.unavailable {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* 폼 */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #ff6b35;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85rem;
}

/* 토스 스타일 순차 입력 폼 */
.form-field {
    margin-bottom: 35px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #ff6b35;
    animation: slideIn 0.4s ease-out;
    opacity: 1;
}

.form-field label {
    display: block;
    margin-bottom: 15px;
    font-weight: 700;
    color: #222;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"] {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    font-size: 1.05rem;
    background: white;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
}

.form-field input:focus {
    outline: none;
    border-color: #ff6b35;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.08);
    transform: translateY(-1px);
}

.form-field input::placeholder {
    color: #adb5bd;
}

.form-field small {
    display: block;
    margin-top: 10px;
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
    padding-left: 4px;
}

/* 라디오 버튼 스타일 개선 */
.form-field input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.form-field input[type="radio"]:checked {
    border-color: #ff6b35;
    background: #ff6b35;
}

.form-field input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

.form-field input[type="radio"]:hover {
    border-color: #ff6b35;
}

/* 라디오 버튼 레이블 호버 효과 */
.form-field label:has(input[type="radio"]):hover {
    border-color: #ff6b35 !important;
    background: #fff5f1 !important;
}

.form-field label:has(input[type="radio"]:checked) {
    border-color: #ff6b35 !important;
    background: #fff5f1 !important;
}

/* 체크박스 스타일 개선 */
.form-field input[type="checkbox"] {
    appearance: none;
    width: 24px;
    height: 24px;
    min-width: 24px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.form-field input[type="checkbox"]:checked {
    border-color: #ff6b35;
    background: #ff6b35;
}

.form-field input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.form-field input[type="checkbox"]:hover {
    border-color: #ff6b35;
}

/* 체크박스 레이블 호버 효과 */
label:has(input[type="checkbox"]):hover {
    border-color: #ff6b35 !important;
    background: #fff5f1 !important;
}

label:has(input[type="checkbox"]:checked) {
    border-color: #ff6b35 !important;
    background: #fff5f1 !important;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 버튼 */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #ff6b35;
    color: white;
}

.btn-primary:hover {
    background: #e65a2b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
}

/* 알림 메시지 */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

.alert.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 예약 요약 */
.booking-summary {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.booking-summary h3 {
    margin-bottom: 20px;
    color: #333;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.summary-item:last-child {
    border-bottom: none;
    font-size: 1.2rem;
    font-weight: bold;
    color: #ff6b35;
    padding-top: 20px;
}

.summary-label {
    color: #666;
}

.summary-value {
    font-weight: 600;
    color: #333;
}

/* 로딩 스피너 */
.loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.loading.show {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff6b35;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    body {
        padding: 10px;
        font-size: 14px;
    }

    .content {
        padding: 15px;
    }

    .header {
        padding: 20px 15px;
    }

    .header h1 {
        font-size: 1.4rem;
        margin-bottom: 8px;
    }

    .header p {
        font-size: 0.85rem;
    }

    .steps {
        gap: 10px;
        margin-bottom: 20px;
    }

    .step-circle {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }

    .step-label {
        font-size: 0.7rem;
    }

    h2 {
        font-size: 1.3rem !important;
        margin-bottom: 20px !important;
    }

    h3 {
        font-size: 1.1rem !important;
        margin-bottom: 12px !important;
    }

    .measurement-types {
        grid-template-columns: 1fr;
    }

    .calendar-grid {
        gap: 5px;
    }

    .calendar-day {
        font-size: 0.85rem;
    }

    .weekday-header {
        font-size: 0.85rem;
        padding: 5px;
    }

    .button-group {
        flex-direction: column;
        gap: 10px;
    }

    .button-group .btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 1rem;
    }

    .form-field {
        padding: 18px;
        margin-bottom: 20px;
    }

    .form-field label {
        font-size: 1rem;
        margin-bottom: 10px;
    }

    .form-field input {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .booking-summary {
        padding: 18px;
    }

    /* 모바일에서 안내 박스 간격 조정 */
    div[style*="padding: 25px"] {
        padding: 15px !important;
    }

    div[style*="font-size: 1.5rem"] {
        font-size: 1.2rem !important;
    }

    div[style*="font-size: 1.1rem"] {
        font-size: 0.95rem !important;
    }

    /* 모바일에서 시간 슬롯 - 화면에 맞게 */
    #time-selection {
        overflow: visible !important;
    }

    #time-slots {
        overflow: visible !important;
    }

    #time-slots > div {
        width: 100% !important;
    }
}
