body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
}

.container {
    background-color: white;
    border: 2px solid #ccc;
    border-radius: 15px;
    padding: 20px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    position: relative;
}

.title {
    text-align: center;
    font-size: 48px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    font-style: italic;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

/* 라디오 버튼 그룹 스타일 */
.radio-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    width: 100%;
    text-align: center;
}

.radio-label {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 8px 16px;
    border: 2px solid #ccc;
    border-radius: 25px;
    transition: all 0.3s ease;
    background-color: white;
    min-width: 80px;
    flex-shrink: 0;
    text-align: center;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.radio-label:hover {
    border-color: #007bff;
    background-color: #f8f9fa;
}

.radio-label input[type="radio"] {
    margin-right: 8px;
    transform: scale(1.2);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-radius: 50%;
    background-color: white;
    position: relative;
    flex-shrink: 0;
}

.radio-label input[type="radio"]:checked {
    border-color: #007bff;
    background-color: #007bff;
}

.radio-label input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: white;
}

.radio-label input[type="radio"]:checked + .radio-text {
    color: #007bff;
    font-weight: 600;
}

.radio-label:has(input[type="radio"]:checked) {
    border-color: #007bff;
    background-color: #e3f2fd;
}

.radio-text {
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    flex: 1;
}

.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    margin-bottom: 3px;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}



.form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}



.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background-color: white;
    border: 2px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
}

.verify-btn {
    width: 100%;
    padding: 12px;
    background-color: white;
    border: 2px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 28px;
    transition: all 0.3s ease;
}

.verify-btn:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
}

.error-msg {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

.form-group input.error {
    border-color: #dc3545;
}

.form-group input.valid {
    border-color: #28a745;
}

.form-group input:disabled {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

.phone-row {
    display: flex;
    gap: 8px;
    align-items: end;
    flex-wrap: wrap;
}

.phone-input {
    flex: 2;
    min-width: 200px;
}

.get-code-btn {
    flex: 1;
    padding: 12px 8px;
    background-color: white;
    border: 2px solid #ccc;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 80px;
}

.get-code-btn:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
}

.get-code-btn:disabled {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    border-color: #ccc;
}

.reset-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 12px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.reset-btn:hover {
    background-color: #c82333;
}

.container {
    position: relative;
}

.timer-display {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #dc3545;
    margin: 10px 0;
    display: none;
}

.timer-display.active {
    display: block;
}

.timeout-message {
    color: #dc3545;
    font-size: 12px;
    text-align: center;
    margin-top: 10px;
    display: none;
}

.timeout-message.show {
    display: block;
}

.verify-btn:disabled,
.submit-btn:disabled {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    border-color: #ccc;
}

/* 로딩 스피너 스타일 */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading .loading-spinner {
    display: inline-block;
}

/* 에러 메시지 스타일 */
.error-msg {
    color: #dc3545;
    font-size: 12px;
    margin-top: 3px;
    margin-bottom: 5px;
    display: block;
    min-height: 0;
    line-height: 1.2;
}

/* 에러 상태 input 스타일 */
input.error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* 유효한 상태 input 스타일 */
input.valid {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}


/* 모바일 최적화 미디어 쿼리 */
@media (max-width: 768px) {
    body {
        padding: 5px;
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .container {
        padding: 15px;
        border-radius: 10px;
        margin: 0;
        min-height: auto;
    }
    
    .title {
        font-size: 36px;
        margin-bottom: 8px;
    }
    
    .subtitle {
        font-size: 13px;
        margin-bottom: 25px;
    }
    
    .radio-group {
        gap: 15px;
        margin-bottom: 25px;
        justify-content: center;
        align-items: center;
        width: 100%;
    }
    
    .radio-label {
        padding: 6px 12px;
        min-width: 70px;
        font-size: 13px;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 4px;
    }
    
    .form-group input {
        padding: 10px;
        font-size: 16px; /* iOS 줌 방지 */
    }
    
    .phone-row {
        gap: 6px;
    }
    
    .phone-input {
        min-width: 150px;
    }
    
    .get-code-btn {
        padding: 10px 6px;
        font-size: 11px;
        min-width: 70px;
    }
    
    .verify-btn {
        padding: 10px;
        font-size: 13px;
        margin-top: 20px;
    }
    
    .submit-btn {
        padding: 12px;
        font-size: 14px;
        margin-top: 15px;
    }
    
    .timer-display {
        font-size: 16px;
        margin: 8px 0;
    }
    
    .error-msg {
        font-size: 11px;
        line-height: 1.3;
    }
    
    .reset-btn {
        top: 10px;
        right: 10px;
        padding: 5px 10px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 3px;
    }
    
    .container {
        padding: 12px;
        border-radius: 8px;
    }
    
    .title {
        font-size: 32px;
        margin-bottom: 6px;
    }
    
    .subtitle {
        font-size: 12px;
        margin-bottom: 20px;
    }
    
    .radio-group {
        gap: 10px;
        margin-bottom: 20px;
        justify-content: center;
        align-items: center;
        width: 100%;
        display: flex;
    }
    
    .radio-label {
        padding: 5px 10px;
        min-width: 60px;
        font-size: 12px;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
        display: flex;
    }
    
    .form-group {
        margin-bottom: 10px;
    }
    
    .form-group label {
        font-size: 13px;
        margin-bottom: 3px;
    }
    
    .form-group input {
        padding: 8px;
        font-size: 16px; /* iOS 줌 방지 */
    }
    
    .phone-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .phone-input {
        min-width: auto;
        width: 100%;
    }
    
    .get-code-btn {
        width: 100%;
        padding: 10px;
        font-size: 12px;
        min-width: auto;
    }
    
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .verify-btn {
        width: 100%;
        padding: 12px;
        font-size: 14px;
        margin-top: 15px;
    }
    
    .submit-btn {
        padding: 14px;
        font-size: 15px;
        margin-top: 12px;
    }
    
    .timer-display {
        font-size: 15px;
        margin: 6px 0;
    }
    
    .error-msg {
        font-size: 10px;
        line-height: 1.4;
    }
    
    .timeout-message {
        font-size: 10px;
        margin-top: 8px;
    }
    
    .reset-btn {
        top: 8px;
        right: 8px;
        padding: 4px 8px;
        font-size: 9px;
    }
}

/* 가로 모드 최적화 */
@media (max-width: 768px) and (orientation: landscape) {
    body {
        align-items: center;
        padding-top: 10px;
    }
    
    .container {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .title {
        font-size: 28px;
        margin-bottom: 5px;
    }
    
    .subtitle {
        margin-bottom: 15px;
    }
    
    .radio-group {
        margin-bottom: 15px;
    }
    
    .form-group {
        margin-bottom: 8px;
    }
}/* iOS S
afari 호환성 개선 */
@supports (-webkit-appearance: none) {
    .radio-group {
        -webkit-box-pack: center;
        -webkit-justify-content: center;
        -ms-flex-pack: center;
        justify-content: center;
        -webkit-box-align: center;
        -webkit-align-items: center;
        -ms-flex-align: center;
        align-items: center;
    }
    
    .radio-label {
        -webkit-box-pack: center;
        -webkit-justify-content: center;
        -ms-flex-pack: center;
        justify-content: center;
        -webkit-box-align: center;
        -webkit-align-items: center;
        -ms-flex-align: center;
        align-items: center;
    }
}

/* iOS 특정 수정 */
@media screen and (-webkit-min-device-pixel-ratio: 2) {
    .radio-group {
        display: -webkit-box;
        display: -webkit-flex;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-pack: center;
        -webkit-justify-content: center;
        -ms-flex-pack: center;
        justify-content: center;
        -webkit-box-align: center;
        -webkit-align-items: center;
        -ms-flex-align: center;
        align-items: center;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
    
    .radio-label {
        -webkit-flex-shrink: 0;
        -ms-flex-negative: 0;
        flex-shrink: 0;
        -webkit-box-pack: center;
        -webkit-justify-content: center;
        -ms-flex-pack: center;
        justify-content: center;
    }
}